<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1515" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>Tanya,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=268124212-04102005>You
can try the following in your command observer:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>typedef <SPAN
class=268124212-04102005>itk::VersorRigid3DTransform
TransformType;</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>TransformType::Pointer transform =
TransformType::New();</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>transform->SetParameter
(optimizer->GetCurrentPosition());</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>TransformType::MatrixType matrix =
transform->GetMatrix();</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>TransformType::TranslationType translation =
transform->GetTranslation();</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=268124212-04102005>/* use
matrix and translation to form a 4x4 homogeneous transformation matrix
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005> vtkmatrix */</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>pTransform -> SetMatrix ( vtkmatrix
);</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=268124212-04102005>Xiaodong </SPAN></FONT></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Tanya S
[mailto:tanya_lll@yahoo.com]<BR><B>Sent:</B> Tuesday, October 04, 2005 7:36
AM<BR><B>To:</B> Tao, Xiaodong (Research);
insight-users@itk.org<BR><B>Subject:</B> RE: [Insight-users]
ImageRegistration8 takes 2 hours 45 menit!<BR><BR></FONT></DIV>
<DIV>Thank you Xiaodong, Junyi and Luis,</DIV>
<DIV> </DIV>
<DIV>I change the metric of imageRegistration8 from
MeanSquareImageToImageMetric to MattesMutualInformationImageToImageMetric and
it runs no more than 2 minutes! Thank you very much!</DIV>
<DIV> </DIV>
<DIV>However, I have other problem :(.</DIV>
<DIV>I would like to know how to convert VersorRigid3DTransform to
vtkTransform.</DIV>
<DIV>I have displayed the Fixed and the Moving Image using VTK. Now, what I
want to do is I would send all the versors and translations from
VersorRigid3DTransform to vtkTransform from each iteration of the registration
process, so that the Moving Image is moved showing the registration
process from each iteration.</DIV>
<DIV> </DIV>
<DIV>I have one class that inherits itk::Command and has Execute method.
Inside this method, I call:</DIV>
<DIV> </DIV>
<DIV>pTransform->RotateX(optimizer->GetCurrentPosition()[0])</DIV>
<DIV>pTransform->RotateY(optimizer->GetCurrentPosition()[1])</DIV>
<DIV>pTransform->RotateZ(optimizer->GetCurrentPosition()[2])</DIV>
<DIV>pTransform->Translate(optimizer->GetCurrentPosition()[3],</DIV>
<DIV>optimizer->GetCurrentPosition()[4],</DIV>
<DIV>optimizer->GetCurrentPosition()[5])</DIV>
<DIV> </DIV>
<DIV>pTransform is of type vtkTransform*.</DIV>
<DIV>But this code give wrong transformation.</DIV>
<DIV> </DIV>
<DIV>I have also tried to set the optimizer->GetCurrentPosition() values to
vtkMatrix4x4 and then call :</DIV>
<DIV>pTransform->SetMatrix(theMatrix) </DIV>
<DIV>but this gives me also wrong transformation. "theMatrix" is of type
vtkMatrix4x4.</DIV>
<DIV> </DIV>
<DIV>Any hint would be really appreciated.</DIV>
<DIV> </DIV>
<DIV>Best regards,</DIV>
<DIV>.Tanya.</DIV>
<DIV><BR><BR><B><I>Tao, Xiaodong (Research)"
<taox@research.ge.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1515" name=GENERATOR>
<DIV><FONT face=Arial size=2><SPAN
class=472375612-30092005><STRONG>Tanya,</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=472375612-30092005><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT size=+0><SPAN class=472375612-30092005><FONT face=Arial
size=2><STRONG>ImageRegistration8 uses MeanSquaresImageToImageMetric and
VersorRigid3DTransform for registration. This combination may work well for
images acquired for the same subject using the same modality,
in which case, two images can be aligned using a rigid
transform (same subject), and corresponding points in the moving image
and the fixed image have same intensity (same modality). For your
application, you are registering a PET image with an MRI image. You may want
to try one of the mutual information based image to image metric to get
more accurate result, such as </STRONG></FONT>
<P><FONT face=Arial><FONT
size=2><STRONG>itkNormalizedMutualInformationHistogramImageToImageMetri<SPAN
class=472375612-30092005>c </SPAN></STRONG><SPAN
class=472375612-30092005><STRONG>or </STRONG></SPAN></FONT></FONT><SPAN
class=472375612-30092005><FONT face=Arial
size=2><STRONG>itkMattesMutualInformationImageToImageMetric</STRONG></FONT></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>There are
a few examples showing how to used these metrics.</FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>The
MeanSquaresImageToImageMetric is also one of the reasons that the
program takes long time to run, since at each iterattion, it transforms and
interpolates ALL points in the Fixed image region in order to compute the
metric. When you use
itkNormalizedMutualInformationHistogramImageToImageMetri<SPAN
class=472375612-30092005>c </SPAN><SPAN class=472375612-30092005><STRONG>or
</STRONG></SPAN><SPAN class=472375612-30092005><FONT face=Arial
size=2><STRONG>MattesMutualInformationImageToImageMetric, you can always
control the running time by setting the number of samples in the fixed image
region for metric
computation.</STRONG></FONT></SPAN></FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>If you
still want to use <SPAN class=472375612-30092005><FONT face=Arial
size=2><STRONG>ImageRegistration8, you can use the PET image (which has
fewer voxels than the MRI image) as the fixed image to cut down the running
time.</STRONG></FONT></SPAN></FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2><SPAN
class=472375612-30092005>Xiaodong</SPAN></FONT></SPAN></STRONG></P></SPAN></SPAN></FONT><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
insight-users-bounces+taox=research.ge.com@itk.org
[mailto:insight-users-bounces+taox=research.ge.com@itk.org]<B>On Behalf Of
</B>Tanya S<BR><B>Sent:</B> Thursday, September 29, 2005 11:34
PM<BR><B>To:</B> Luis Ibanez; insight-users@itk.org<BR><B>Subject:</B> Re:
[Insight-users] ImageRegistration8 takes 2 hours 45
menit!<BR><BR></FONT></DIV>
<BLOCKQUOTE>
<DIV>Hi Luis,</DIV>
<DIV> </DIV>
<DIV>I have tried to run imageRegistration8 for Release version and it
took 21 minutes :((. My machine spesification and the image size are
the same as what I wrote on my last email (email attached). </DIV>
<DIV> </DIV>
<DIV>Thanks beforehand for your answer.</DIV>
<DIV> </DIV>
<DIV>Best regards,</DIV>
<DIV>.Tanya.<BR><BR><B><I>Tanya S <tanya_lll@yahoo.com></I></B>
wrote:</DIV>
<BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV><BR>
<BLOCKQUOTE class=replbq
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<P>Hi Luis, thanks a lot for answering my question.</P>
<P>Below are the detail of my machine:<BR><BR><EM>1) In what type of
machine did you run this code ?</EM></P>
<P>Intel Pentium 4 2.4 GHz<BR><EM>2) What operating system ?</EM></P>
<P>Windows 2000<BR><EM>3) What compiler ?</EM></P>
<P>Microsoft Visual C++ 6.0</P>
<P><EM>4) Did you build it for "Release" ?</EM></P>
<P>No, it was Debug version.<BR></P>
<P>The size of the images are :<BR>- MRI image</P>
<P>Dimension:256, 256, 168</P>
<P>Voxel size(mm): 0.86,0.86, 1.5</P>
<P>The .img file is 21,500 KB</P>
<P><BR>- PET image</P>
<P>Dimension: 128, 128, 94</P>
<P>Voxel size(mm): 2.0, 2.0, 3.0</P>
<P>the .img file is 3,000 KB<BR></P>
<P>Maybe I should try for Release. I ll tell you how it works in
Release version.<BR></P>
<P>Thanks again,</P>
<P>.Tanya.<BR><BR>-----------------<BR>Tanya S wrote:<BR>> Dear
all,<BR>> <BR>> I would like to start doing registration using
ITK. I run the sample: <BR>> ImageRegistration8 for registering two
Analyze head images, i.e:<BR>> - MRI image(Dimension:256, 256, 168
and Voxel size(mm): 0.86,0.86, 1.5)<BR>> - PET image(Dimension:
128, 128, 94 and Voxel size(mm): 2.0, 2.0, 3.0)<BR>> <BR>> The
registration process takes around 2 hours and 45 minutes with <BR>>
non-accurate result :(.<BR>> <BR>> I would like to ask why does
it take so long and how to make it faster?<BR>> <BR>> Any hint
would be really appreciated.<BR>> <BR>> Best regards,<BR>>
.Tanya.<BR>> <BR><BR></P></BLOCKQUOTE></DIV>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A
href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A>
to the Hurricane Katrina relief effort.
_______________________________________________<BR>Insight-users mailing
list<BR>Insight-users@itk.org<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A
href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A>
to the Hurricane Katrina relief effort.
</BLOCKQUOTE>_______________________________________________<BR>Insight-users
mailing
list<BR>Insight-users@itk.org<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A href="http://store.yahoo.com/redcross-donate3/">Click
here to donate</A> to the Hurricane Katrina relief effort.
</BLOCKQUOTE></BODY></HTML>