Hello, this is my first time posting on neurostars so please let me know if I’m missing any information. I am trying to use nipype to preprocess some task data from an fMRI study we collected that has 28 subjects and 5 runs/subject. The pipeline runs correctly for runs 1-4 for all 28 subjects, but doesn’t work properly for the fifth run for all 28 subjects (so it’s not a subject-specific problem).
The error appears to be in writing the output of afni bandpass. The error log says that afni bandpass “failed to find header file for ‘/data/subjs_raw/test/func/bp_dmt_stc_mc_dsp_BOLD_run5.nii.gzq’”.
Another curveball is that, after the error message, it says it saved the file. I can also print the header information using “nifti_tool -disp_hdr” and if I load the output file from afni’s bandpass using nibabel. But, if I try to run the next preprocessing step (which uses afni’s 3dtproject to regress out head motion confounds), I get another error message that the header file in the bandpass output file is missing.
I have copied the command I used to run afni bandpass and the logging output for afni bandpass below.
Has anyone run into this problem before? Or otherwise, know why the output might not be writing and why it says the header file is missing?
Thanks,
Steve
Command:
Import packages
from future import division
import os, re
from os.path import join as opj
#import nipype
import nipype
nipype.config.set(‘logging’, ‘workflow_level’, ‘INFO’)
nipype.config.set(‘logging’, ‘interface_level’, ‘INFO’)
nipype.logging.update_logging(nipype.config)
import nipype.interfaces.fsl as fsl
import nipype.interfaces.afni as afni
import nipype.interfaces.ants as ants
#Set file paths
bp_inFile = dmt_outFile
bp_outFile = ‘bp_{}’.format(bp_inFile)
#create node and set node options
bandpass = afni.Bandpass()
bandpass.inputs.in_file = opj(funcPath,bp_inFile)
bandpass.inputs.out_file = opj(funcPath,bp_outFile)
bandpass.inputs.mask = opj(funcPath,maskFile)
bandpass.inputs.no_detrend = True
bandpass.inputs.highpass = 0.01
bandpass.inputs.lowpass = 0.12
bandpass.inputs.outputtype = ‘NIFTI_GZ’
#run node
result = bandpass.run()
Output:
…Running bandpass filter…
170922-16:14:21,632 interface INFO:
stderr 2017-09-22T16:14:21.632298:++ 3dBandpass: AFNI version=AFNI_2011_12_21_1014 (Jun 16 2014) [64-bit]
170922-16:14:22,133 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Authored by: RW Cox
170922-16:14:22,133 interface INFO:
stderr 2017-09-22T16:14:22.133510:*+ WARNING: If you are performing spatial transformations on an oblique dset,
170922-16:14:22,133 interface INFO:
stderr 2017-09-22T16:14:22.133510: such as /data/picsl/stompson/SNL/data/subjs_raw/SNL_039/func/stc_mc_dsp_BOLD_run10.nii.gz_mask.nii.gz,
170922-16:14:22,133 interface INFO:
stderr 2017-09-22T16:14:22.133510: or viewing/combining it with volumes of differing obliquity,
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510: you should consider running:
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510: 3dWarp -deoblique
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510: on this and other oblique datasets in the same session.
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510: See 3dWarp -help for details.
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Oblique dataset:/data/picsl/stompson/SNL/data/subjs_raw/SNL_039/func/stc_mc_dsp_BOLD_run10.nii.gz_mask.nii.gz is 37.899982 degrees from plumb.
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Number of voxels in mask = 136933
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Oblique dataset:/data/picsl/stompson/SNL/data/subjs_raw/SNL_039/func/dmt_stc_mc_dsp_BOLD_run10.nii.gz is 37.899982 degrees from plumb.
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Data length = 310 FFT length = 320
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510: + bandpass: ntime=310 nFFT=320 dt=1 dFreq=0.003125 Nyquist=0.5 passband indexes=3…38
170922-16:14:22,134 interface INFO:
stderr 2017-09-22T16:14:22.133510:++ Loading input dataset time series
170922-16:14:24,677 interface INFO:
stderr 2017-09-22T16:14:24.677218:++ Checking dataset for initial transients [use ‘-notrans’ to skip this test]
170922-16:14:25,688 interface INFO:
stderr 2017-09-22T16:14:25.688224: + No widespread initial positive transient detected
170922-16:14:26,189 interface INFO:
stderr 2017-09-22T16:14:26.189098:++ Bandpassing data time series
170922-16:14:26,689 interface INFO:
stderr 2017-09-22T16:14:26.689598:++ Creating output dataset in memory, then writing it
170922-16:14:38,422 interface INFO:
stderr 2017-09-22T16:14:38.421918:++ Output dataset /data/subjs_raw/test/func/bp_dmt_stc_mc_dsp_BOLD_run5.nii.gz
** ERROR (nifti_image_read): failed to find header file for ‘/data/subjs_raw/test/func/bp_dmt_stc_mc_dsp_BOLD_run5.nii.gzq’
** FATAL ERROR: Can’t open dataset ‘/data/subjs_raw/test/func/bp_dmt_stc_mc_dsp_BOLD_run5.nii.gz^A^A’
** Program compile date = Jun 16 2014
Saving bandpass filtered file /data/subjs_raw/test/func/bp_dmt_stc_mc_dsp_BOLD_run5.nii.gz