A little bit of context: I’m writing a workflow that takes the functional files processed through fmriprep and smooths them using SPM. I’m currently running Nipype on the Sherlock server using a singularity container that contains Nipype (version: 0.13.1) and Jupyter.
My pipeline (ostensibly) takes the functional files, unzips them, smooths them, and puts them in a new directory. Here’s what it looks like:
infosource = pe.Node(util.IdentityInterface(fields=['subject_id']), name = 'infosource') infosource.iterables = ('subject_id', ['sub-04', 'sub-05']) datasource = pe.Node(nio.DataGrabber(infields=['subject_id']), name = 'datasource') datasource.inputs.base_directory = in_dir datasource.inputs.template = '%s/func/*preproc.nii.gz' datasource.inputs.sort_filelist = True gunzip = pe.MapNode(interface = misc.Gunzip(), iterfield=['in_file'], name='gunzip') smooth = pe.Node(interface= spm.Smooth(), name = 'smooth') datasink = pe.Node(interface=nio.DataSink(), name="datasink", iterfield = 'container') datasink.inputs.base_directory = out_dir smoothingWorkflow = pe.Workflow(name = 'smoothingWorkflow', base_dir=working_dir) smoothingWorkflow.connect([ (infosource, datasource, [('subject_id', 'subject_id')]), (infosource, datasink, [('subject_id', 'container')]), (datasource, gunzip, [('outfiles', 'in_file')]), (gunzip, smooth, [('out_file', 'in_files')]), (smooth, datasink, [('smoothed_files', 'func')]) ]) smoothingWorkflow.run()
However, I get the following error when I try to execute the smoothing node:
RuntimeError: Command: /opt/spm12/run_spm12.sh /opt/mcr/v85/ script /scratch/users/nvelez/myProject/smoothing_wf/smoothingWorkflow/_subject_id_sub-04/smooth/pyscript_smooth.m Standard output: Standard error: Failed to create a directory required to extract the CTF file. Please make sure that you have appropriate permissions and re-run the application. Error initializing CTF Archive Return code: 255 Interface MatlabCommand failed to run. Interface Smooth failed to run.
Does anyone know what might be causing this error? I thought that I might be writing temporary files on a directory where I have no business writing, so I tried changing the working directory to a directory within
$SCRATCH, but this didn’t seem to fix it.
Thanks in advance!