[Insight-developers] AnisotropicDiffusionImageFilter derived class Error

Matt McCormick matt.mccormick at kitware.com
Fri Aug 30 09:56:10 EDT 2013


Hi Antonio,

Welcome to the list :-).

Please include a full example with code, CMakeLists.txt, and a short test.

Thanks,
Matt

On Fri, Aug 30, 2013 at 11:05 AM, Antonio Calabrese
<calantoanto at gmail.com> wrote:
> 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.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list