[Insight-developers] AnisotropicDiffusionImageFilter derived class Error

Antonio Calabrese calantoanto at gmail.com
Fri Aug 30 07:05:14 EDT 2013


Hi to everyone
it's my first time that i write on this mailing list. I'm a Italian Biomedical Engineer's student and i'm working on my final degree thesis.
I'm implementing an Anisotropic Filter that i wrote few months ago in Matlab.
This filter is different from the other ITK's filters, because i try to create an "automatic anisotropic filter" in which i don't need to set conductance and number of iteration parameters, because the filter calculates them alone.
Here below there's a part of my code where i tried to implementing the ITK's AnisotropicDiffusionImageFilter. 

This's the class's derivation :
namespace itk
{
    template< class TInputImage, class TIOutputImage>
    class ITK_EXPORT MyAnisotropicDiffusionImageFilter:
    public AnisotropicDiffusionImageFilter<TInputImage, TIOutputImage>
    {
    public:
        /** Standard class typedefs. */
        typedef MyAnisotropicDiffusionImageFilter Self;
        typedef AnisotropicDiffusionImageFilter<TInputImage, TIOutputImage> Superclass;
        typedef SmartPointer< Self >       Pointer;
        typedef SmartPointer< const Self > ConstPointer;
        
        /** Standard method for creation through object factory. */
        itkNewMacro(Self);
        
        /** Extract superclass image dimension. */
        itkStaticConstMacro(ImageDimension, unsigned int,
                            Superclass::ImageDimension);
        
#ifdef ITK_USE_CONCEPT_CHECKING
        /** Begin concept checking */
        itkConceptMacro( OutputHasNumericTraitsCheck,
                        ( Concept::HasNumericTraits< typename TInputImage::PixelType > ) );
        /** End concept checking */
#endif
        
    }; // end namspace itk
}

and this is its implementation

typedef itk::MyAnisotropicDiffusionImageFilter <FloatImageType, FloatImageType> MyAnisotropicDiffusionImageFilterType;
MyAnisotropicDiffusionImageFilterType::Pointer myAnisotropicDiffusionFilterPointer = MyAnisotropicDiffusionImageFilterType::New();
myAnisotropicDiffusionFilterPointer->SetInput(workImagePointer);
myAnisotropicDiffusionFilterPointer->SetConductanceParameter(C);
myAnisotropicDiffusionFilterPointer->SetTimeStep(Time_step);
myAnisotropicDiffusionFilterPointer->SetNumberOfIterations(1);
myAnisotropicDiffusionFilterPointer->Update();

For the first time i subclassed it, and i don't have the experience to understand which is the wrong thing that return me an error.

My filter crashes in an inheritance of the itkFiniteDifferenceImageFilter where it dies when it reaches this point:
// Get the size of the neighborhood on which we are going to operate.  This
// radius is supplied by the difference function we are using.
RadiusType radius = this->GetDifferenceFunction()->GetRadius();

So, which is my error? Please someone give me a help. 
Regards Antonio Calabrese.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130830/3b8f8a6f/attachment-0001.htm>


More information about the Insight-developers mailing list