]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MoriRegionGrow.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / MoriRegionGrow.hxx
index 29f46ac74f6b3baa827c235079734323673aec5b..737bf1f79d15acb515c1d9fb6f94a2f959c80bb3 100644 (file)
 #define __fpa__Image__MoriRegionGrow__hxx__
 
 // -------------------------------------------------------------------------
-template< class _TInputImage, class _TOutputImage >
-fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage >::
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TAuxImage*
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetAuxiliaryImage( )
+{
+  return( this->m_Helper->GetOutput( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+const typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TAuxImage*
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetAuxiliaryImage( ) const
+{
+  return( this->m_Helper->GetOutput( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TInputPixel
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetLower( ) const
+{
+  return( this->m_Helper->GetLower( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TInputPixel
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetUpper( ) const
+{
+  return( this->m_Helper->GetUpper( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TInputPixel
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetStep( ) const
+{
+  return( this->m_Helper->GetStep( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TOutputPixel
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetInsideValue( ) const
+{
+  return( this->m_Threshold->GetInsideValue( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+typename
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+TOutputPixel
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GetOutsideValue( ) const
+{
+  return( this->m_Threshold->GetInsideValue( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+SetLower( const TInputPixel& v )
+{
+  this->m_Helper->SetLower( v );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+SetUpper( const TInputPixel& v )
+{
+  this->m_Helper->SetUpper( v );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+SetStep( const TInputPixel& v )
+{
+  this->m_Helper->SetStep( v );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+SetInsideValue( const TOutputPixel& v )
+{
+  this->m_Threshold->SetInsideValue( v );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+SetOutsideValue( const TOutputPixel& v )
+{
+  this->m_Threshold->SetOutsideValue( v );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
 MoriRegionGrow( )
   : Superclass( )
 {
+  this->m_Helper = THelper::New( );
+  this->m_Threshold = TThreshold::New( );
 }
 
 // -------------------------------------------------------------------------
-template< class _TInputImage, class _TOutputImage >
-fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage >::
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
 ~MoriRegionGrow( )
 {
 }
 
 // -------------------------------------------------------------------------
-template< class _TInputImage, class _TOutputImage >
-void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage >::
-_BeforeGenerateData( )
+template< class _TInputImage, class _TOutputImage, class _TAuxPixel >
+void fpa::Image::MoriRegionGrow< _TInputImage, _TOutputImage, _TAuxPixel >::
+GenerateData( )
 {
-  this->Superclass::_BeforeGenerateData( );
+  this->m_Helper->ClearSeeds( );
+  this->m_Helper->AddSeed( this->m_Seed, 0 );
+  this->m_Helper->SetInput( this->GetInput( ) );
+  this->m_Helper->Update( );
 
-  TGrowFunction* grow =
-    dynamic_cast< TGrowFunction* >( this->GetGrowFunction( ) );
-  if( grow != NULL )
-    grow->SetImage( this->GetInput( ) );
+  this->m_Threshold->SetInput( this->m_Helper->GetOutput( ) );
+  this->m_Threshold->SetLowerThreshold( std::numeric_limits< _TAuxPixel >::min( ) );
+  this->m_Threshold->SetUpperThreshold( this->m_Helper->GetOptimumThreshold( ) );
+  this->m_Threshold->Update( );
+  this->GetOutput( )->Graft( this->m_Threshold->GetOutput( ) );
 }
 
 #endif // __fpa__Image__MoriRegionGrow__hxx__