Closed RomStriker closed 5 months ago
The following code does this.
# Define resampling parameters
target_spacing = [0.5, 0.5, 0.5] # isotropic 0.5mm
target_affine = np.array([
[0.5, 0, 0, 0],
[0, 0.5, 0, 0],
[0, 0, 0.5, 0],
[0, 0, 0, 1]
])
# Define the resampling transform
resample_ct = tio.Resample(target_spacing, image_interpolation='lanczos')
ct_volume = tio.ScalarImage(ct_file_path)
# Apply the transforms
resampled_ct_volume = resample_ct(ct_volume)
resampled_ct_volume.affine = target_affine
Hi,
I have the following ct volume
I want to resample to the following target affine
There is no option to do this with the current Resample function or I don't know how to do this. Please add this option or if there is a simple way to do this with the current function, please tell me how to do it.