MrinalJain17 / CT-image-segmentation

Segmentation in Head and Neck CT images. Report - https://github.com/MrinalJain17/CT-image-segmentation/blob/master/reports/Report.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explore resampling - like each voxel representing 1mm x 1mm x 1mm

MrinalJain17 opened this issue · comments

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!