[Insight-users] Using ScaleTransform to stretch an image

David Doria daviddoria at gmail.com
Wed Nov 9 09:08:51 EST 2011


On Tue, Nov 8, 2011 at 3:51 PM, Dan Mueller <dan.muel at gmail.com> wrote:
> Hi David,
>
> Aha. After closer inspection I see that you are forgetting the concept
> of spacing. You need to think carefully about what happens to spacing
> after a scale.
>
> Please find code below which I think does what you want. In fact,
> because you want to change the output size, you don't even need to use
> a ScaleTransform -- an IdentityTransform works just fine.

Thank you Dan. Just to recap, the idea is:

1) Think about the pixels living in a physical space.
2) Since we set the output size to 200x200, this tells us that we now
have 40,000 pixels, but if the spacing had remained the same, only one
quarter (100x100) would overlap the physical space of the original
100x100 image.
3) We change the spacing to 1/2 of the original spacing so that the
new pixels are smaller in the physical space. This means that all
200x200 now overlap the original image's physical space completely.

I only have two remaining questions:

1) When would you use a ScaleTransform?
2) Why did you call DisconnectPipeline a couple of times?

Thanks,

David


More information about the Insight-users mailing list