[Insight-users] Using ScaleTransform to stretch an image

Dan Mueller dan.muel at gmail.com
Wed Nov 9 14:07:08 EST 2011


Hi David,

> 1) When would you use a ScaleTransform?
ScaleTransform is useful when you want to keep the same output size.

> 2) Why did you call DisconnectPipeline a couple of times?
Just a habit of mine to make sure the upstream pipeline is not
re-executed. In this situation is probably not required, but as I said
it's a habit. Sorry for the confusion.

HTH

Cheers, Dan

On 10 November 2011 00:08, David Doria <daviddoria at gmail.com> wrote:
> 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