-
Notifications
You must be signed in to change notification settings - Fork 98
[ENH, MRG] Allow template coordinate frame writing #980
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
258fbae
wip
alexrockhill 24e4dd1
allow template coordinate frames for write
alexrockhill d1203fc
fix flake
alexrockhill 36b0be9
fix tests
alexrockhill d173e75
richard review, fix codecov
alexrockhill c29942d
fix raw file modified issue
alexrockhill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,7 +163,7 @@ | |
| # Annotations to never remove during reading or writing | ||
| ANNOTATIONS_TO_KEEP = ('BAD_ACQ_SKIP',) | ||
|
|
||
| coordsys_standard_template = [ | ||
| BIDS_STANDARD_TEMPLATE_COORDINATE_FRAMES = [ | ||
| 'ICBM452AirSpace', | ||
| 'ICBM452Warp5Space', | ||
| 'IXI549Space', | ||
|
|
@@ -216,7 +216,7 @@ | |
| # accepted coordinate SI units | ||
| BIDS_COORDINATE_UNITS = ['m', 'cm', 'mm'] | ||
| coordsys_wildcard = ['Other'] | ||
| BIDS_SHARED_COORDINATE_FRAMES = (coordsys_standard_template + | ||
| BIDS_SHARED_COORDINATE_FRAMES = (BIDS_STANDARD_TEMPLATE_COORDINATE_FRAMES + | ||
| coordsys_standard_template_deprecated + | ||
| coordsys_wildcard) | ||
|
|
||
|
|
@@ -264,11 +264,7 @@ | |
| MNE_TO_BIDS_FRAMES = { | ||
| 'ctf_head': 'CTF', | ||
| 'head': 'CapTrak', | ||
| 'mni_tal': 'fsaverage', | ||
| # 'fs_tal': 'fsaverage', # XXX: not used | ||
| 'unknown': 'Other', | ||
| 'ras': 'Other', | ||
| 'mri': 'Other' | ||
| 'mni_tal': 'fsaverage' | ||
| } | ||
|
|
||
| # these coordinate frames in mne-python are related to scalp/meg | ||
|
|
@@ -289,7 +285,7 @@ | |
| MNE_FRAME_TO_STR = {val: key for key, val in MNE_STR_TO_FRAME.items()} | ||
|
|
||
| # see BIDS specification for description we copied over from each | ||
| BIDS_COORD_FRAME_DESCRIPTIONS = { | ||
| BIDS_COORD_FRAME_DESCRIPTIONS = dict(**{ | ||
|
||
| 'acpc': 'The origin of the coordinate system is at the Anterior ' | ||
| 'Commissure and the negative y-axis is passing through the ' | ||
| 'Posterior Commissure. The positive z-axis is passing through ' | ||
|
|
@@ -318,7 +314,59 @@ | |
| 'fsaverage': 'Defined by FreeSurfer, the MRI (surface RAS) origin is ' | ||
| 'at the center of a 256×256×256 mm^3 anisotropic volume ' | ||
| '(may not be in the center of the head).', | ||
| } | ||
| 'icbm452airspace': 'Reference space defined by the "average of 452 ' | ||
| 'T1-weighted MRIs of normal young adult brains" ' | ||
| 'with "linear transforms of the subjects into the ' | ||
| 'atlas space using a 12-parameter affine ' | ||
| 'transformation"', | ||
| 'icbm452warp5space': 'Reference space defined by the "average of 452 ' | ||
| 'T1-weighted MRIs of normal young adult brains" ' | ||
| '"based on a 5th order polynomial transformation ' | ||
| 'into the atlas space"', | ||
| 'ixi549space': 'Reference space defined by the average of the "549 (...) ' | ||
| 'subjects from the IXI dataset" linearly transformed to ' | ||
| 'ICBM MNI 452.', | ||
| 'fsaveragesym': 'The fsaverage is a dual template providing both ' | ||
| 'volumetric and surface coordinates references. The ' | ||
| 'volumetric template corresponds to a FreeSurfer variant ' | ||
| 'of MNI305 space. The fsaverageSym atlas also defines a ' | ||
| 'symmetric surface reference system (formerly described ' | ||
| 'as fsaveragesym).', | ||
| 'fslr': 'The fsLR is a dual template providing both volumetric and ' | ||
| 'surface coordinates references. The volumetric template ' | ||
| 'corresponds to MNI152NLin6Asym. Surface templates are given ' | ||
| 'at several sampling densities: 164k (used by HCP pipelines ' | ||
| 'for 3T and 7T anatomical analysis), 59k (used by HCP pipelines ' | ||
| 'for 7T MRI bold and DWI analysis), 32k (used by HCP pipelines ' | ||
| 'for 3T MRI bold and DWI analysis), or 4k (used by HCP ' | ||
| 'pipelines for MEG analysis) fsaverage_LR surface ' | ||
| 'reconstructed from the T1w image.', | ||
| 'mnicolin27': 'Average of 27 T1 scans of a single subject.', | ||
| 'mni152lin': 'Also known as ICBM (version with linear coregistration).', | ||
| 'mni152nlin6sym': 'Also known as symmetric ICBM 6th generation ' | ||
| '(non-linear coregistration).', | ||
| 'mni152nlin6asym': 'A variation of MNI152NLin6Sym built by A. Janke that ' | ||
| 'is released as the MNI template of FSL. Volumetric ' | ||
| 'templates included with HCP-Pipelines correspond to ' | ||
| 'this template too.', | ||
| 'mni305': 'Also known as avg305.', | ||
| 'nihpd': 'Pediatric templates generated from the NIHPD sample. Available ' | ||
| 'for different age groups (4.5–18.5 y.o., 4.5–8.5 y.o., ' | ||
| '7–11 y.o., 7.5–13.5 y.o., 10–14 y.o., 13–18.5 y.o. This ' | ||
| 'template also comes in either -symmetric or -asymmetric flavor.', | ||
| 'oasis30antsoasisants': | ||
| 'See https://figshare.com/articles/ANTs_ANTsR_Brain_Templates/915436', | ||
| 'oasis30atropos': | ||
| 'See https://mindboggle.info/data.html', | ||
| 'talairach': 'Piecewise linear scaling of the brain is implemented as ' | ||
| 'described in TT88.', | ||
| 'uncinfant': 'Infant Brain Atlases from Neonates to 1- and 2-year-olds.' | ||
| }, | ||
| **{f'mni152nlin2009{letter}{sym}': 'Also known as ICBM ' | ||
| '(non-linear coregistration with 40 iterations, ' | ||
| 'released in 2009). It comes in either three different flavours ' | ||
| 'each in symmetric or asymmetric version.' | ||
| for letter in ('a', 'b', 'c') for sym in ('Sym', 'Asym')}) | ||
|
|
||
| REFERENCES = {'mne-bids': | ||
| 'Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., ' | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.