[Insight-users] DeformableSimplexMesh3DBalloonForceFilter
David Milford
nanotechc at gmail.com
Wed Apr 23 05:58:46 EDT 2008
Hello
I am having a problem when I use the
DeformableSimplexMesh3DBalloonForceFilter. I have a grey value 8 bit input
(called importfilter) and a binary image input (called importfilterbin). I
am visualising the output with Amira which has worked for other filters,
however, this filter is giving me the following error.
Debug Assertion Failed!
Expression: map/set iteratior not deferencable
I have given the code i use below.
Any help would be greatly appretiated.
Thanks
David
typedef unsigned char PixelType;
typedef itk::SimplexMesh<double> MeshType;
typedef itk::BinaryMask3DMeshSource<InputImageTypebin ,MeshType >
MeshSourceType;
typedef itk::CovariantVector< double, 3> GradientPixelType;
typedef itk::Image< GradientPixelType, 3 > GradientImageType;
typedef itk::GradientRecursiveGaussianImageFilter<InputImageType,
GradientImageType> GradientFilterType;
typedef
itk::GradientMagnitudeRecursiveGaussianImageFilter<InputImageType,GradientIm
ageType> GradientMagnitudeFilterType;
typedef itk::Image<unsigned char, 3> ImageType;
typedef itk::DeformableSimplexMesh3DBalloonForceFilter<MeshType,MeshType>
DeformableFilterType;
GradientMagnitudeFilterType::Pointer gradientMagnitudeFilter =
GradientMagnitudeFilterType::New();
gradientMagnitudeFilter->SetInput(importFilter->GetOutput());
gradientMagnitudeFilter->SetSigma( 1.0 );
gradientMagnitudeFilter->Update();
GradientFilterType::Pointer gradientMapFilter = GradientFilterType::New();
gradientMapFilter->SetInput(gradientMagnitudeFilter->GetOutput());
gradientMapFilter->SetSigma( 1.0 );
gradientMapFilter->Update();
MeshSourceType::Pointer meshSource = MeshSourceType::New();
meshSource->SetInput(importFilterbin->GetOutput() );
meshSource->SetObjectValue(ObjectValue.getValue());
meshSource->Update();
DeformableFilterType::Pointer deformableModelFilter =
DeformableFilterType::New();
deformableModelFilter->SetGradient(gradientMapFilter->GetOutput() );
deformableModelFilter->SetInput(meshSource->GetOutput());
deformableModelFilter->SetAlpha(0.2);
deformableModelFilter->SetBeta(0.5);
deformableModelFilter->SetRigidity(1);
deformableModelFilter->SetGamma(0.03);
deformableModelFilter->SetIterations(1);
deformableModelFilter->SetKappa(1);
deformableModelFilter->Update();
typedef itk::PointSetToImageFilter<MeshType,ImageType> MeshFilterType;
MeshFilterType::Pointer meshFilter = MeshFilterType::New();
meshFilter->SetOrigin(importFilterbin->GetOrigin());
meshFilter->SetSize(importFilterbin->GetRegion().GetSize());
meshFilter->SetSpacing(importFilterbin->GetSpacing());
meshFilter->SetInput(meshSource->GetOutput());
meshFilter->Update();
InputImageTypebin::Pointer outputImage1;
outputImage1= meshFilter->GetOutput();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080423/746b2d55/attachment.htm>
More information about the Insight-users
mailing list