<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Andrew,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">the problem was that you were setting the mask to just the white box. This caused the metric to only be evaluated on one pixel intensity, which is a degenerate case and is probably what caused the correlation to be 0. Without setting either mask, the registration does something - I did not examine whether the result is correct or even meaningful. The modified files are attached - you can do a diff to see the few differences.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">If you need the mask for a similar case in practice, you could use dilate filter to enlarge the mask by a few voxels.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 26, 2016 at 3:14 PM, Andrew Harris <span dir="ltr"><<a href="mailto:aharr8@uwo.ca" target="_blank">aharr8@uwo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px"><span class="">Sorry again for the delay, we determined the images we were creating were too big so we created a smaller phantom image, attached.  In addition, there is a main() function in CorrelationTest.cpp that runs the correlation and outputs it to  a file called observer.txt, and I have included the most up-to-date versions of my class and header files.  The function is expecting the phantom to exist in a folder at c:/Scans/Phantom.  Let me know if you need further info, and thanks again for your help.​<br></span><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B_DYTA-i186ZenpOTzUxekVhaU0/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">SmallPhantomBox.raw</span></a></div>​​<br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B_DYTA-i186ZT3pjaWtrbkRzeFE/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">CorrelationTest.cpp</span></a></div>​​<br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B_DYTA-i186ZM3dwRXNiU1JEems/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">Correlator3D.cpp</span></a></div>​​<br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B_DYTA-i186ZQ25EbjMtZkxJVlU/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">Correlator3D.h</span></a></div>​</span><br></div><div class="gmail_extra"><span class=""><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p>--</p><p>AH<br></p><p><br></p><p>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----</p><p><i>This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></p></div></div></div></div></div></div></div></div></div>
<br></span><div class="gmail_quote"><span class="">On Tue, Aug 23, 2016 at 9:53 AM, Dženan Zukić <span dir="ltr"><<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Andrew,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">you are doing so many things in a nonstandard way, starting with passing around pointers to buffers and metadata as plain parameters, instead of just once converting to itk::Image and then using itk::Image::Pointer to pass the images around. Your approach is more prone to errors.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Can you provide the inputs and the main function which invokes this class to have a runnable example? I will try to find the problem.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Aug 22, 2016 at 3:25 PM, Andrew Harris <span dir="ltr"><<a href="mailto:aharr8@uwo.ca" target="_blank">aharr8@uwo.ca</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hello all,<div>I am having a devil of a time setting up the CorrelationImageToImageMetricv<wbr>4 and getting a result that makes sense.  I have written an observer that outputs to a text file the iteration number, correlation value, and current position.  I have generated a virtual phantom image of a white cube on a black background, and when I put the same image through for fixed and moving images, I get [0,0,0,0,0,0], meaning that no rotation or translation is required for the images to be aligned.  This is the correct versor and vector transform, and if I apply a translation the correct distance values are returned to have the images align, however the metric value returned is also 0 and a perfect registration like this should yield a metric of -1 according to the documentation.  Additionally, it doesn’t seem to be analyzing rotation properly, as when I introduce a rotation around any axis the metric returns a translation on the other two axes but the rotation versor remains at zero.</div><div><br></div><div>I’m attaching my code as well, it’s possible I’ve not set some parameters up properly:</div><div><br></div><div><br></div><div><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p>--</p><p>AH<br></p><p><br></p><p>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----</p><p><i>This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></p></div></div></div></div></div></div></div></div></div>
</div></div>
<br></div></div>______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/product<wbr>s/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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div>