Hello,<br><br>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.
<br><br>Everything compiles and runs well now, except for a few pesky warnings at runtime:<br><br>WARNING: In /usr/local/include/InsightToolkit/BasicFilters/itkEigenAnalysis2DImageFilter.txx, line 133<br>ImageToImageFilter (0x689390): EigenAnalysis2DImageFilter::GetMaxEigenVector(): dynamic_cast has failed. A reinterpret_cast is being attempted.
<br>Type name is: N3itk5ImageINS_6VectorIfLj2EEELj2EEE<br><br>Running this trough demangle with a _Z prepended showed that this was of type<br>itk::Image<itk::Vector<float, 2u>, 2u><br><br>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.
<br><br><br>My current processing pipeline is as follows:<br><br><br> typedef float FloatPixelType; <br><br> typedef itk::Image<FloatPixelType, Dimension> FloatImageType;<br><br> typedef itk::HessianRecursiveGaussianImageFilter<
<br> FloatImageType> HessianFilter;<br><br> typedef itk::Image<<br> itk::Vector< FloatPixelType, 2 >, <br> Dimension > FloatVectorImageType;<br><br> typedef itk::EigenAnalysis2DImageFilter<
<br> FloatImageType, <br> FloatImageType, <br> FloatVectorImageType> EigenAnalysis2DImageFilterType;<br><br> // to make the output of the hessian filter readable by the<br> // eigenanalysis filter, we need to adapt the image
<br> typedef itk::NthElementPixelAccessor< <br> FloatPixelType,<br> HessianFilter::OutputPixelType > OutputImageAdaptorType;<br><br> typedef itk::AdaptImageFilter< <br> HessianFilter::OutputImageType,
<br> FloatImageType, <br> OutputImageAdaptorType > AdaptType;<br><br><br> // the hessian filter is hooked up to the original input filter<br> HessianFilter::Pointer hesFilter = HessianFilter::New();<br> hesFilter->SetInput( readCast->GetOutput() );
<br><br> EigenAnalysis2DImageFilterType::Pointer eigFilter = EigenAnalysis2DImageFilterType::New();<br><br> // make the three components of the hessian to the eigFilter<br> AdaptType::Pointer adapterE0 = AdaptType::New();
<br> adapterE0->SetInput( hesFilter->GetOutput() );<br> adapterE0->GetAccessor().SetElementNumber( 0 );<br><br> AdaptType::Pointer adapterE1 = AdaptType::New();<br> adapterE1->SetInput( hesFilter->GetOutput() );
<br> adapterE1->GetAccessor().SetElementNumber( 1 );<br><br> AdaptType::Pointer adapterE2 = AdaptType::New();<br> adapterE2->SetInput( hesFilter->GetOutput() );<br> adapterE2->GetAccessor().SetElementNumber( 2 );
<br><br> // and hook up the adapted images to the eigen analysis filter.<br> eigFilter->SetInput1( adapterE0->GetOutput() );<br> eigFilter->SetInput2( adapterE1->GetOutput() );<br> eigFilter->SetInput3( adapterE2->GetOutput() );
<br><br><br>And then the eigFilter's getOutput(0) and getOutput(1) are used in further processing.<br><br>I hope someone can help to shed some light on these warnings.<br><br>Thanks,<br>Jorik<br><br><br>