I am having a bit of a problem with the ApplyDeformations object in the SPM interfaces of nipype.
I want to apply an inverse deformation field calculated using segmentation to some image. To do so, I do the following:
from nipype.interfaces.spm.preprocess import ApplyDeformations
apply_def = ApplyDeformations()
apply_def.inputs.in_files = “/mnt/brain/my_temp/JHU-ICBM-labels-2mm.nii”
apply_def.inputs.deformation_field = “/mnt/brain/iy_my_subj.nii”
apply_def.inputs.reference_volume = “/mnt/brain/my_subj_T1.nii”
apply_def.inputs.interp = 0
Note that all the files are existing (double checked myself and in any case ApplyDeformations wouldn’t accept them if they weren’t).
I got the following spm error:
Item ‘Image to base Id on’, field ‘val’: Number of matching files (0) less than required (1).
Item defs: No field(s) named
I can’t really wrap my head around this: in the manual, it is said that the only compulsory inputs of ApplyDeformations are in_files, deformation_field and reference_volume, and they’re all provided.
If I look at the attribute inputs of my ApplyDeformations object I see the following:
deformation_field = /mnt/brain/iy_my_subj.nii
in_files = [’/mnt/brain/my_temp/JHU-ICBM-labels-2mm.nii’]
interp = 0
mfile = True
reference_volume = /mnt/brain/my_subj_T1.nii
use_v8struct = True
This once again confirms that all the compulsory inputs are provided.
I am working with nipype version 1.2.2, python version 3.6, Matlab R2016b and SPM12 v7487.
Any help would be much appreciated.