[Insight-users] segmentation fault with itkImageSeriesReader

Marius Staring marius at isi.uu.nl
Mon Feb 6 08:26:18 EST 2006


Hi all,

When doing a push_back on a FileNamesContainer defined in the 
itkImageSeriesReader (which is a vector<string>) my program gives a 
segmentation fault.

This fault is only generated on a 64 bit linux system with gcc 4.0.2. 
Under microsoft visual .net 2003 and with an older gcc version (3.2) 
this problem does not occur.

There must be some problem with the itkImageSeriesReader, because when I 
do not include it but the vector and string classes the problem does not 
occur.

I have constructed a minimal example to show the problem.

Regards,

-- 
Marius Staring
Image Sciences Institute
University Medical Centre Utrecht
Heidelberglaan 100, 3584 CX Utrecht, The Netherlands
phone: +31 (0)30 250 3186, fax: +31 (0)30 251 3399
marius at isi.uu.nl, http://www.isi.uu.nl/People/Marius

-------------- next part --------------
# This project is intended to be built outside the Insight source tree
PROJECT(minimalexample)

# Find ITK.
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)

ADD_EXECUTABLE(minimalexample minimalexample.cxx)

TARGET_LINK_LIBRARIES(minimalexample ITKIO ITKCommon)

INSTALL_TARGETS(/. minimalexample)

-------------- next part --------------

/** Include headers. */
#include "itkImageSeriesReader.h"

int main( int argc, char *argv[] )
{
	FileNamesContainer filenames;
	//std::vector< std::string > filenames;
	filenames.resize( 2 );
	filenames.push_back( "bla" );

	/** Return a value. */
	return 0;

} // end main




More information about the Insight-users mailing list