X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FITKImageGenericFilters_1%2FImageToBoundingBoxFromThreshold.cxx;fp=plugins%2FITKImageGenericFilters_1%2FImageToBoundingBoxFromThreshold.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=a4e815bf2850321d97b98287cdc4ff6ebdc06741;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/plugins/ITKImageGenericFilters_1/ImageToBoundingBoxFromThreshold.cxx b/plugins/ITKImageGenericFilters_1/ImageToBoundingBoxFromThreshold.cxx deleted file mode 100644 index a4e815b..0000000 --- a/plugins/ITKImageGenericFilters_1/ImageToBoundingBoxFromThreshold.cxx +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include - -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsITKImageGenericFilters_1::ImageToBoundingBoxFromThreshold:: -ImageToBoundingBoxFromThreshold( ) - : Superclass( ) -{ - this->_ConfigureInput< cpInstances::DataObjects::Image >( "Input", true, false ); - this->_ConfigureOutput< cpInstances::DataObjects::BoundingBox >( "Output" ); - - this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 ); - this->m_Parameters.ConfigureAsReal( "UpperThreshold", 1 ); - this->m_Parameters.ConfigureAsUint( "PAD", 0 ); -} - -// ------------------------------------------------------------------------- -cpPluginsITKImageGenericFilters_1::ImageToBoundingBoxFromThreshold:: -~ImageToBoundingBoxFromThreshold( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginsITKImageGenericFilters_1::ImageToBoundingBoxFromThreshold:: -_GenerateData( ) -{ - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 ) - this->_Error( "Invalid input image." ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -void cpPluginsITKImageGenericFilters_1::ImageToBoundingBoxFromThreshold:: -_GD0( _TImage* image ) -{ - typedef - cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage > - _TFilter; - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetImage( image ); - filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) ); - filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) ); - filter->SetPAD( this->m_Parameters.GetUint( "PAD" ) ); - filter->Compute( ); - - // Create output - auto reg = filter->GetRegion( ); - auto bb = this->GetOutput< cpInstances::DataObjects::BoundingBox >( "Output" ); - typename _TImage::PointType p0, p1; - image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 ); - image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 ); - bb->SetMinimum( p0 ); - bb->SetMaximum( p1 ); -} - -// eof - $RCSfile$