[Insight-users] 3D Registration

Srivalli Valli@cspl.org
Wed, 5 Feb 2003 19:10:50 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C2CD4A.4C3C7620
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Mr.Luis,
 I am working on the itk example MultiResImageRegistration2.cxx.
I could get the expected registration output for 2D images.
But,When I tried to run the same example with for 3D images(changing the =
dimension to 3) i am getting runtime error.Error message is not itk =
try-catch message.It is memory exception.When I debug the code I found =
that error message is comming from the following code in the class =
itkImageConstIterator.h.

/** Get the pixel value */
  PixelType Get(void) const =20
    { return m_PixelAccessor.Get(*(m_Buffer+m_Offset)); }

When  number of levels are 5,Exception is getting after 3rd level.
Whne number of levels are 2,exception is getting after 1st level.
Whne number of levels are 4,exception is getting after 2nd level.

I am listing the code and parameter values:
pixeltype short
dimension 3
x-dim=3D128;
y-dim=3D128;
depth=3D35;
double Spacing[3] =3D {2.0, 2.0, 4.25 };


for(int i=3D0;i<=3D8;i++)
 optimizerScales[i] =3D 1.0;
  optimizerScales[9] =3D 1.0 /128*2;
  optimizerScales[10] =3D 1.0 /128*2;  =20
  optimizerScales[11] =3D 1.0 /35*4.5;

  optimizer->SetScales( optimizerScales );

  metric->SetNumberOfHistogramBins( 15 );

  metric->SetNumberOfSpatialSamples( 50 );

  optimizer->SetNumberOfIterations(    200   );

  registration->SetNumberOfLevels( 5 );

   if ( registration->GetCurrentLevel() =3D=3D 0 )
      {
      optimizer->SetMaximumStepLength( 0.5 ); =20
      optimizer->SetMinimumStepLength(  0.001 );
      }
    else
      { =20
 optimizer->SetMinimize(TRUE);
 optimizer->SetMaximumStepLength(       =
optimizer->GetCurrentStepLength());

         optimizer->SetMinimumStepLength(
                optimizer->GetMinimumStepLength() / 10.0 );
      }

Please tell me what are the extra parameters i have to set for 3D =
Registration.

ThankYou in advance,

Regards,
Valli.


 =20

------=_NextPart_000_0005_01C2CD4A.4C3C7620
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Mr.Luis,<BR>&nbsp;I am working on =
the itk=20
example MultiResImageRegistration2.cxx.<BR>I could get the expected =
registration=20
output for 2D images.<BR>But,When I tried to run the same example with =
for 3D=20
images(changing the dimension to 3) i am getting runtime error.Error =
message is=20
not itk try-catch message.It is memory exception.When I debug the code I =
found=20
that error message is comming from the following code in the class=20
itkImageConstIterator.h.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>/** Get the pixel value =
*/<BR>&nbsp; PixelType=20
Get(void) const&nbsp; <BR>&nbsp;&nbsp;&nbsp; { return=20
m_PixelAccessor.Get(*(m_Buffer+m_Offset)); }</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When&nbsp; number of levels are =
5,Exception is=20
getting after 3rd level.<BR>Whne number of levels are 2,exception is =
getting=20
after 1st level.<BR>Whne number of levels are 4,exception is getting =
after 2nd=20
level.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am listing the code and parameter=20
values:<BR>pixeltype short<BR>dimension=20
3<BR>x-dim=3D128;<BR>y-dim=3D128;<BR>depth=3D35;<BR>double Spacing[3] =
=3D {2.0, 2.0,=20
4.25 };</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>for(int=20
i=3D0;i&lt;=3D8;i++)<BR>&nbsp;optimizerScales[i] =3D 1.0;<BR>&nbsp; =
optimizerScales[9]=20
=3D 1.0 /128*2;<BR>&nbsp; optimizerScales[10] =3D 1.0 =
/128*2;&nbsp;&nbsp; <BR>&nbsp;=20
optimizerScales[11] =3D 1.0 /35*4.5;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; optimizer-&gt;SetScales( =
optimizerScales=20
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; =
metric-&gt;SetNumberOfHistogramBins( 15=20
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; =
metric-&gt;SetNumberOfSpatialSamples( 50=20
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;=20
optimizer-&gt;SetNumberOfIterations(&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;=20
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; =
registration-&gt;SetNumberOfLevels( 5=20
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; if (=20
registration-&gt;GetCurrentLevel() =3D=3D 0 =
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; optimizer-&gt;SetMaximumStepLength( =
0.5=20
);&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
optimizer-&gt;SetMinimumStepLength(&nbsp; 0.001=20
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{&nbsp;&nbsp;<BR>&nbsp;optimizer-&gt;SetMinimize(TRUE);<BR>&nbsp;optimize=
r-&gt;SetMaximumStepLength(=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;optimizer-&gt;GetCurrentStepLength())=
;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
optimizer-&gt;SetMinimumStepLength(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
optimizer-&gt;GetMinimumStepLength() / 10.0 =
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please tell me what are the extra =
parameters i have=20
to set for 3D Registration.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ThankYou in advance,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,<BR>Valli.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp; </FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C2CD4A.4C3C7620--