[Insight-users] Get and Set itk Origin

Kevin H. Hobbs hobbsk at ohiou.edu
Wed Sep 16 10:04:40 EDT 2009


My comments are below.

On Wed, 2009-09-16 at 11:19 +0000, jef vdmb wrote:
> For example, if one wants to create an image that covers the same
> physical space as another image ("reference"), one should take into
> account size, spacing, origin, direction AND startIndex. 
> 
> I could be mistaken but it seems this behavior doesn't seem to be
> fully propagated yet in the ResampleImageFilter. I am using the
> optimized version in Review. When using
> ResampleImageFilter::SetOutputParametersFromImage, not all necessary
> information is passed, eg:
> 
>   void SetOutputParametersFromConstImage ( typename
> OutputImageType::ConstPointer Image )
>     {
>     this->SetOutputOrigin ( Image->GetOrigin() );
>     this->SetOutputSpacing ( Image->GetSpacing() );
>     this->SetOutputDirection ( Image->GetDirection() );
>     this->SetSize ( Image->GetLargestPossibleRegion().GetSize() );
>     }
> 
> 
> In other words setting the parameters of the optimized version of the
> ResampleImageFilter using 
> 
> 
> resampler->SetSize(reference->GetLargestPossibleRegion().GetSize());
>     resampler->SetOutputSpacing(reference->GetSpacing());
>     resampler->SetOutputOrigin(reference->GetOrigin());
> 
> resampler->SetOutputStartIndex(reference->GetLargestPossibleRegion().GetIndex());
>     resampler->SetOutputDirection ( reference->GetDirection() );
> 
> will not give the same output as using
> 
>     resampler->SetOutputParametersFromImage(reference);
> 

Right, it looks like the corresponding methods in
BasicFilters/itkResampleImageFilter.h do set the start index along with
all of the other stuff, so this is probably a bug.

Do you want to file a bug report? You have all of the example code
necessary to reproduce the problem.

I'll post a note to the developers list to bring some expert attention
to this thread. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090916/1fddf1d7/attachment.pgp>


More information about the Insight-users mailing list