[ITK] [ITK-users] CorrelationImageToImageMetricv4 returns 0 from GetValue()

Andrew Harris aharr8 at uwo.ca
Fri Aug 26 15:14:41 EDT 2016


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.​
 SmallPhantomBox.raw
<https://drive.google.com/file/d/0B_DYTA-i186ZenpOTzUxekVhaU0/view?usp=drive_web>
​​
 CorrelationTest.cpp
<https://drive.google.com/file/d/0B_DYTA-i186ZT3pjaWtrbkRzeFE/view?usp=drive_web>
​​
 Correlator3D.cpp
<https://drive.google.com/file/d/0B_DYTA-i186ZM3dwRXNiU1JEems/view?usp=drive_web>
​​
 Correlator3D.h
<https://drive.google.com/file/d/0B_DYTA-i186ZQ25EbjMtZkxJVlU/view?usp=drive_web>
​

--

AH


-----------------------------------------------------------------------------------------------

*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.*

On Tue, Aug 23, 2016 at 9:53 AM, Dženan Zukić <dzenanz at gmail.com> wrote:

> Hi Andrew,
>
> 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.
>
> 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.
>
> Regards,
> Dženan
>
> On Mon, Aug 22, 2016 at 3:25 PM, Andrew Harris <aharr8 at uwo.ca> wrote:
>
>> Hello all,
>> I am having a devil of a time setting up the
>> CorrelationImageToImageMetricv4 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.
>>
>> I’m attaching my code as well, it’s possible I’ve not set some parameters
>> up properly:
>>
>>
>> --
>>
>> AH
>>
>>
>> ------------------------------------------------------------
>> -----------------------------------
>>
>> *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.*
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160826/6af0f748/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list