Fwd: [Insight-users] Questions about ImageRegistrationMethod - How tokeep user-defined image origin?

Jian Wu eewujian at gmail.com
Mon Jun 26 08:09:15 EDT 2006


---------- Forwarded message ----------
From: Jian Wu <eewujian at gmail.com>
Date: Jun 26, 2006 8:08 AM
Subject: Re: [Insight-users] Questions about ImageRegistrationMethod - How
tokeep user-defined image origin?
To: Fucang Jia <jiafucang at asisz.com>

Hi, Fucang,
Thanks for the reply!
But how to resolve the problem? And why the user-specified origin was
modified by "m_Metric->Initialize()" in the first place? If the modification
is inevitable, is there any way to recover the user-specified origin?
Jian Wu

On 6/26/06, Fucang Jia <jiafucang at asisz.com> wrote:
>
>  Hi, Jian,
>
> Because m_Metric->GetFixedImage() return a constant object which could not
> be changed, the origin could not be set.
>
> HTH,
>
> Fucang
>
>
>
>
>  ------------------------------
>  On 2006-06-26 11:19:21 Jian Wu
> Subject:    [Insight-users] Questions about ImageRegistrationMethod - How
> tokeep user-defined image origin?
>
> Dear ITK users:
>
> I'm working on a 2D-3D image registration projection. The input 2D image
> has a user-specified image origin. The origin was set by using the following
> code.
>
>     imageReader2D->GetOutput()->SetOrigin( origin2D);
>
> The change was successful and it has been verified in debugging. However,
> I noticed the origin was slightly changed by the code during the
> initialization of the registration. That was happened in Line 210 in
> itkImageRegistrationMethod.txx (version 1.24). The code is
>
>     m_Metric->Initialize();
>
> I also noticed the author did try to recover the user-specified orgin in
> the code immediately following above one.
>
>   // Recover user-defined image origin
>   const short Dimension =
> GetImageDimension<FixedImageType>::ImageDimension;
>   double fixedOrg[Dimension];
>   for(int i = 0; i < Dimension; i++)
>     fixedOrg[i] = fixedOrigin[i];
>   //m_FixedImage->SetOrigin(fixedOrg);
>   //m_Metric->GetFixedImage()->SetOrigin(fixedOrg);
>
> I don't know why the last two lines were commented out. I removed the
> comment characters and recomplied the codes. But I got the following
> compiling errors.
>
> error C2663: 'itk::ImageBase<VImageDimension>::SetOrigin' : 3 overloads
> have no legal conversion for 'this' pointer
>         with
>         [
>             VImageDimension=3
>         ]
>
> I'm using Microsoft Visual C++ 2005 standard edition and Window XP
> professional.
>
> Any help and suggestions will be appreciated!
>
> Jian Wu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060626/31f5b34b/attachment.html


More information about the Insight-users mailing list