Closed jordandekraker closed 4 years ago
To be bids-derivatives compliants, we could have these images specified as _dseg.nii.gz
, and use the space
bids entity to specify whether they are in T1w, T2w, or a CITI168corobl space.
One thing that comes up is right now we actually don't have a lateralized look-up table to use when not in cropped space (for either tissue segs, or for subfields) -- I suggest we come up with one, and define it in a tsv file (e.g. see the _dseg.tsv
in https://bids-specification.readthedocs.io/en/stable/05-derivatives/03-imaging.html)
Otherwise we always would have to use hemi-L and hemi-R even in native space when the segmentations could be in a single file..
To make life easier, could have a single dseg.tsv that describes all the labels we use, e.g. one set of numbers for non-lateralized structures (e.g. what we use in niftynet autotop_transformrollout), and another set of numbers for left-lateralized and right-lateralized structures, and the workflow would deal with adjusting the seg labels when moving to a hemi-* space
Good point. Currently manual labels are specified by integers 0-8 and subfields by 0-6, regardless of hemisphere. A simple scheme could have manual labels be 0-8 & 10-18 (for hemi-L and hemi-R respectively), and subfield labels 20-26 and 30-36 (for hemi-L and hemi-R respectively).
Thoughts?
ya that sounds good -- maybe 1-8 could be hemi-R tissue/manual to keep backwards compatible (since the niftynet segmentation is technically being done in that space) -- then 11-18 for hemi-L tissue/manual, and 21-26 hemi-R subfield 31-36 hemi-L subfield?
do you have an existing lut where the labels are listed? just need to make a 3-column tsv (index, name, abbreviation) from it
yup, not sure where it belong so I'm sending it to you on Slack
Just tested @akhanf 's latest changes. Seems to properly grab and forward the manual segmentations to the autotop step. But my labels look a a bit funny after resampling it in the cropped input space:
Would '--interpolation NearestNeighbor' be better here: https://github.com/khanlab/hippunfold/blob/manualseg/workflow/rules/preproc_seg.smk#L19 ?
And @jordandekraker did you experiment with different weightings for the label-label deformable registration? For example, extra weight to the GM and SLRM labels? Also, what about detecting which labels are included in the manual segmentation to refine the registration step (i.e. by adjusting the label list for the ANTs script)? I don't know the impact of having the script trying to transform an empty image to the atlas label on the final warp.
Ah yes definitely, not using nearest neighbour was an omission, feel free to correct that in a commit or I can when I'm at my desktop.. Yes I like the idea of having some flexibility in the label mapping, should also think about the use cases when one wants to unfold a freesurfer or ashs segmentation too. Being able to customize the label-label registration might be useful here, but from some initial examination of camcan results (which suggests further tweaking is needed), might be something we want to pull out of matlab and into the snakemake workflow too.. but that's probably for another issue
Alright, Just corrected it (0e6d6e4853312ed453fcf8ae1a8c6b6801c123f8)
Or should it be 'MultiLabel' instead of 'NearestNeighbor'? Just tested increasing smoothing kernels to 16x8x5 and see warning message:
GaussianOperator (0xdc07030): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements. You can raise the maximum width using the SetMaximumKernelWidth method
How should I set this 'SetMaximumKernelWidth' variable?
Ah yea, multilabel could be preferred -- I haven't used it much before but I think should be fine
On Fri, Nov 20, 2020 at 11:06 AM Roy Haast notifications@github.com wrote:
Or should it be 'MultiLabel' instead of 'NearestNeighbor'?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khanlab/hippunfold/issues/3#issuecomment-731256868, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXV2XK3OYDGEAUOM6NPXCLSQ2HW3ANCNFSM4TU3RT3A .
-- Ali R. Khan, PhD Canada Research Chair in Computational Neuroimaging Assistant Professor, Medical Biophysics Scientist, Robarts Research Institute Schulich School of Medicine & Dentistry, Western University e. alik@robarts.ca t. 519.931.5777 (x24280) w. www.khanlab.ca
Include manual labels in the snakebids grabber and pass it as an optional input to autotop workflow