[Insight-developers] compilation error of using DiscreteGaussianImageFilter with vector images

gang song songgang97 at gmail.com
Thu Nov 18 19:48:25 EST 2010


This is very helpful. Thanks!

On Thu, Nov 18, 2010 at 3:16 AM, Tom Vercauteren <tom.vercauteren at m4x.org>wrote:

> Hi Gang Song,
>
> This is definitely a bug. Could you file a bug report? Submitting a
> patch to gerrit would be even better.
>
> A quick and dirty test shows that replacing
>  // This filter can only operate on data types that are signed.
>  if ( !NumericTraits< OutputPixelType >::is_signed )
> by
>  // This filter can only operate on data types that are signed.
>  if ( !NumericTraits< typename NumericTraits< OutputPixelType
> >::ValueType >::is_signed )
> in itkNeighborhoodOperatorImageFilter.txx and replacing
>  itkConceptMacro( OutputHasNumericTraitsCheck,
>                   ( Concept::HasNumericTraits< OutputPixelType > ) );
> by
>  itkConceptMacro( OutputHasNumericTraitsCheck,
>                   ( Concept::HasNumericTraits< typename
> NumericTraits< OutputPixelType >::ValueType > ) );
> seems to work ok.
>
> A more elegant patch should thus be relatively easy to make by
> changing at the right places
>  OutputPixelType
> by
>  OutputPixelValueType
> where you have
>  typedef typename NumericTraits< OutputPixelType >::ValueType
> OutputPixelValueType;
>
> You may want to look at itk::RecursiveSeparableImageFilter and
> itk::RecursiveGaussianImageFilter that already support vector images.
>
> As a side note, it seems strange that Concept::HasNumericTraits<
> itk::Vector<float,2> > chokes at compile time. Indeed itk::Vector have
> numeric traits (look at itkNumericTraitsVectorPixel.h ) but the
> concept check requires more functions to be defined (e.g. IsPositive).
> I'll file a bug report about this particular point.
>
> Tom
>
> On Wed, Nov 17, 2010 at 22:58, gang song <songgang97 at gmail.com> wrote:
> > Hi,
> > I tried to use DiscreteGaussianImageFilter to smooth a vector image and
> got
> > compilation error like:
> >
> /ITK/InsightToolkit-3.20.0/Code/BasicFilters/itkNeighborhoodOperatorImageFilter.txx:95:
> > error: ‘is_signed’ is not a member of
> ‘itk::NumericTraits<itk::Vector<float,
> > 3u> >’
> > NeighborhoodOperatorImageFilter is used in
> > template< class TInputImage, class TOutputImage >
> > void DiscreteGaussianImageFilter<TInputImage,
> TOutputImage>::GenerateData()
> > {}
> > Any suggestions about how to deal with this? This seems a general problem
> > for vector image types with NeighborhoodOperatorImageFilter.
> >
> > Thanks
> > -Gang
> >
> >
> >
> > _______________________________________________
> > 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.html
> >
> > 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101118/22306a33/attachment.htm>


More information about the Insight-developers mailing list