]> Creatis software - cpPlugins.git/blob - plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx
More bugs smashed
[cpPlugins.git] / plugins / cpPluginsImageFilters / ImageToHistogramFilter.cxx
1 #include <cpPluginsImageFilters/ImageToHistogramFilter.h>
2 #include <cpPlugins/Image.h>
3 #include <cpPlugins_ITKInstances/ImageFilters.h>
4
5 #include <itkImageToHistogramFilter.h>
6 #include <itkImageToHistogramFilter.hxx>
7 /*
8   #include <itkImageToImageFilter.hxx>
9   #include <itkInPlaceImageFilter.hxx>
10   #include <itkUnaryFunctorImageFilter.hxx>
11 */
12
13 // -------------------------------------------------------------------------
14 cpPluginsImageFilters::ImageToHistogramFilter::
15 ImageToHistogramFilter( )
16   : Superclass( )
17 {
18   this->_AddInput( "Input" );
19   this->_AddOutput< cpPlugins::DataObject >( "Output" );
20 }
21
22 // -------------------------------------------------------------------------
23 cpPluginsImageFilters::ImageToHistogramFilter::
24 ~ImageToHistogramFilter( )
25 {
26 }
27
28 // -------------------------------------------------------------------------
29 std::string cpPluginsImageFilters::ImageToHistogramFilter::
30 _GenerateData( )
31 {
32   auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
33   std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 );
34   if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
35   if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
36   if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 );
37   return( r );
38 }
39
40 // -------------------------------------------------------------------------
41 template< class _TImage >
42 std::string cpPluginsImageFilters::ImageToHistogramFilter::
43 _GD0( _TImage* image )
44 {
45   typedef itk::Statistics::ImageToHistogramFilter< _TImage > _F;
46   /*
47     typedef typename _TImage::PixelType _TP;
48     typedef typename _TBinaryImage::PixelType _UP;
49
50     // Get parameters
51     _TP lower_val = _TP( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
52     _TP upper_val = _TP( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
53     _UP in_val    = _UP( this->m_Parameters.GetUint( "InsideValue" ) );
54     _UP out_val   = _UP( this->m_Parameters.GetUint( "OutsideValue" ) );
55   */
56
57   // Configure filter
58   _F* filter = this->_CreateITK< _F >( );
59   /*
60     filter->SetInput( image );
61     filter->SetLowerThreshold( lower_val );
62     filter->SetUpperThreshold( upper_val );
63     filter->SetInsideValue( in_val );
64     filter->SetOutsideValue( out_val );
65     filter->Update( );
66
67     // Connect output
68     this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
69   */
70   return( "ImageToHistogramFilter: not ready yet." );
71 }
72
73 // eof - $RCSfile$