-
Notifications
You must be signed in to change notification settings - Fork 82
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
[FIX] Center_Nifti
should run by default on T1
#1418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AliceJoubert !
I had a very quick look at the code which looks good.
I'll come back tomorrow to the points left to discuss.
I'm not sure to understand how this solves the problem that @MatthieuJoulot described:
Reading the docs, it seems like without any option, all T1w images being more than 50mm from the origin would be centered. Nothing was done in this case because all your images were under this 50mm threshold ?
I agree, but I don't believe we have a robust modeling of the modalities handled by clinica at the moment. They are usually handled as plain strings. Ideally this would be an enumeration of values and the user could only provide a valid variant, but that would require some work. So, definitely not in this PR, but we can discuss about that.
I'm not sure I see exactly what you want to do, but if you feel that it would make the code better, you can totally open a follow-up PR.
I might be missing some details but I would have gone with option 2 which gives more control to the user. For example, it allows to both preserve the current default behavior (setting the threshold default as 50mm) and mimic option 1 (setting the threshold at 0). Option 1 has the benefit of being simpler both in terms of code and UI though. WDYT ? |
Actually before my modifications there was no default set for the I feel like this module is supposed to let the users quite free in terms of modality so that would be difficult to model. We could restrict the search of the modality key to the suffix (right before the .nii.gz extension) but that is about all we can do easily. The |
Ok, perfectly clear now, thanks for the explanations !
I agree, we can restrict the search to the suffix in another PR.
I also agree this should be addressed in a different PR. Let's mention this during our next meeting to see what option would be best. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR LGTM, thanks @AliceJoubert !
If you think it is ready, you can flip the switch from draft to open and we'll merge.
Adresses part of #1413
The modalities to center were set as described in the documentation. By default,
center_nifti
will only process T1w images. It is possible to change this by using the--modality
option and you can process several modalities at the same time.Modalities are not restricted to a set of known modalities on our side to give the user more freedom. That means the user could enter
-m TOTO
if they wanted to, however the implementation is at the moment not very robust. This can be changed.For follow-up PR :
What is left to discuss :
From the documentation, this tool is used in clinica if the data should at some point be processed by SPM (hence the discussion from #1412 on T1-Freesurfer). As of now,
center-nifti
processes by default only files that are more than 50 mm away from the center. The threshold was empirically established specifically for SPM by previous users. It is definitely not intuitive if someone usescenter-nifti
for any other purpose than SPM processing. We could :