]> Creatis software - cpPlugins.git/blob - plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx
cd16ed3a243ce3e6de71ef48346598eb1d006f0e
[cpPlugins.git] / plugins / ImageThresholdFilters / UnaryThresholdImageFilter.cxx
1 #include <ImageThresholdFilters/UnaryThresholdImageFilter.h>
2 #include <cpPlugins/DataObjects/Image.h>
3
4 #include <cpExtensions/Algorithms/UnaryThresholdImageFilter.h>
5
6 // -------------------------------------------------------------------------
7 cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
8 UnaryThresholdImageFilter( )
9   : Superclass( )
10 {
11   typedef cpPlugins::DataObjects::Image _TImage;
12   this->_ConfigureInput< _TImage >( "Input", true, false );
13   this->_ConfigureOutput< _TImage >( "Output" );
14
15   this->m_Parameters.ConfigureAsReal( "Threshold" );
16   this->m_Parameters.ConfigureAsReal( "InsideValue" );
17   this->m_Parameters.ConfigureAsReal( "OutsideValue" );
18   this->m_Parameters.ConfigureAsBool( "Strict" );
19
20   this->m_Parameters.SetReal( "Threshold", 0 );
21   this->m_Parameters.SetReal( "InsideValue", 1 );
22   this->m_Parameters.SetReal( "OutsideValue", 0 );
23   this->m_Parameters.SetBool( "Strict", false );
24 }
25
26 // -------------------------------------------------------------------------
27 cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
28 ~UnaryThresholdImageFilter( )
29 {
30 }
31
32 // -------------------------------------------------------------------------
33 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
34 _GenerateData( )
35 {
36   /* TODO
37      auto o = this->GetInputData( "Input" );
38      cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
39      else this->_Error( "Invalid input image." );
40   */
41 }
42
43 // -------------------------------------------------------------------------
44 template< class _TImage >
45 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
46 _GD0( _TImage* image )
47 {
48   /* TODO
49      typedef
50      cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage >
51      _TFilter;
52
53      // Configure filter
54      _TFilter* filter = this->_CreateITK< _TFilter >( );
55      filter->SetInput( image );
56      filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) );
57      filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) );
58      filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) );
59      filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) );
60      filter->Update( );
61
62      // Connect output
63      this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
64   */
65 }
66
67 // eof - $RCSfile$