[Insight-users] 3DAffineTransform
Srivalli
Valli@cspl.org
Fri, 14 Feb 2003 19:11:55 +0530
This is a multi-part message in MIME format.
------=_NextPart_000_000B_01C2D45C.F0B70080
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dear Luis,
Thanks for your help in soving problem in registration using translate =
transform.
I could get the output matrix and image as expected.
Now,I moved to multiresolution example2 whcih uses affinetransform.I =
have used follwing input parameters.
size=3D{256,256,120}
const double Spacing[3] =3D {0.859390, 0.859375, 1.60000 };
int m=3D200;=20
for(int i=3D0;i<=3D8;i++)
optimizerScales[i] =3D 1.0/m;
optimizerScales[9] =3D 1.0 /(256*0.859390);=20
optimizerScales[10] =3D 1.0 /(256*0.859390);=20
optimizerScales[11] =3D 1.0 /(120*1.6000);=20
optimizer->SetScales( optimizerScales );
metric->SetNumberOfHistogramBins( 15 );
metric->SetNumberOfSpatialSamples( 1000 );
optimizer->SetNumberOfIterations( 150 );
/I have tried with 200,300 and 400 iteration
registration->SetNumberOfLevels( 5 );
optimizer->SetMaximize(TRUE);
optimizer->SetMaximumStepLength(0.05);
optimizer->SetMinimumStepLength(0.0001);
My problem is,
When i set number of levels to 4,I could run the registration process =
with out any error.But,final matrix is totally out of my expectation.
When i set number of levels to 5 and trace the values at each =
iteration,after 4th level i got error.Error is not itk message.It is =
memory exception.
Output screen is :
First file : F:\registration\DataSet120\Normal.raw
Second file : F:\registration\DataSet120\Rotated120.raw
Get No of Params : 12
iteration :44
Metric value: -0.478405
Matrix:
1.00982 0.151011 0,=20
-0.173682 0.987639 0,
0 0 1
Offset: 0.437914, -0.570125, 0
level2:
optimizercurrent value ! 9.76563e-005
level3:
optimizercurrent value ! 0.05
min value ! 1e-005
level4:
optimizercurrent value ! 0.05
min value ! 1e-005
error
Press any key to continue
memory exception "Memory could not be read".
My moving is generated from fixed by rotating 10 degrees in z-direction.
I think matrix I got is the expected result.
2,3, and 4th levels are skipped without any Process.
After that i got error.
Please tell me where i made mistake.
Thnak you in advance,
Regards,
Valli
------=_NextPart_000_000B_01C2D45C.F0B70080
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 Luis,<BR> Thanks for your =
help in soving=20
problem in registration using translate transform.<BR>I could get the =
output=20
matrix and image as expected.<BR>Now,I moved to multiresolution example2 =
whcih=20
uses affinetransform.I have used follwing input parameters.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>size=3D{256,256,120}<BR>const double =
Spacing[3] =3D=20
{0.859390, 0.859375, 1.60000 };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> int m=3D200; <BR> for(int=20
i=3D0;i<=3D8;i++)<BR> optimizerScales[i] =3D 1.0/m;<BR> =20
optimizerScales[9] =3D 1.0 /(256*0.859390); <BR> =
optimizerScales[10] =3D 1.0=20
/(256*0.859390); <BR> optimizerScales[11] =3D 1.0 /(120*1.6000);=20
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> optimizer->SetScales( =
optimizerScales=20
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> metric->SetNumberOfHistogramBins( 15=20
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
metric->SetNumberOfSpatialSamples( 1000=20
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
optimizer->SetNumberOfIterations( 150=20
);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>/I have tried with 200,300 and 400 =
iteration</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>registration->SetNumberOfLevels( 5=20
);<BR>optimizer->SetMaximize(TRUE);<BR> optimizer->SetMa=
ximumStepLength(0.05);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> optimizer->SetMinimumStepLength(0.0001);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>My problem is,<BR>When i set number of =
levels to=20
4,I could run the registration process with out any error.But,final =
matrix is=20
totally out of my expectation.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>When i set number of levels to 5 and =
trace the=20
values at each iteration,after 4th level i got error.Error is not =
itk=20
message.It is memory exception.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Output screen is :<BR>First file =
:=20
F:\registration\DataSet120\Normal.raw<BR>Second file :=20
F:\registration\DataSet120\Rotated120.raw<BR>Get No of Params : =
12<BR>iteration=20
:44<BR>Metric value: -0.478405</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>Matrix:<BR>1.00982 =20
0.151011 0,=20
<BR>-0.173682 =20
0.987639 =20
0,<BR> 0 =
=20
0 =
=20
1</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Offset: 0.437914, -0.570125,=20
0<BR>level2:<BR>optimizercurrent value !=20
9.76563e-005<BR>level3:<BR>optimizercurrent value ! 0.05<BR>min value !=20
1e-005<BR>level4:<BR>optimizercurrent value ! 0.05<BR>min value !=20
1e-005<BR>error<BR>Press any key to continue</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> memory exception "Memory could =
not be=20
read".</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>My moving is generated from fixed by =
rotating 10=20
degrees in z-direction.<BR>I think matrix I got is the expected =
result.<BR>2,3,=20
and 4th levels are skipped without any Process.<BR>After that i got=20
error.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Please tell me where i made =
mistake.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thnak you in advance,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Regards,<BR>Valli</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_000B_01C2D45C.F0B70080--