Nipype having trouble reading files (tutorial)

I am new to Nipype and tried following the showcase after downloading the tutorial dataset with datalad.

However, Nipype runs into this error during execution.

RuntimeError: Command:
slicetimer --in=ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz --odd --out=/home/kimsin98/nipype_tutorial/preproc01/slicetimer/sub-01_ses-test_task-fingerfootlips_bold_st.nii.gz --repeat=2.500000
Standard output:

Standard error:
Image Exception : #63 :: No image files match: ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold
Image Exception : #22 :: Failed to read volume ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz
Error : No image files match: ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to read volume ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz
Error : No image files match: ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold
Return code: -6

Curiously, running the exact same command directly like this

%%bash
slicetimer --in=ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz --odd --out=/home/kimsin98/nipype_tutorial/preproc01/slicetimer/sub-01_ses-test_task-fingerfootlips_bold_st.nii.gz --repeat=2.500000

results in no errors and produces a valid output file that nib-ls can read.

preproc01/slicetimer/sub-01_ses-test_task-fingerfootlips_bold_st.nii.gz float32 [ 64, 64, 30, 184] 4.00x4.00x4.00x2.50 sform

My set up is a Linux server with Nipype installed through conda-forge.

Nipype nodes require absolute path to files rather than relative ones.

1 Like

Ah, changing the in_file to absolute file path solved the problem. Thank you!

I wish the tutorial/documentation state that explicitly to save others from the same struggle.

The next node runs into a new error:

traits.trait_errors.TraitError: The trait 'mean_img' of a MCFLIRTOutputSpec instance is an existing file name, but the path  '/home/kimsin98/nipype_tutorial/preproc01/mcflirt/sub-01_ses-test_task-fingerfootlips_bold_st_mcf.nii.gz_mean_reg.nii.gz' does not exist.

This seems to be the same issue as this error that was fixed in 1.1.3, but I am running into it with 1.2.0.

For Future People™ who may get an error running a tutorial, etc.
When you run datalad install whatever, it doesn’t actually download the data.
Go into the folder and do datalad get to download the data.