[Insight-users] runtime warnings when hooking up hessian filter to
eigenanalysis2d filter.
max power
zouookmoetenwerken at gmail.com
Thu Mar 15 05:52:01 EST 2007
Hello,
In my image processing pipeline, I have to generate the eigenvalues of the
hessian. I'm not a long-time ITK user, but I figured the combination of
Itk::HessianRecursiveGaussianFilter and an itk::EigenAnalysis2DImageFilter
were the best components to use. I've put an nth-component adapter
inbetween to select the right parts of the hessian matrix to feed to the
three inputs of the eigen analysis filter.
Everything compiles and runs well now, except for a few pesky warnings at
runtime:
WARNING: In
/usr/local/include/InsightToolkit/BasicFilters/itkEigenAnalysis2DImageFilter.txx,
line 133
ImageToImageFilter (0x689390):
EigenAnalysis2DImageFilter::GetMaxEigenVector(): dynamic_cast has failed. A
reinterpret_cast is being attempted.
Type name is: N3itk5ImageINS_6VectorIfLj2EEELj2EEE
Running this trough demangle with a _Z prepended showed that this was of
type
itk::Image<itk::Vector<float, 2u>, 2u>
I feel this has something to do with the floatvectorimage that the
eigenvalue filter is outputting perhaps, but I cannot find the cause of this
warning.
My current processing pipeline is as follows:
typedef float FloatPixelType;
typedef itk::Image<FloatPixelType, Dimension> FloatImageType;
typedef itk::HessianRecursiveGaussianImageFilter<
FloatImageType> HessianFilter;
typedef itk::Image<
itk::Vector< FloatPixelType, 2 >,
Dimension > FloatVectorImageType;
typedef itk::EigenAnalysis2DImageFilter<
FloatImageType,
FloatImageType,
FloatVectorImageType> EigenAnalysis2DImageFilterType;
// to make the output of the hessian filter readable by the
// eigenanalysis filter, we need to adapt the image
typedef itk::NthElementPixelAccessor<
FloatPixelType,
HessianFilter::OutputPixelType > OutputImageAdaptorType;
typedef itk::AdaptImageFilter<
HessianFilter::OutputImageType,
FloatImageType,
OutputImageAdaptorType > AdaptType;
// the hessian filter is hooked up to the original input filter
HessianFilter::Pointer hesFilter = HessianFilter::New();
hesFilter->SetInput( readCast->GetOutput() );
EigenAnalysis2DImageFilterType::Pointer eigFilter =
EigenAnalysis2DImageFilterType::New();
// make the three components of the hessian to the eigFilter
AdaptType::Pointer adapterE0 = AdaptType::New();
adapterE0->SetInput( hesFilter->GetOutput() );
adapterE0->GetAccessor().SetElementNumber( 0 );
AdaptType::Pointer adapterE1 = AdaptType::New();
adapterE1->SetInput( hesFilter->GetOutput() );
adapterE1->GetAccessor().SetElementNumber( 1 );
AdaptType::Pointer adapterE2 = AdaptType::New();
adapterE2->SetInput( hesFilter->GetOutput() );
adapterE2->GetAccessor().SetElementNumber( 2 );
// and hook up the adapted images to the eigen analysis filter.
eigFilter->SetInput1( adapterE0->GetOutput() );
eigFilter->SetInput2( adapterE1->GetOutput() );
eigFilter->SetInput3( adapterE2->GetOutput() );
And then the eigFilter's getOutput(0) and getOutput(1) are used in further
processing.
I hope someone can help to shed some light on these warnings.
Thanks,
Jorik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070315/91882fc5/attachment.html
More information about the Insight-users
mailing list