#include <cpPlugins/Interface/Image.h>
#include <cpPlugins/Interface/PointList.h>
+
+#include <fpaPlugins/GrowFunction.h>
+
#include <fpa/Image/RegionGrow.h>
#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
-#include <fpaPlugins/GrowFunction.h>
+#include <fpa/VTK/Image2DObserver.h>
+#include <fpa/VTK/Image3DObserver.h>
+
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
// -------------------------------------------------------------------------
fpaPlugins::ImageRegionGrow::
this->_AddInput( "Input" );
this->_AddInput( "GrowFunction" );
this->_AddInput( "Seeds" );
- this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+ this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
this->m_Parameters->ConfigureAsBool( "VisualDebug" );
this->m_Parameters->ConfigureAsBool( "StopAtOneFront" );
} // rof
// Connect visual debugger
- /* TODO
- this->m_Parameters->ConfigureAsBool( "VisualDebug", false );
- */
+ if(
+ this->m_Parameters->GetBool( "VisualDebug" ) &&
+ this->m_Interactors.size( ) > 0
+ )
+ {
+ if( I::ImageDimension == 2 )
+ {
+ typedef
+ fpa::VTK::Image2DObserver< _TFilter, vtkRenderWindow >
+ _TDebugger;
+
+ for(
+ auto iIt = this->m_Interactors.begin( );
+ iIt != this->m_Interactors.end( );
+ ++iIt
+ )
+ {
+ typename _TDebugger::Pointer debugger = _TDebugger::New( );
+ debugger->SetRenderWindow( ( *iIt )->GetRenderWindow( ) );
+ debugger->SetRenderPercentage( 0.01 );
+ filter->AddObserver( itk::AnyEvent( ), debugger );
+
+ } // rof
+ filter->ThrowEventsOn( );
+ }
+ else if( I::ImageDimension == 3 )
+ {
+ } // fi
+
+ } // fi
// Go!!!
filter->Update( );
: Superclass( )
{
this->_AddInput( "ReferenceImage" );
- this->_MakeOutput< GrowFunction >( "Output" );
+ this->_AddOutput< GrowFunction >( "Output" );
this->m_Parameters->ConfigureAsReal( "LowerThreshold" );
this->m_Parameters->ConfigureAsReal( "UpperThreshold" );
_GD0( itk::DataObject* data )
{
typedef fpa::Image::Functors::RegionGrowThresholdFunction< I > _F;
- typename _F::Pointer functor = _F::New( );
+ typename _F::Pointer f = _F::New( );
+ f->SetLowerThreshold( this->m_Parameters->GetReal( "LowerThreshold" ) );
+ f->SetUpperThreshold( this->m_Parameters->GetReal( "UpperThreshold" ) );
// Connect output
GrowFunction* out = this->GetOutput< GrowFunction >( "Output" );
if( out != NULL )
{
- out->SetITK< _F >( functor );
+ out->SetITK< _F >( f );
return( "" );
}
else