[Insight-users] Multiresolution ITK Guide example fails on VS2005
- fixed
Karthik Krishnan
Karthik.Krishnan at kitware.com
Thu Dec 22 14:15:58 EST 2005
Thanks for the bug report. Its been fixed. Please update your repository
orthe file below.
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Algorithms/itkMultiResolutionImageRegistrationMethod.txx?root=Insight&r1=text&tr1=1.12&r2=text&tr2=1.11&diff_format=h
VS8 is stricter ( and more correct ) in catching bugs with std::vector
vector::reserve(n) does not change the size of the vector. It only a
request for allocation of additional memory. vector::size() is unchanged
by reserve(). (from http://www.sgi.com/tech/stl/Vector.html)
Earlier VS8 caught a few other bugs by checking if an iterator is
dereferencible prior to derefencing it.
(http://www.itk.org/Bug/bug.php?op=show&bugid=2485)
Thanks
-karthik
Axel Martinez Möller wrote:
> Hi Luis,
>
> I am running the program in Debug mode (ITK is also built in Debug mode),
>and the wrong line is the line:
>
>registration->StartRegistration(); (line 492)
>
> As I said in the first mail, while debugging I "stepped into" until I
>localized the problem at line 208 from
>itkMultiResolutionImageRegistrationMethod.txx:
>
>m_FixedImageRegionPyramid[ level ].SetSize( size );
>
> This causes an error in the "vector" class from C++, line 753 and
>consecutive:
>
> #if _HAS_ITERATOR_DEBUGGING
> if (size() <= _Pos)
> {
> _DEBUG_ERROR("vector subscript out of range");
> _SCL_SECURE_OUT_OF_RANGE;
> }
>
> Which explains the "Expression: vector subscript out of range" error I
>referenced in the first mail.
>
> That's all the information I managed to extract, I hope it helps. I do not
>see a logical explanation if it works for you since I made no changes to the
>code... I have ITK release 2.4.1, working under VS2005. If you have any
>other suggestion, I will be happy to try it.
>
> Thanks again for the help,
>
> axel
>
>
>-----Original Message-----
>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>Sent: Thursday, December 22, 2005 16:04
>To: Axel Martinez Möller
>Cc: 'Insight Users'
>Subject: Re: [Insight-users] Multiresolution ITK Guide example fails on
>VS2005
>
>
>Hi Axel,
>
>Thanks for your clarification.
>
>The program runs fine for me when I pass three
>arguments.
>
>Something else should be going wrong then...
>
>
>
>Could you please run this program in Debug mode
>and let us know in what line it is crashing ?
>
>
> Thanks
>
>
>
> Luis
>
>
>
>
>---------------------------
>Axel Martinez Möller wrote:
>
>
>> Hi Luis,
>>
>> I am using three arguments for the execution, this is the command line I
>>use:
>>
>>register
>>
>>
>>
>F:\ITK\InsightToolkit-2.4.1\Examples\Data\BrainProtonDensitySliceBorder20.pn
>
>
>>g
>>
>>
>>
>F:\ITK\InsightToolkit-2.4.1\Examples\Data\BrainProtonDensitySliceR10X13Y17.p
>
>
>>ng C:\axel\registertest\removeme.mhd
>>
>> "register" is the name I use for the file, but it has similar contents as
>>MultiResImageRegistration1.
>>
>> Do you know if anything else could explain the problem?
>>
>> Thanks,
>>
>> axel
>>
>>-----Original Message-----
>>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>Sent: Thursday, December 22, 2005 14:43
>>To: Axel Martinez Möller
>>Cc: 'Insight Users'
>>Subject: Re: [Insight-users] Multiresolution ITK Guide example fails on
>>VS2005
>>
>>
>>
>>Hi Axel,
>>
>>Thanks for pointing this out.
>>
>>The example that you are using requires three arguments
>>in the command line.
>>
>>You are probably setting only two, and due to a bug in
>>the example, the program is attempting to use the third
>>argument, and crashes in the process.
>>
>>
>> We just committed a fix in the CVS repository.
>>
>>
>>Please run the program as:
>>
>>
>>MultiResImageRegistration1 fixedImage movingImage outputImage
>>
>>
>>you can also add a forth and fifth arguments in order to
>>get the checkerboard combination of the fixed and moving
>>images before and after the registration.
>>
>>
>>Thanks
>>
>>
>> Luis
>>
>>
>>
>>---------------------------
>>Axel Martinez Möller wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>I was wanting to try the MultiResImageRegistration1 example. It compiled
>>>fine with VS2005, but when I executed it using the images indicated in the
>>>example, it crashed with the error:
>>>
>>>---
>>>Debug Assertion Failed!
>>>Program: F:\ITK\Register\Debug\Register.exe
>>>File: C:\Program Files\Microsoft Visual Studio 8\VC\include\vector
>>>Line: 756
>>>
>>>Expression: vector subscript out of range
>>>---
>>>
>>>I do not attach the code as it is EXACTLY the one from the example. I am
>>>running it in Debug mode (the same way I compiled ITK), and other examples
>>>worked fine.
>>>
>>>Debugging, I localized the problem at line 208 from
>>>itkMultiResolutionImageRegistrationMethod.txx:
>>> m_FixedImageRegionPyramid[ level ].SetSize( size );
>>>
>>>Thank you in advance for any hint,
>>>
>>> axel
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>
More information about the Insight-users
mailing list