[Bug]: using SPM within nipype #400
Replies: 3 comments 8 replies
-
Dear @scott-love , Our problem is how nipype calls the compiled version of SPM - it assumes that SPM standalone is installed locally. There are two workaround for this: Start the nipype-1.8.3 container from the application menu. In that container, we installed SPM standalone locally and now you can run things like:
The alternative is to specify the absolute path to SPM standalone and then you can run this in the global jupyter notebook system of Neurodesk:
This workaround will trigger a warning "stty: 'standard input': Inappropriate ioctl for device", which you can ignore and we are hoping to find a more elegant way in the future. Let us know if this works for you or if you have an idea how to make this work more elegantly! Thank you |
Beta Was this translation helpful? Give feedback.
-
Dear @stebo85, thanks for keeping me updated and for working on a solution. |
Beta Was this translation helpful? Give feedback.
-
Great news, I successfully ran the minimal example on an M3 Pro.
Thanks again for solving this!
… On 20 Mar 2024, at 00:36, Steffen Bollmann ***@***.***> wrote:
Dear @scott-love <https://github.com/scott-love> - In the latest MacOS (14.4) update in combination with the latest Docker (4.28.0 (139021)) update this problem is now fixed. Can you test on your end?
This is the minimal example that I successfully ran on my M1 Pro Max:
https://www.neurodesk.org/example-notebooks/structural_imaging/nipype_module_example.html
—
Reply to this email directly, view it on GitHub <#400 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADCX44MXXG6FFBDF2XD2FQDYZDDXJAVCNFSM6AAAAABCVDDWPOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DQNBWHE3DC>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Version
1.4.0
What platform are you seeing the problem on?
Local PC
What happened
I am not 100% sure this is actually a Neurodesk question/problem/bug.
I am trying to create a nipype workflow using a Jupyter notebook inside Neurodesk. The workflow requires several SPM interfaces (e.g., FieldMap). However, there seems to be a problem with calling the SPM functions; potentially a problem with the command used to call the SPM standalone version. I tried adding lmod.load('spm12/r7219') and the other available spm version. I also tried adding lmod.load('matlab/2022a') but I don't think that should be helpful as I don't have a licence.
I found this page, which lead me to try adding matlab_cmd = '/opt/spm12/run_spm12.sh /opt/mcr/v97/ script'
spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True).
This didn't help and it doesn't look correct to me as I would expect a path to a container.
Anyway, I have tried a few things and so far failed to use an SPM node in nipype. All help would be greatly appreciated
Thanks,
Scott
How to reproduce
Here is a simple example.
`
from nipype import Node, Workflow
from bids.layout import BIDSLayout
from nipype.interfaces.utility import IdentityInterface, Function
from nipype.interfaces.spm import FieldMap
calcvdmS1 = Node(FieldMap(echo_times = (4.92, 7.38),
blip_direction = 1,
total_readout_time = 54.15,
maskbrain = False),
use_mcr = True,
name = "calcvdmS1")
calcvdmS1.inputs.epi_file = '/data/sub-03067/ses-1/func/sub-03067_ses-1_task-BIP_acq-CONTINU_run-1_bold.nii'
calcvdmS1.inputs.magnitude_file = '/data/sub-03067/ses-1/fmap/sub-03067_ses-1_magnitude1.nii'
calcvdmS1.inputs.phase_file = '/data/sub-03067/ses-1/fmap/sub-03067_ses-1_phasediff.nii'
calcvdmS1.inputs.use_mcr = True
calcvdmS1.run()
`
Relevant log output or screenshot
Beta Was this translation helpful? Give feedback.
All reactions