Error while running nipreps-synthstrip
Closed this issue · 1 comments
What happened?
Dear synthstrip developers,
I'm trying to install your software in my own docker conteiner (running ubuntu).
pip3 install nipreps-synthstrip
seems to work fine:
The installation looks ok too:
I got the model from the freesurfer website:
https://surfer.nmr.mgh.harvard.edu/ftp/dist/freesurfer/synthstrip/models/
But when I run using a MRI image, I receive the following error message:
The same MRI image gets segmented fine using the official freesurfer docker container, so I guess that's not a issue in the image.
Please let me know if you have any suggestions.
Thanks,
What command did you use?
pip3 install nipreps-synthstrip
nipreps-synthstrip -i geomcorrB0.nii.gz -m mask.nii.gz --model /root/synthstrip.1.pt
What version of the software are you running?
The current from pip3 install nipreps-synthstrip
How are you running this software?
Docker
Is your data BIDS valid?
No
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
Configuring model on the CPU
Using custom model weights
Input image read from: geomcorrB0.nii.gz
Traceback (most recent call last):
File "/freesurfer/env/bin/nipreps-synthstrip", line 8, in <module>
sys.exit(main())
File "/freesurfer/env/lib/python3.8/site-packages/nipreps/synthstrip/cli.py", line 130, in main
conformed = conform(image)
File "/freesurfer/env/lib/python3.8/site-packages/nipreps/synthstrip/cli.py", line 229, in conform
nii = Affine(
File "/freesurfer/env/lib/python3.8/site-packages/nitransforms/base.py", line 291, in apply
resampled = ndi.map_coordinates(
File "/freesurfer/env/lib/python3.8/site-packages/scipy/ndimage/_interpolation.py", line 440, in map_coordinates
raise RuntimeError('invalid shape for coordinate array')
RuntimeError: invalid shape for coordinate array
Additional information / screenshots
No response
I figured out the issue, the image data I was trying to mask was 4D, that was causing the error. nipreps-synthstrip is working well now after extracting the first volume of the image file.