-
Notifications
You must be signed in to change notification settings - Fork 530
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
nipype.interfaces.cat12.preprocess.CAT12Segment does not accept compressed .nii.gz
files
#3653
Comments
.nii.gz
files.nii.gz
files
Maybe @mfmachado has an idea? |
This is an explicit helper to remind people to put gunzip interfaces if they need: nipype/nipype/interfaces/spm/base.py Lines 617 to 631 in 4d1352a
If SPM now allows compressed NIfTI, we could change it to something like: allow_compressed=LooseVersion(Info.version()) >= LooseVersion('9.14'), Would probably take some fiddling to get right, and would be good to know what version they added compression support in. |
@effigies : It might be more complicated than that, because CAT12 is a toolbox inside SPM12. CAT12 for sure supports |
Did earlier versions of CAT12 not support compression? If it has always supported compression, then you can just change nipype/nipype/interfaces/cat12/preprocess.py Lines 25 to 31 in 4d1352a
If it might be different, then we could add a |
Pinging the maintainer @ChristianGaser here, he might be able to answer which versions of CAT12 support |
Sounds good to me! I had a brief try and just replace My suggestion: Replace |
Cat12.8 was the first version that supports nii.gz filesBest, ChristianAm 06.06.2024 um 15:29 schrieb Johannes Wiesner ***@***.***>:
Did earlier versions of CAT12 not support compression? If it has always supported compression, then you can just change ImageFileSPM to ImageFile in the input spec of the CAT12 interfaces, for example, here:
https://github.com/nipy/nipype/blob/4d1352ade7171fd5f55eff62cee4c99a4f9cfed1/nipype/interfaces/cat12/preprocess.py#L25-L31
If it might be different, then we could add a cat12.Info class to detect the version and make an ImageFileCAT12 similar to the ImageFileSPM above that compares the CAT12 version. OTOH, that might be too much work, given that people are unlikely to use new nipype and old CAT12, so you could just drop the ImageFileSPM stuff.
Sounds good to me! I had a brief try and just replace ImageFileSPM with ImageFile and it seems to work. Ending up with issue #3654 but that's another topic of course.
My suggestion:
Replace ImageFileSPM with ImageFile in nipype.interfaces.cat12.preprocess AFTER Christian Gaser has responded from which CAT12 version on compressed files are supported. I can send a PR then. But maybe then the minimum version of CAT12 that supports compressed files should also be added to the nipype docs so folks are aware that they cannot use older versions than this minium version.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@effigies when we replace ImageFileSPM with ImageFile we get the following error: SPM version: SPM12 Release: 7771
SPM path: /apps/lib/matlab/spm12/spm.m
Item 'Volumes', field 'val': Number of matching files (0) less than required (1).
Standard error:
MATLAB code threw an exception:
No executable modules, but still unresolved dependencies or incomplete module inputs.
File:/apps/lib/matlab/spm12/spm_jobman.m
Name:/apps/lib/matlab/spm12/spm_jobman.m
Line:47
File:./pyscript_cat12segment.m
Name:fill_run_job
Line:115
File:pm_jobman
Name:pyscript_cat12segment
Line:472
File:÷
Name:>
Line:
Return code: 0 We don't really understand where the error is coming from, since there is no such trait as 'Volumes' for the CAT12 interface. Maybe it's refering to the input image? That it couldn't be read? I don't know if this information helps you, but we are currently setting all atlases for ROI processing (neuromorphometrics, etc.) to False, as a workaround for the issue #3654. Here's the full pyscript_cat12segment.m file:
|
@effigies the problem has something to do with the fact that for some reason when I choose the zipped file as an input it is written like this in the matlab script:
So it's looking for the first slice in the zipped file (
I ran the same script generated by Nipype directly in Matlab before and after removing |
Summary
The
Cat12Segment
interface does not accept compressed.nii.gz
files. Everything works fine when one inputs an.nii
file.Actual behavior
This is the error I get:
which by the way is a little bit misleading because the file exists but the file extension if the problem (but this is another topic I guess).
Expected behavior
Run Segmentation on a
.nii.gz
file should work because newer versions of CAT12 are able to deal with.nii.gz
files. My CAT12 version is CAT12.9 (r2560) inside an spm12/9.14 environment module.See also: https://www.neuro.uni-jena.de/cat12/CAT12-Manual-old.pdf
How to replicate the behavior
Here's an example script that should reproduce the error:
Platform details:
Execution environment
Choose one
The text was updated successfully, but these errors were encountered: