itk-wasm icon indicating copy to clipboard operation
itk-wasm copied to clipboard

resampleImageFilter

Open sedghi opened this issue 10 months ago • 2 comments

Hi!

I saw there is a package already for downSample https://github.com/InsightSoftwareConsortium/ITK-Wasm/tree/main/packages/downsample

My questions are:

  1. I guess it is not the same as ResampleImageFilter.
  2. It can't upsample either I guess
  3. Any plan to add ResampleImageFilter?

Thanks a lot!

sedghi avatar Feb 05 '25 15:02 sedghi

Hi @sedghi ,

Yes, we will be adding a resample package!

In additional to the ResampleImageFilter-like API, is there a particular set of functionality or interface you are looking for?

thewtex avatar Feb 10 '25 21:02 thewtex

Hey Matt,

Resampling to a new spacing given a size, or to a new size given the new spacing. I've been looking into RTDose support, and I really don't think it's possible to get good resolution without resampling. And that's not even mentioning image registration, which pretty much always requires resampling.

Here are the operations:

resample = sitk.ResampleImageFilter()
resample.SetOutputSpacing(out_spacing)
resample.SetSize(out_size)
resample.SetOutputDirection(itk_image.GetDirection())
resample.SetOutputOrigin(itk_image.GetOrigin())
resample.SetTransform(sitk.Transform())
resample.SetDefaultPixelValue(itk_image.GetPixelIDValue())

resample.SetInterpolator(sitk.sitkCosineWindowedSinc)
resample.Execute(itk_image)

sedghi avatar Feb 10 '25 22:02 sedghi