Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MrinalJain17 opened this issue Oct 8, 2020 · 0 comments
Open

Comments

@MrinalJain17
Copy link
Owner

MrinalJain17 commented Oct 8, 2020

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!
@MrinalJain17 MrinalJain17 changed the title Explore resampling - like each voxel representing 1x1x1 $mm^3$ Explore resampling - like each voxel representing 1mm x 1mm x 1mm Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant