[Insight-users] Questions about ImageRegistrationMethod - How
tokeep user-defined image origin?
Fucang Jia
jiafucang at asisz.com
Mon Jun 26 03:52:40 EDT 2006
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/92a39a00/attachment.html
More information about the Insight-users
mailing list