View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010205ITKpublic2010-01-29 16:422010-10-21 12:31
ReporterHans Johnson 
Assigned ToLuis Ibanez 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionITK-3-16 
Target VersionFixed in Version 
Summary0010205: Recent changes to itkBayesianClassifierImageFilter.txx cause WrapITK failures
DescriptionKarthik,

Your recent changes to itkBayesianClassifierImageFilter.h have exposed a template dependancy that was causing compile time failures when using WrapIT
K. I've posted the compiler errors below, and committed code in the testing directory that can be used to force the compile time error.

It looks like a type mis-match when floating point types are used.

I can make this fail in the itkBayesianClassifierImageFilterTest.cxx

#if 1
    {
    const unsigned int TestDimension = 2;
    typedef unsigned char TestLabelType;
    typedef float TestPosteriorType;
    
    //This is a failing test case!!!
    typedef float TestPriorType;·
    typedef itk::VectorImage< double ,TestDimension > TestInitialLabelImageType; //The element type MUST be the PriorType
    
    typedef itk::BayesianClassifierImageFilter<
      TestInitialLabelImageType, TestLabelType, TestPosteriorType, TestPriorType > TestClassifierFilterType;
    TestClassifierFilterType::Pointer test=TestClassifierFilterType::New();
    }
#endif


Hans
Additional Information
/Users/hjohnson/src/BRAINS-COMPILE/Darwin/FAST_64-lib/Insight/Code/Algorithms/itkBayesianClassifierImageFilter.txx: In member function ‘void itk::Bay
esianClassifierImageFilter<TInputVectorImage, TLabelsType, TPosteriorsPrecisionType, TPriorsPrecisionType>::SetPriors(const itk::VectorImage<TPriorsP
recisionType, itk::BayesianClassifierImageFilter<TInputVectorImage,TLabelsType,TPosteriorsPrecisionType,TPriorsPrecisionType>::Dimension>*) [with TIn
putVectorImage = itk::VectorImage<double, 2u>, TLabelsType = unsigned char, TPosteriorsPrecisionType = float, TPriorsPrecisionType = float]’:
/Users/hjohnson/src/BRAINS-COMPILE/Darwin/FAST_64-lib/Insight/Testing/Code/Algorithms/itkBayesianClassifierImageFilterTest.cxx:218: instantiated fr
om here
/Users/hjohnson/src/BRAINS-COMPILE/Darwin/FAST_64-lib/Insight/Code/Algorithms/itkBayesianClassifierImageFilter.txx:264: error: no matching function f
or call to ‘itk::BayesianClassifierImageFilter<itk::VectorImage<double, 2u>, unsigned char, float, float>::SetInput(int, const itk::VectorImage<float
, 2u>*&)’
/Users/hjohnson/src/BRAINS-COMPILE/Darwin/FAST_64-lib/Insight/Code/Common/itkImageToImageFilter.txx:55: note: candidates are: void itk::ImageToImageF
ilter<TInputImage, TOutputImage>::SetInput(const TInputImage*) [with TInputImage = itk::VectorImage<double, 2u>, TOutputImage = itk::Image<unsigned c
har, 2u>]
/Users/hjohnson/src/BRAINS-COMPILE/Darwin/FAST_64-lib/Insight/Code/Common/itkImageToImageFilter.txx:69: note: void itk::ImageToImageF
ilter<TInputImage, TOutputImage>::SetInput(unsigned int, const TInputImage*) [with TInputImage = itk::VectorImage<double, 2u>, TOutputImage = itk::Im
age<unsigned char, 2u>]
make[2]: *** [Testing/Code/Algorithms/CMakeFiles/itkAlgorithmsTests4.dir/itkBayesianClassifierImageFilterTest.o] Error 1
make[1]: *** [Testing/Code/Algorithms/CMakeFiles/itkAlgorithmsTests4.dir/all] Error 2
make: *** [all] Error 2
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Files

 Relationships

  Notes
(0019370)
Luis Ibanez (manager)
2010-01-30 16:08

A fix has been committed:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkBayesianClassifierImageFilter.txx?root=Insight&r1=1.11&r2=1.12&sortby=date [^]

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkBayesianClassifierImageFilter.h?root=Insight&r1=1.16&r2=1.17&sortby=date [^]

Two errors were fixed:

A) SetPriors() should take a const pointer as argument.

B) instead of calling the SetInput(n, image *) method of ImageToImageFilter,
   the .txx file should call the SetNthInput method of the ProcessObject,
   because the Priors are not necessarily of the same type as the input image.
(0019371)
Luis Ibanez (manager)
2010-01-30 16:09

The test case that was failing, has been enabled, and it is compiling now.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/Algorithms/itkBayesianClassifierImageFilterTest.cxx?root=Insight&r1=1.9&r2=1.10&sortby=date [^]

 Issue History
Date Modified Username Field Change
2010-01-29 16:42 Hans Johnson New Issue
2010-01-29 16:42 Hans Johnson Status new => assigned
2010-01-29 16:42 Hans Johnson Assigned To => Karthik Krishnan
2010-01-30 16:02 Luis Ibanez Assigned To Karthik Krishnan => Luis Ibanez
2010-01-30 16:08 Luis Ibanez Note Added: 0019370
2010-01-30 16:09 Luis Ibanez Note Added: 0019371
2010-01-30 16:09 Luis Ibanez Status assigned => resolved
2010-01-30 16:09 Luis Ibanez Resolution open => fixed
2010-10-21 12:31 Gabe Hart Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team