I am using spm.preprocess.Normalize12 in my pipeline. Specifically, I have a bunch of warp fields that have been previously calculated and I want to use these fields to warp other images. I also want to give the warped images a custom output prefix for the sake of clarity. I do as follow:
def_field = "y_previously_calculated_warp.nii" centered_filename = "image_that_i_want_to_warp.nii" normalized_output_prefix = "warped_" applyd = spm.preprocess.Normalize12() applyd.inputs.deformation_file = def_field applyd.inputs.apply_to_files = centered_filename applyd.inputs.out_prefix = normalized_out_prefix applyd.inputs.jobtype = "write" applyd.run()
When i run the applyd interfaces i got the following error message
The trait 'normalized_files' of a Normalize12OutputSpec instance is an existing file name, but the path 'wimage_that_i_want_to_warp.nii.nii' does not exist.
At the same time, I do get a file called
warped_image_that_i_want_to_warp.nii.nii, that is exactly what I wanted.
If I understood correctly, the interface is not happy not to find the file that it would have written if I had not changed the default value of the output prefix.
Although as said I got what I want, the fact that the interface throw an error stop the overall script, and so I really need to fix this. Any suggestion as for the cause of this behavior and how to fix it ?