[Insight-users] Re: DeformableRegistration8.cxx std::bad_alloc

Ruben Schilling r.b.schilling at googlemail.com
Sat Mar 17 19:10:03 EST 2007


Hi again,

In the meanwhile I have located the LOC, where the program aborts, it  
is the "registration->StartRegistration()" call in this try block:


std::cout << std::endl << "Starting Registration" << std::endl;

try
     {
     collector.Start( "Registration" );
     registration->StartRegistration();
     collector.Stop( "Registration" );
     }



Does anyone have suggestions why this could be a reason to throw a  
std::bad_alloc exception? Could there be a problem with some  
dynamically loaded ITK function? What would I need to do then? My  
CMakeLists.txt looks like this (setting the variables was necessary  
to compile and link everything):



PROJECT(DeformRegister8)
#set paths to find ITK
SET(ITK_DIR /project/algorithmics/ruben/bin-x86_64/lib/InsightToolkit)
SET(ITK_SOURCE_DIR /project/algorithmics/ruben/bin/ 
InsightToolkit-3.0.0/x86_64)
SET (CMAKE_INSTALL_PREFIX /project/algorithmics/ruben/bin-x86_64)

FIND_PACKAGE(ITK)
IF(ITK_FOUND)
   INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
   MESSAGE(FATAL_ERROR "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)

LINK_LIBRARIES (
ITKNumerics ITKFEM ITKIO ITKStatistics
)

ADD_EXECUTABLE(DeformableRegistration8 DeformableRegistration8.cxx )
INSTALL_TARGETS(/bin DeformableRegistration8)





Am 17.03.2007 um 19:52 schrieb Ruben Schilling:

> Hi,
>
> I am using the DeformableRegistration8.cxx example to test  
> registration on image volumes using Mutual Information. I have a  
> problem though:
>
> The program crashes with this error message
> >>>>>>>>>>
> Starting Registration
> terminate called after throwing an instance of 'std::bad_alloc'
>   what():  St9bad_alloc
> Aborted
> <<<<<<<<<<
>
> From the message I can see, that the application ran acutually at  
> least until line 359 in the Code of DeformableRegistration8.cxx
>
> The volumes, that I try to register are large: 8bit grayscale, but  
> about 400x500x300 pixels in Volume each. They are stored as Tif  
> stacks. I am aware, that this requires a lot of memory, but I have  
> compiled the DeformableRegistration8.cxx and all of ITK etc. as  
> 64bit (see output of 'file' command)
>
> ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/ 
> Linux 2.6.0, dynamically linked (uses shared libs), not stripped
>
> The Linux computer I use has 64 Gigabyte of RAM (and I am currently  
> the only user on it), thus I can't believe I would not have enough  
> memory at all. So what's the matter with DeformableRegistration8.cxx?
>
> Can anybody help? Any suggestions? Does the implementation of  
> MutualInformation have numerical problems? Actually from the error  
> message I would have assumed, that it is an error related to the  
> 'new' operator. Looking with top at the memory usage using a fast  
> update, I had seen, that the registration just crashed after  
> assigning about 300-400 MByte of memory.
>
> I would be grateful (and curious about the solution) for any help  
> on this matter, since I really need deformable multi-modal  
> registration on this data.
>
> Ruben



More information about the Insight-users mailing list