Explore resampling - like each voxel representing 1mm x 1mm x 1mm
MrinalJain17 opened this issue · comments
Mrinal Jain commented
This is definitely important for 3D models.
- Even for 2D models, if we want to crop unnecessary pixels (chest region, the CT scanner artifacts, etc), it might important to have all the scans on the same scale.
Code would be something along the lines of:
from scipy.ndimage import zoom
patient = ...
required_spacing = np.array([1., 1., 1.])
resize_factor = patient.image.spacing / required_spacing
vol = patient.image.as_numpy()[0]
resampled = zoom(vol, resize_factor, order=2, mode="nearest")
- Resampling could be really slow!