Skip to content

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

Description

@MrinalJain17

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions