Summary of what happened:
I am trying to register MR and PET images interfacing ANTs in Python via Nipype. When I just try to test the example registration code on the Nipype documentation website (Neuroimaging in Python - Pipelines and Interfaces — nipy pipeline and interfaces package), I keep getting an error that says:
FileNotFoundError: No such file or directory ‘/Users/bastiaanvantol/output_Composite.h5’ for output ‘composite_transform’ of a Registration interface
Can anyone point me in the direction of the problem? It seems that it is looking for a file or directory where the composite_transform, output of the Registration interface, should be saved. However, in the documentation I can’t seem to find where and how I should specify where this output should be saved.
Any help would be greatly appreciated!
Command used :
This is the example script used:
reg = Registration()
reg.inputs.fixed_image = pet_img
reg.inputs.moving_image = mr_img
reg.inputs.output_transform_prefix = “output_”
reg.inputs.transforms = [‘Affine’, ‘SyN’]
reg.inputs.transform_parameters = [(2.0,), (0.25, 3.0, 0.0)]
reg.inputs.number_of_iterations = [[1500, 200], [100, 50, 30]]
reg.inputs.dimension = 3
reg.inputs.write_composite_transform = True
reg.inputs.collapse_output_transforms = False
reg.inputs.initialize_transforms_per_stage = False
reg.inputs.metric = [‘Mattes’]*2
reg.inputs.metric_weight = [1]*2 # Default (value ignored currently by ANTs)
reg.inputs.radius_or_number_of_bins = [32]*2
reg.inputs.sampling_strategy = [‘Random’, None]
reg.inputs.sampling_percentage = [0.05, None]
reg.inputs.convergence_threshold = [1.e-8, 1.e-9]
reg.inputs.convergence_window_size = [20]*2
reg.inputs.smoothing_sigmas = [[1,0], [2,1,0]]
reg.inputs.sigma_units = [‘vox’] * 2
reg.inputs.shrink_factors = [[2,1], [3,2,1]]
reg.inputs.use_estimate_learning_rate_once = [True, True]
reg.inputs.use_histogram_matching = [True, True] # This is the default
reg.inputs.output_warped_image = ‘output_warped_image.nii.gz’
reg.cmdline
reg.run()