itk-wasm
itk-wasm copied to clipboard
resampleImageFilter
Hi!
I saw there is a package already for downSample https://github.com/InsightSoftwareConsortium/ITK-Wasm/tree/main/packages/downsample
My questions are:
- I guess it is not the same as ResampleImageFilter.
- It can't upsample either I guess
- Any plan to add ResampleImageFilter?
Thanks a lot!
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?
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)