Open cookpa opened 1 month ago
I think I made that choice because, at that time, templates were inconsistently named so you often just had to 'know' which space a template was in. It seems like we need some meta info that lies in between what is in the label definition files and what is in the template_description.json files in templateflow. Having available transforms info would be key to making this useful
Yes, there was definitely not enough information at the time to do anything else.
Maybe it would not be a thing in the output, but a separate output that lists transforms for dynamically generated labels. Something like
{
"output": [
{
"labelName": "Schaefer100",
"sourceTemplate": "tpl-OASIS30ANTs",
"transforms": ["sub-01_ses-MR1_from-OASIS30ANTs_to-T1w_mode-image_xfm.h5"]
},
{
"labelName": "AnotherLabel",
"sourceTemplate": "tpl-MNI152NonLin2009cAsym",
"transforms": [
"sub-01_ses-MR1_from-OASIS30ANTs_to-T1w_mode-image_xfm.h5",
"tpl-OASIS30ANTs_from_MNI152NLin2009cAsym_mode-image_xfm.h5"
]
}
]
}
Within templateflow, we can infer from the input transform what the session T1w was aligned to, and then find the labels in order of priority: session -> template, or session -> template -> MNI.
I think we're converging on the same idea. If we build a map from the available transforms in templateflow we can have a function that returns the best (or all) path/s from labels to target-space. Then we can save that path so we can trace exactly where the labels came from and how we got them into target-space.
I was browsing the label definitions and I see they are tied to specific templates, eg
Some of these (eg, Schaefer) might be defined in different templates. I'm trying to think of how best to deal with this for antsnetct. One idea would be to have users specify the labels they want, eg
label_system,template,file Schaefer400x17v1,MNI152NLin2009cAsym,tpl-MNI152NLin2009cAsym_res-01_atlas-Schaefer2018_desc-400Parcels7Networks_dseg.nii.gz
QuANTs would then look for the shortest path to the subject space from the specified template.
I think the file name is necessary because labels aren't consistent across templates