[ITK-users] SimpleITK Downsampling results in blank image

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Nov 18 16:42:41 EST 2014


Hello again,

On Nov 18, 2014, at 2:52 PM, Jameson Merkow <jmerkow at gmail.com> wrote:

> 
> BUG: you should also scale the origin.
> 
> I guess this is whats confusing. The origin should be the same (or very close due to spacing changes).  I am resampling and updating the spacing to be the inverse of the scale. The new image should have the same physical dimensions, but sampled at a different scale (fewer or greater number of voxels).

No, they are different. When you are doing resampling  you are applying a transform mapping the input image's physical space to the output image's by the transform. In your case it's a scale. So if you have applying a scale of 0.1, and you origin was [100,100], it would be transform to [10,10].

> 
> Its possible that I am using ResampleImageFilter wrong. Think the ShrinkImageFilter or ExpandImageFilter with non-integer values.
> If I do the equivalent operation with Shrink/Expand, the origin, spacing and size end up the same as what I calculate for the resample image filter, but the image comes out blank.

These filters are a little different they are not applying a transform of the physical space. The input image an output image occupy approximately the same physical space, just the resolution has changed.

If you want to do a similar thing with the resample image filter you set the transform to the identity transform, then change change the Size. If you use the ResampleImageFilter as a class you may find the SetReferenceImage useful [1].

Brad

[1] http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1ResampleImageFilter.html#a850affc7fc3ce420c04f754d5d7773a5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20141118/42b34a18/attachment.html>


More information about the Insight-users mailing list