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