<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap:break-word; color:rgb(0,0,0); font-size:14px; font-family:Calibri,sans-serif">
<div>Ali,</div>
<div><br>
</div>
<div>You original e-mail is vague in its description of how you deterred that the displacement field has all zero's at every iteration.</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>-- Where you using a debugger?</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>-- How many zero values were listed? </div>
<div><br>
</div>
<div>Why do you need the const_cast in this code? Could that change the behavior? </div>
<div><br>
</div>
<div>The use of const_cast is an indication that you are tyring to do something that is not supported. Either ITK is deficient in not providing a const version of that member function, or you are trying to do something that has been explicitly prohibited.</div>
<div><br>
</div>
<div>Due to the ambiguity in your original posting, it is hard to figure out what your problem is. You know that the the overall program produces a good result at the end, but you are trying to interrogate the process at every iteration, and for that you need
to get the moving transform at each iteration.</div>
<div><br>
</div>
<div>*** I think that the problem you are having is exposing the current transform at each iteration to the observer. ***</div>
<div><br>
</div>
<div>The response from Nick does not seem to address your real problem.</div>
<div><br>
</div>
<div>Please make a more thorough and very clearly stated problem, and then post enough information so that an external developer can replicate your error on their machine QUICKLY and EASILY. </div>
<div><br>
</div>
<div>Keep these facts in mind when requesting help from the ITK developer community:</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>1) We are almost all volunteers. We help out of kindness not financial gain.</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>2) If we can not replicate your error on my computer, we can not fix it.</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>3) Our time is valuable, if we need to guess, work, hard, or decipher code to determine how to replicate your problem, we will not have the time or energy even to get started</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>4) Provide both a) A description of the problem, b) description of how to replicate the problem, *** c) a description of how you believe the code should behave ***, and d) a proposed solution</div>
<div><br>
</div>
<div><br>
</div>
<div>Hans</div>
<div><br>
</div>
<div>PS: Nick Thanks for trying to address this request. The original request was not very clear, and your effort showed that the end result is good (that was never in doubt). The problem is interrogating for the current transform at every iteration.</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; border-bottom:medium none; border-left:medium none; padding-bottom:0in; padding-left:0in; padding-right:0in; border-top:#b5c4df 1pt solid; border-right:medium none; padding-top:3pt">
<span style="font-weight:bold">From: </span>Nick Tustison <<a href="mailto:ntustison@gmail.com">ntustison@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Saturday, December 1, 2012 8:24 PM<br>
<span style="font-weight:bold">To: </span>Ali Ghayoor <<a href="mailto:ali-ghayoor@uiowa.edu">ali-ghayoor@uiowa.edu</a>><br>
<span style="font-weight:bold">Cc: </span>ITK <<a href="mailto:insight-developers@itk.org">insight-developers@itk.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Insight-developers] "itkSyNImageRegistrationMethod" cannot return its metric's transform properly<br>
</div>
<div><br>
</div>
<div><base href="">
<div style="word-wrap:break-word">Hi Ali,
<div><br>
</div>
<div>I don't think that there's a deficiency. I just ran the itkSyNImageRegistrationTest</div>
<div>and added the following snippet to write the displacement field to disk starting</div>
<div>at line 275.</div>
<div><br>
</div>
<div>
<div> typedef itk::ImageFileWriter<DisplacementFieldType> WriterType2;</div>
<div> typename WriterType2::Pointer writer2 = WriterType2::New();</div>
<div> writer2->SetFileName( "/Users/ntustison/Desktop/testDisplacementField.nii.gz" );</div>
<div> writer2->SetInput( outputTransform->GetDisplacementField() );</div>
<div> writer2->Update();</div>
</div>
<div><br>
</div>
<div>The result was a non-zero displacement field that looked reasonable based</div>
<div>on the parameters specified by the test.</div>
<div><br>
</div>
<div>Nick</div>
<div><br>
</div>
<div><br>
<div>
<div>On Dec 1, 2012, at 8:30 PM, "Ghayoor, Ali" <<a href="mailto:ali-ghayoor@uiowa.edu">ali-ghayoor@uiowa.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family:Helvetica; font-size:medium; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; word-wrap:break-word">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt"><font size="3" face="Calibri">Hello Developers,<br>
</font>
<div style=""><span id="OLK_SRC_BODY_SECTION"><font size="3" face="Calibri"></font>
<div>
<div style="word-wrap:break-word">
<div><font size="3" face="Calibri"><br>
</font></div>
<div><font size="3" face="Calibri">In a registration framework, at each iteration, I get the current moving transform from the metric of the "itkSyNImageRegistrationMethod" filter; however, the returned moving transform has a displacement field with all zero
values at every iteration. </font></div>
<div><font size="3" face="Calibri"><br>
</font></div>
<div><font size="3" face="Calibri">To inspect this deficiency in ITK, I used <span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important">"itkSyNImageRegistrationTest.cxx",
and made some modifications in the test code for this purpose.</span></font></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri">I
added an iteration observer to the SyN registration stage:</font></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri"><br>
</font></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important">
<span class="Apple-tab-span" style="white-space:pre"> </span>typedef CommandIterationUpdate<DisplacementFieldRegistrationType> DisplacementFieldCommandType; </span><br style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
<span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important">
typename DisplacementFieldCommandType::Pointer DisplacementFieldObserver = DisplacementFieldCommandType::New(); </span><br style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
<span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important">
displacementFieldRegistration->AddObserver( itk::IterationEvent(), DisplacementFieldObserver ); </span></font></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><font size="3" face="Calibri"><br>
</font></span></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri">Then,
inside the observer class, I asked for the parameters of the moving transform at the current iteration:</font></span></span></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri"><br>
</font></span></span></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><font size="3" face="Calibri"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span class="Apple-tab-span" style="white-space:pre"></span>
std::cout << " parameters: " << const_cast<TFilter *>( filter )->GetMetric()->GetMovingTransform()->GetParameters() << std::endl; </span><br style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
<span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important">
std::cout << " fixed parameters " << const_cast<TFilter *>( filter )->GetMetric()->GetMovingTransform()->GetFixedParameters() << std::endl;</span></font></span></span></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><font size="3" face="Calibri"><br>
</font></span></span></span></span></div>
<div><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; background-color:transparent; display:inline!important"><span style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:17px; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; float:none; display:inline!important"><font size="3" face="Calibri">However,
the Parameters of the moving transform is an all zero valued displacement field at each iteration.</font></span></span></span></span></div>
<div><font size="3" face="Calibri">Do you know why the registration filter does not return the right moving transform? <span style="line-height:17px">Could you please help about this problem.</span></font></div>
<div><span class="Apple-style-span" style="line-height:17px"><font size="3" face="Calibri"><br>
</font></span></div>
<div><span class="Apple-style-span" style="line-height:17px"><font size="3" face="Calibri">Thanks,</font></span></div>
<div><span class="Apple-style-span" style="line-height:17px"><font size="3" face="Calibri">Ali</font></span></div>
</div>
</div>
</span></div>
</div>
_______________________________________________<br>
Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</span><br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
<hr>
</body>
</html>