<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Dear All,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>It is mentioned in the ItkSoftwareGuide (version2.4.0
8.7 Multi-ResolutionReigstration) that “another possible scheme is
to use a simple translation transform for the initial coarse registration and
an affine transform at the finer levels”.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>It means that in different levels, we will
use different transformers:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Level 0: <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>typedef itk::TranslationTransform<
double, Dimension > TransformType;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>TransformType::Pointer
transform = TransformType::New();<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Level higher:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>typedef itk::AffineTransform< double, 2
> TransformType1;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>TransformType1::Pointer
transform1 = TransformType1::New();<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>So I revised the MultiResImageRegistraion1.xx
and the code is like this:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>template <typename TRegistration><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>class RegistrationInterfaceCommand : public
itk::Command <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> if (
registration->GetCurrentLevel() == 0 )<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> {<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:31.5pt'><span lang=EN-US>//…<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> }<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> else<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> {<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
registration->SetTransform(
transform1 );<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> }<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>//…<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>class CommandIterationUpdate : public
itk::Command <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>//…<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Int main()<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>{//…<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
registration->SetOptimizer(
optimizer );<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
registration->SetTransform(
transform );<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>//…<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:5.25pt'><span lang=EN-US>registration->StartRegistration();<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I got the error message that “Description:
itk::ERROR: RegularStepGradientDescentOptimizer(022E64D0):<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> of Scales is 6, but the
NumberOfParameters for the CostFunction is 2.”<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Obviously, parameters used to initialize
optimizer are different at different levels. I don’t know how to solve
this problem. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>And I wonder how does the translation
transform give its result to the next level’s affine transform.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>If you have done this kind of registration
before, please tell me how to solve the problem.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Thanks a lot!<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>yurenji<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
</div>
</body>
</html>