netstim / leaddbs

Lead-DBS is a MATLAB toolbox facilitating deep brain stimulation electrode localization and connectomic neuroimaging.
https://www.lead-dbs.org
Other
90 stars 98 forks source link

[FEATURE]: Capital letter in BIDS dataset for sessions #1154

Open Fayed-Rsl opened 5 months ago

Fayed-Rsl commented 5 months ago

I have a pretty standard BIDS dataset validated using bids validator that looks like that: image

But unfortunately when I use leaddbs it does not found the anat for my subjects due to an error regarding the session naming. Indeed, I noticed in the tutorial that there is only minor case for the session (highlighted in yellow) image

Unfortunately, as we can see from my bids dataset, my session naming is in CamelCase (e.g., PreOp vs preop), so I guessed that was the reason why it didn't work. And it was in fact due to that. After renaming into minor case as in the tutorial everything worked fine.

This is why I think that having a feature that can recognise capital letter (e.g., PreOp considered as preop) could be a nice feature and I feel like it should not much be a lot complicated to implement. Otherwise, I would need to re-name my whole dataset to make leaddbs work.

Please let me know if this is possible to have such feature. Thank you! Fayed

ningfei commented 5 months ago

Thanks for the suggestion. Solved in 677eb38. Feel free to close the issue if it works for you.

Fayed-Rsl commented 4 months ago

Thanks for the suggestion. Solved in 677eb38. Feel free to close the issue if it works for you.

Hi thank you for your quick reply. I manage to make the update and I am currently using the leaddbs 3.1 version. The fix you made is working well for parsing the filename including CamelCase, but for some reason I encountered an issue with the acquisition 'iso' combined with CamelCase.

For example, this is working correctly: _/BIDS/rawdata/sub-001/ses-PreOp/anat/sub-001_ses-PreOp_acq-axT1w.nii.gz

But this is not working and leads to the error --> Unrecognized field name 'acq' _/BIDS/rawdata/sub-001/ses-PreOp/anat/sub-001_ses-PreOp_acq-isoT1w.nii.gz

Note that if I rename the file as this (without camel case) then I have no error. _/BIDS/rawdata/sub-001/ses-preop/anat/sub-001_ses-preop_acq-isoT1w.nii.gz

Could you please have a look into it? Thank you!

Fayed-Rsl commented 4 months ago

Thanks for the suggestion. Solved in 677eb38. Feel free to close the issue if it works for you.

Note that the solution proposed here also doesn't work for post operation CT files. For example: PostOp_CT still does not work but postop_CT works fine, indicating a problem in the fetching.

Thank you for your help