[Insight-users] problems about DanielssonDistanceMapImageFilter
liu jianfei
flair.liu at gmail.com
Thu Jan 5 18:47:24 EST 2006
Hi, everyone
Recently, I used DanielssonDistanceMapImageFilter to implement
distance transform. It works fine for most of my datasets. However,
something is wrong in a large binary medical data set with the
dimension of 540*470*461. Then I allocated a same dimension image data
and assigned the value of some object voxels in different places at
random. However, It crashed again. I also tried the the dimension of
the synthetic data with 500*400*400, but I faced the same problem. It
still didn't work until the deminsion is changed to 400*400*400.
Following is the gdb results:
#0 0xffffe002 in ?? ()
#1 0x424d2a73 in abort () from /lib/tls/libc.so.6
#2 0x4247ab57 in __cxa_call_unexpected () from /usr/lib/libstdc++.so.5
#3 0x4247aba4 in std::terminate() () from /usr/lib/libstdc++.so.5
#4 0x4247ad16 in __cxa_throw () from /usr/lib/libstdc++.so.5
#5 0x401717bf in itk::ProcessObject::UpdateOutputData(itk::DataObject*) ()
from /home/krs/src/InsightToolkit-2.2.0/ITKb/bin/libITKCommon.so
#6 0x40140cc5 in itk::DataObject::UpdateOutputData() ()
from /home/krs/src/InsightToolkit-2.2.0/ITKb/bin/libITKCommon.so
#7 0x40140844 in itk::DataObject::Update() ()
from /home/krs/src/InsightToolkit-2.2.0/ITKb/bin/libITKCommon.so
#8 0x40170ad2 in itk::ProcessObject::Update() ()
from /home/krs/src/InsightToolkit-2.2.0/ITKb/bin/libITKCommon.so
Initially, I think it should be the memory allocation problem. But I
checked the size of the current used memory. There are still a lot of
free space. Can someone tell me what's the problem with distance
transfrom?
typedef itk::DanielssonDistanceMapImageFilter< VolumeType,
VolumeMapType > DistFilterType;
typedef itk::GradientMagnitudeImageFilter< VolumeType, VolumeType
> GradMagnFilterType;
typedef itk::ThresholdImageFilter< VolumeType > ThreshFilterType;
GradMagnFilterType::Pointer gradMagn = GradMagnFilterType::New();
DistFilterType::Pointer dist = DistFilterType::New();
ThreshFilterType::Pointer thresh = ThreshFilterType::New();
gradMagn->SetInput(rskvVolume);
thresh->SetInput(gradMagn->GetOutput());
thresh->ThresholdAbove( 0 );
thresh->SetOutsideValue(255);
//thresh->Update();
//cout << "thresh filter pass!" << endl;
dist->SetInput(thresh->GetOutput());
dist->InputIsBinaryOn();
dist->Update();
rskvVolumeMap = dist->GetOutput();
Here are my codes. the ThresholdImageFilter and
GradientMagnitudeImageFilter works fine for any dimension of
datasets...
More information about the Insight-users
mailing list