help > Image type determination logic
Showing 1-4 of 4 posts
Display:
Results per page:
Apr 9, 2024  06:04 PM | Sandhitsu Das
Image type determination logic

How is image type automatically determined from the file name ? The logic failed to label sub-XXX_ses-YYY_run-01_T1w.nii as a T1-weighted MRI. This should work based on the help text, and also probably be good to support as it is a valid BIDS name, and will save computation when re-facing an entire session in one go as only the T1w will undergo non-linear registration, if I understand correctly.

Apr 9, 2024  07:04 PM | Christopher Schwarz - Mayo Clinic
RE: Image type determination logic

Sandy,


It takes off the extension and splits what's left into tokens with delimiters space, _, or -. Then it checks those tokens against a fixed list of matches. For T1's the current list is 


{'MT1','ST1','T1','MPRAGE'}


I agree that T1w should be added, especially since it's the BIDS standard as you pointed out. For the next version I'll add some various "w" and "-w" suffixes, and check over the BIDS list to add anything else too.


Thanks for bringing this to my attention. I've generally considered the "automatic" to be a bit "at your own risk", but BIDS types should definitely be made to work.


0.3.4 is coming very soon, so this is good timing to get it in there.


Chris


 

Apr 11, 2024  02:04 AM | Sandhitsu Das
RE: Image type determination logic

Thanks Chris. I think it is reasonable to treat the automatic as "at your own risk". However, it becomes more important when you are trying to do batch processing of multiple modalities within the same session in one shot. Am I misunderstanding that in that situation you have to go auto ? If not, it's no big deal to force users to specify all of the modality types in the right order.

Apr 11, 2024  12:04 PM | Christopher Schwarz - Mayo Clinic
RE: Image type determination logic

The imType flag takes a comma-separated list, so if you're providing e.g. a T1w.nii, FLAIR.nii, T2w.nii, then you can provide imType T1w,FLAIR,T2w.


I aim to release the new version, adding the BIDS keywords among other things, next week.


Chris