[Insight-users] Registration works on Debug, on Release doesn't

Sergio Vera sergio.vera at alma3d.com
Mon May 31 03:52:26 EDT 2010


Hello
In addition to Valgrind (only works in Linux & Mac X), you can use cppcheck
in Windows OS's that although has less features than Valgrind, it does help
to fix potential code problems and also is opensource software.

Sergio


On Fri, May 28, 2010 at 5:22 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

> Oscar,
>
>
> I second Sergio,
> This looks like a problem related to uninitialized variables.
>
>
> You may also want to try running the program by using
> Valgrind. That's a very effective way of finding uninitilized
> variables.
>
>
>    Regards,
>
>
>      Luis
>
>
>
> ------------------------------------------------------------------
>
> On Fri, May 28, 2010 at 3:34 AM, Sergio Vera <sergio.vera at alma3d.com>wrote:
>
>> Hello
>>
>> May I suggest to enable all warnings when you compile the code?
>>
>> Often this problems are related to variables that are by default
>> initialized to some meaning value in debug builds, but that keep
>> uninitialized (so they have garbage values) in Release builds.
>>
>> Enabling all warings may let you see this kind of errors more easily
>>
>> Hope it helps
>> Sergio
>>
>>
>> On Thu, May 27, 2010 at 6:53 PM, Oscar Esteban Sanz-Dranguet <
>> oesteban at die.upm.es> wrote:
>>
>>> Hi,
>>>
>>> Based on Examples\Registration\ImageRegistrationHistogramPlotter.cxx, I'm
>>> trying to perform a registration between a T1 MRI slice and a 13,8 degrees
>>> rotated PET slice.
>>>
>>> I've configured every block, and I get a great result in Debug mode.
>>>
>>> When I try to use the same code, under the same conditions except build
>>> type (now, in Release mode), the registration doesn't work.
>>>
>>> On debug mode, the optimizer (RegularStepGradientDescentOptimizer) starts
>>> with a rotation of 0.175 rad. Next step, it tries with 0.350 rad and next
>>> step returns to ~0.19 rad. After 50 iterations, rotation is about 0,24 and
>>> result is great.
>>>
>>> On Release mode, it starts with a rotation of -0.175 rad, and every step
>>> it sums up another -0.175 rad. It stops when the maximum iterations number
>>> is reached.
>>>
>>> I can't find why this is happening, because all parameters are the same
>>> for the two experiments.
>>>
>>> Thank you very much in advanced,
>>>
>>> --
>>> Oscar Esteban
>>> BIT - UPM (http://www.die.upm.es/im/)
>>> +34 915 495700  ext.4248
>>>
>>> _____________________________________
>>> 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.html
>>>
>>> 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://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>> --
>> Sergio Vera
>>
>> Alma IT Systems
>> C/ Vilana, 4B, 4º 1ª
>> 08022 Barcelona
>> T. (+34) 932 380 592
>> www.alma3d.com
>>
>> _____________________________________
>> 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.html
>>
>> 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://www.itk.org/mailman/listinfo/insight-users
>>
>>
>


-- 
Sergio Vera

Alma IT Systems
C/ Vilana, 4B, 4º 1ª
08022 Barcelona
T. (+34) 932 380 592
www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100531/0bdfac3c/attachment.htm>


More information about the Insight-users mailing list