Search code examples
pythonimage-processingscikit-image

Resizing a NumPy array that's a DICOM image - Resize or Rescale?


I'm trying to make my image dimensions smaller to process in a model.

I'm using skimage.transform.resize() and skim age.transform.rescale() and can't decide between the two.

I definitely need to maintain the data in the image. I'm afraid that I'm either deleting or adding data.

This is my code:

resized_img = resize(image, (200, 200), anti_aliasing=True)

resized_img = rescale(image, 0.39, anti_aliasing=True)

Please let me know what I can do.


Solution

  • Looking at the Rescale, resize and downscale documentation, rescale and resize do almost the same thing.

    The only question is do you want to size of your new image to be a factor of the original size? Or do you want the new image to be of a fixed size? It just depends on your particular application.