[Insight-users] how to setOrigin() and setSpacing

Markus Neuner neuner.markus at gmx.net
Thu Aug 12 05:06:55 EDT 2010


If the image is processed/the output of a filter/pipeline better use
itk::ChangeInformationImageFilter< TInputImage >
http://www.itk.org/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html

see:
SetOutputOrigin( )
ChangeOriginOn( )
SetOutputSpacing( )
ChangeSpacingOn()
to copy spacing and origin from the input image

When you create the image by your own then use Dženan Zukić's method.

On 12.08.2010 10:31, Dženan Zukić wrote:
> Call method SetOrigin() on the image in question? Something like this:
>
> ImageType::PointType p;
> p[0]=5.12; ...
> image->SetOrigin(p);
>
> Dženan
>
> 2010/8/12 liuji710 <liuji710 at 163.com>:
>   
>> hi,
>>    When I process the image,the Origin turns to (0,0,0) and spacing turns to
>> (1,1,1).Unfortunately,the original image's origin and spacing are not. So
>> ,what to do in the writerstep to keep pace with the original image's origin
>> and spacing.
>>
>> Thanks,
>>
>> Liu Ji
>>
>> ________________________________
>> 您想拥有和网易免费邮箱一样强大的软件吗?
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>     
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>   


More information about the Insight-users mailing list