-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
208 structure info #209
Merged
Merged
208 structure info #209
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds methods to HomeLogic - `getWorldRASToIJKTransform` - `getAllenLabelIndex` - `getAnnotation` Updates `getCrosshairPixelString` and `getPixelString` to use them.
Adds `structure` to each control point in JSON output. This value is ignored during file loading, only used as metadata in consuming applications. See #208. Note this change requires each `Annotation` instance hold a reference to the `HomeLogic` instance. Looking toward #196, it may make sense to introduce a "AtlasLogic" or similar which contains the volume node, color node, and related metadata _for only one atlas_. This metadata could then be serialized within `Annotation.toDict`.
Some sample JSON in the new format: Note there's only one markup with three control points, and each point is in a different structure. Point 2 is outside the atlas, so its structure is Such a case might not be "realistic" however it's important the file format is robust to such edge-cases. {
"version": "0.2.1+2022.03.04",
"markups": [
{
"markup": {
"type": "ClosedCurve",
"coordinateSystem": "LPS",
"controlPoints": [
{
"id": "1",
"position": [
-6897.8740234375,
6575.0,
-1308.8443603515625
],
"orientation": [
-1.0,
-0.0,
-0.0,
-0.0,
-1.0,
-0.0,
0.0,
0.0,
1.0
],
"structure": {
"id": 9,
"acronym": "SSp-tr6a"
}
},
{
"id": "2",
"position": [
-5673.08349609375,
6575.0,
-607.249267578125
],
"orientation": [
-1.0,
-0.0,
-0.0,
-0.0,
-1.0,
-0.0,
0.0,
0.0,
1.0
],
"structure": null
},
{
"id": "3",
"position": [
-5143.537109375,
6575.0,
-2108.5126953125
],
"orientation": [
-1.0,
-0.0,
-0.0,
-0.0,
-1.0,
-0.0,
0.0,
0.0,
1.0
],
"structure": {
"id": 382,
"acronym": "CA1"
}
}
]
},
"name": "Curve",
"orientation": [
1.0,
0.0,
0.0,
5686.499999999999,
0.0,
0.0,
1.0,
-6574.999999999999,
0.0,
1.0,
0.0,
-3987.4999999999995,
0.0,
0.0,
0.0,
1.0
],
"representationType": "spline",
"thickness": 50
}
],
"currentId": 0,
"referenceView": "Coronal",
"ontology": "Structure",
"stepSize": 24.999999999999996,
"cameraPosition": [
5873.272365267856,
-50203.60366698136,
-4026.6211672287745
],
"cameraViewUp": [
0.0,
0.0,
1.0
]
} |
This looks good to me. Thank you @allemangD ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
structure
to each control point in JSON output. This value is ignored during file loading, only used as metadata in consuming applications. Resolves #208. Note this change requires eachAnnotation
instance hold a reference to theHomeLogic
instance. Looking toward #196, it may make sense to introduce a "AtlasLogic" or similar which contains the volume node, color node, and related metadata for only one atlas. This metadata could then be serialized withinAnnotation.toDict
.Adds methods to HomeLogic
getWorldRASToIJKTransform
getAllenLabelIndex
getAnnotation
Updates
getCrosshairPixelString
andgetPixelString
to use them.Those methods, along with these attributes, could probably go in an
AtlasLogic
class:AllenStructurePaths
AllenLayerStructurePaths
AllenStructureNames
SlicerToAllenMapping
AllenToSlicerMapping