<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Jian Wu</b> <<a href="mailto:eewujian@gmail.com">eewujian@gmail.com</a>><br>Date: Jun 26, 2006 8:08 AM<br>
Subject: Re: [Insight-users] Questions about ImageRegistrationMethod - How tokeep user-defined image origin?<br>To: Fucang Jia <<a href="mailto:jiafucang@asisz.com">jiafucang@asisz.com</a>><br><br></span><div>Hi, Fucang,
<br>Thanks for the reply!<br>But how to resolve the problem? And why the user-specified origin was modified by <font face="Verdana" size="2">"m_Metric->Initialize()" in the first place? If the modification is inevitable, is there any way to recover the user-specified origin?
<br></font></div><div><span class="sg"><font face="Verdana" size="2">Jian Wu<br></font></span></div><div></div><div><span class="q" id="q_10c103d3210b4c51_3"><br><div><span class="gmail_quote">On 6/26/06, <b class="gmail_sendername">
Fucang Jia</b> <<a href="mailto:jiafucang@asisz.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jiafucang@asisz.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div>
<div><font color="#000000" face="Verdana">Hi, Jian,</font></div>
<div><font color="#000000" face="Verdana"></font> </div>
<div><font color="#000000" face="Verdana">Because m_Metric->GetFixedImage()
return a constant object which could not be changed, the </font><font color="#000000" face="Verdana">origin could not be set.</font></div>
<div><pre><code><font color="#000000" face="Verdana">HTH,</font></code></pre><pre><code><font color="#000000" face="Verdana">Fucang</font></code></pre></div>
<div><font color="#0000ff" face="Verdana" size="2"></font> </div>
<div><font color="#0000ff" face="Verdana" size="2"></font> </div>
<div> <font face="Verdana" size="2"> </font></div>
<div>
<hr>
</div>
<div><font face="Verdana"><font size="2">On 2006-06-26 11:19:21 Jian
Wu</font></font></div>
<div><font face="Verdana"><font size="2">Subject: [Insight-users]
Questions about ImageRegistrationMethod - How tokeep user-defined image
origin?</font></font></div>
<div><font face="Verdana" size="2"></font> </div>
<div><font face="Verdana" size="2">Dear ITK users:<br><br>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.<br><br> imageReader2D->GetOutput()->SetOrigin(
origin2D); <br><br>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<br><br> m_Metric->Initialize();<br><br>I also noticed
the author did try to recover the user-specified orgin in the code immediately
following above one.<br><br> // Recover user-defined image origin
<br> const short Dimension =
GetImageDimension<FixedImageType>::ImageDimension;<br> double
fixedOrg[Dimension];<br> for(int i = 0; i < Dimension;
i++)<br> fixedOrg[i] = fixedOrigin[i];<br>
//m_FixedImage->SetOrigin(fixedOrg); <br>
//m_Metric->GetFixedImage()->SetOrigin(fixedOrg);<br><br>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. <br><br>error
C2663: 'itk::ImageBase<VImageDimension>::SetOrigin' : 3 overloads have no
legal conversion for 'this'
pointer<br>
with<br>
[<br>
VImageDimension=3<br> ]<br><br>I'm
using Microsoft Visual C++ 2005 standard edition and Window XP professional.
<br><br>Any help and suggestions will be appreciated!<br><br>Jian
Wu<br><br></font></div></div>
</div></blockquote></div><br>
</span></div>