[Insight-users] slicebysliceimagefilter crashes
Zoltan Seress
seress.zoltan at gmail.com
Thu Jul 7 09:40:05 EDT 2011
Dear members,
My purpose is to search connected components on single slices of a 3d volume
(then compare the results), therefore I thought SliceBySliceImageFilter
would be a good choice to do this. I have 14 binary volumes, but by the half
of the images my program crashes with glibc errors.
My source is the following:
// I have a reader to read the input
typedef itk::ConnectedComponentImageFilter<ShortImageType, ShortImageType,
ShortImageType> ComponentFilterType;
ComponentFilterType::Pointer conn = ComponentFilterType::New();
conn->SetInput( reader->GetOutput() );
typedef itk::RelabelComponentImageFilter<ShortImageType, ShortImageType>
RelabelFilterType;
RelabelFilterType::Pointer relabel = RelabelFilterType::New();
relabel->SetInput( conn->GetOutput() );
for ( int i = 0; i <=2; ++i ) {
std::cerr << i;
typedef itk::SliceBySliceImageFilter<ShortImageType, ShortImageType,
ComponentFilterType, RelabelFilterType, ShortImageType, ShortImageType>
SliceFilterType;
SliceFilterType::Pointer slicer = SliceFilterType::New();
slicer->SetInput( reader->GetOutput() );
slicer->SetInputFilter( conn );
slicer->SetOutputFilter( relabel );
slicer->SetDimension( i );
slicer->Update();
std::cerr << " done." << std::endl;
} // endfor
return EXIT_SUCCESS;
---------------
The output is:
0 done.
1 done.
2 done.
*** glibc detected *** ./SliceImageFilterTest: free(): invalid pointer:
0x00007f7b5684f010 ***
...
...
What could be the reason for this?
I have run these tests in an other test program, there were problems too,
not free() related, but: munmap_chunk(): invalid pointer.
And one case was: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned
long)(nb)' failed
If i remove line "slicer->SetDimension( i );" everything is OK, but in this
case I get three (the same) 3D connected component labelmap. That is not I
want of course.
I use ITK 3.20 and glibc 2.11.1 and the input binary images are all valid
ones. Any hints?
Cheers,
--
Zoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110707/ed26b657/attachment.htm>
More information about the Insight-users
mailing list