[Insight-users] Bug reporting for basic filter implementation

Quan Chen quanchen at gmail.com
Fri Oct 8 17:59:50 EDT 2004


Well, I am not sure if it can be termed as a bug or just inconsistency in
programming.  However, I tryed CannyEdgeDetectionImageFilter, In the
itkCannyEdgeDetectionImageFilter.h, there are several function definitions:
 
  /** Standard get/set macros for filter parameters. */
  itkSetMacro(Variance, ArrayType);
  itkGetMacro(Variance, const ArrayType);
  itkSetMacro(MaximumError, ArrayType);
  itkGetMacro(MaximumError, const ArrayType);
  
  /** Set/Get the Variance parameter used by the Gaussian smoothing
      filter in this algorithm */
  void SetVariance(const typename ArrayType::ValueType v)
  {
    m_Variance.Fill(v);
  }
  
  /** Set/Get the MaximumError paramter used by the Gaussian smoothing
filter
      in this algorithm */
  void SetMaximumError(const typename ArrayType::ValueType v)
  {
    m_MaximumError.Fill(v);
  }
 
However, shouldn't there be a 
this->Modified(); 
in each functions?  I know several other filter functions are implemented
that way, e.g. itkGradientMagnitudeRecursiveGaussianImageFilter.  As far as
I understand, the itk use those pipe line structures, so if you changed on
components in the pipe line, you should inform those behind you.
Also, there are lines like this
 itkSetMacro(Threshold, OutputImagePixelType );
  itkGetMacro(Threshold, OutputImagePixelType);
  itkSetMacro(OutsideValue, OutputImagePixelType);
  itkGetMacro(OutsideValue, OutputImagePixelType);
I believe we should expand those and add that modified() call too.
 
I didn't check other filters, my guess is there will be other filters
implemented that miss this line.
 
I found this problem when I modify the application example
"GeodesicActiveContour".  I replace the gradient filter with the Canny
filter.  However, I noticed that when I change the sigma value (which I
modified to reflect variance in cannyfilter), I find that the program
doesn't react to this change and even if I click the button trying to ask
the program to recalculate, it fail to do anything.
 
BTW, the version I am using is the 1.8.0 version, which I believe is the
up-to-date one.


More information about the Insight-users mailing list