[Insight-users] Questions about ImageRegistrationMethod - How to keep user-defined image origin?

Jian Wu eewujian at gmail.com
Sun Jun 25 23:15:24 EDT 2006


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/20060625/ce83ba9f/attachment.html


More information about the Insight-users mailing list