X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FITKDistanceMapFilters%2FBinaryContourImageFilter.cxx;fp=plugins%2FITKDistanceMapFilters%2FBinaryContourImageFilter.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0cb97116940e7379c08713d729cbb3125fb2ecf1;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/plugins/ITKDistanceMapFilters/BinaryContourImageFilter.cxx b/plugins/ITKDistanceMapFilters/BinaryContourImageFilter.cxx deleted file mode 100644 index 0cb9711..0000000 --- a/plugins/ITKDistanceMapFilters/BinaryContourImageFilter.cxx +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include - -#include - -// ------------------------------------------------------------------------- -cpPluginsITKDistanceMapFilters::BinaryContourImageFilter:: -BinaryContourImageFilter( ) - : Superclass( ) -{ - typedef cpInstances::DataObjects::Image _TImage; - - this->_ConfigureInput< _TImage >( "Input", true, false ); - this->_ConfigureOutput< _TImage >( "Output" ); - - this->m_Parameters.ConfigureAsReal( "BackgroundValue", 0 ); - this->m_Parameters.ConfigureAsReal( "ForegroundValue", 1 ); - this->m_Parameters.ConfigureAsBool( "FullyConnected", false ); -} - -// ------------------------------------------------------------------------- -cpPluginsITKDistanceMapFilters::BinaryContourImageFilter:: -~BinaryContourImageFilter( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginsITKDistanceMapFilters::BinaryContourImageFilter:: -_GenerateData( ) -{ - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_Image_VisualDims_1( o, _GD0 ) - this->_Error( "Invalid input image dimension." ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -void cpPluginsITKDistanceMapFilters::BinaryContourImageFilter:: -_GD0( _TImage* image ) -{ - cpPlugins_Demangle_Image_ScalarPixels_1( image, _GD1, _TImage::ImageDimension ) - this->_Error( "Invalid input image pixel type." ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -void cpPluginsITKDistanceMapFilters::BinaryContourImageFilter:: -_GD1( _TImage* image ) -{ - typedef - itk::BinaryContourImageFilter< _TImage, _TImage > - _TFilter; - - // Get parameters - double b = this->m_Parameters.GetReal( "BackgroundValue" ); - double f = this->m_Parameters.GetReal( "ForegroundValue" ); - double c = this->m_Parameters.GetBool( "FullyConnected" ); - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetBackgroundValue( ( typename _TImage::PixelType )( b ) ); - filter->SetForegroundValue( ( typename _TImage::PixelType )( f ) ); - filter->SetFullyConnected( c ); - filter->Update( ); - - // Connect output - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); -} - -// eof - $RCSfile$