+++ /dev/null
-#ifndef __cpPluginsITKGenericFilters__RegionOfInterestImageFilter__h__
-#define __cpPluginsITKGenericFilters__RegionOfInterestImageFilter__h__
-
-#include <cpPluginsITKGenericFilters_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace cpPluginsITKGenericFilters
-{
- /**
- */
- class cpPluginsITKGenericFilters_EXPORT RegionOfInterestImageFilter
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- RegionOfInterestImageFilter,
- cpPlugins::BaseObjects::ProcessObject,
- ImageFilters
- );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* input );
- };
-
-} // ecapseman
-
-#endif // __cpPluginsITKGenericFilters__RegionOfInterestImageFilter__h__
-
-// eof - $RCSfile$
tinclude itk#filters_1#:h|hxx
instances itk::#filters_1#< itk::Image< #i_scalars#, #pdims# >, itk::Image< #o_scalars#, #pdims# > >
+tinclude itkRegionOfInterestImageFilter:h|hxx
+instances itk::RegionOfInterestImageFilter< itk::Image< #scalar_types#, #pdims# >, itk::Image< #scalar_types#, #pdims# > >
+
tinclude itkMinimumMaximumImageCalculator:h|hxx
instances itk::MinimumMaximumImageCalculator< itk::Image< #scalar_types#, #pdims# > >
+tinclude cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold:h|hxx
+instances cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< itk::Image< #scalar_types#, #pdims# > >
+
** eof - $RCSfile$
--- /dev/null
+#include <ITKImageGenericFilters_1/ImageToBoundingBoxFromThreshold.h>
+#include <cpInstances/Image.h>
+#include <cpInstances/BoundingBox.h>
+
+#include <itkImage.h>
+#include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageGenericFilters_1::ImageToBoundingBoxFromThreshold::
+ImageToBoundingBoxFromThreshold( )
+ : Superclass( )
+{
+ this->_ConfigureInput< cpInstances::Image >( "Input", true, false );
+ this->_ConfigureOutput< cpInstances::BoundingBox >( "Output" );
+
+ this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
+ this->m_Parameters.ConfigureAsReal( "UpperThreshold", 1 );
+}
+
+// -------------------------------------------------------------------------
+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->Compute( );
+
+ // Create output
+ auto reg = filter->GetRegion( );
+ auto bb = this->GetOutput< cpInstances::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$
--- /dev/null
+#ifndef __cpPluginsITKImageGenericFilters_1__ImageToBoundingBoxFromThreshold__h__
+#define __cpPluginsITKImageGenericFilters_1__ImageToBoundingBoxFromThreshold__h__
+
+#include <cpPluginsITKImageGenericFilters_1_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsITKImageGenericFilters_1
+{
+ /**
+ */
+ class cpPluginsITKImageGenericFilters_1_EXPORT ImageToBoundingBoxFromThreshold
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ ImageToBoundingBoxFromThreshold,
+ cpPlugins::BaseObjects::ProcessObject,
+ ImageFeatures
+ );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKImageGenericFilters_1__ImageToBoundingBoxFromThreshold__h__
+
+// eof - $RCSfile$
-#include <ITKGenericFilters/RegionOfInterestImageFilter.h>
+#include <ITKImageGenericFilters_1/RegionOfInterestImageFilter.h>
#include <cpInstances/Image.h>
#include <cpInstances/BoundingBox.h>
#include <cpInstances/Image_Demanglers.h>
#include <itkRegionOfInterestImageFilter.h>
// -------------------------------------------------------------------------
-cpPluginsITKGenericFilters::RegionOfInterestImageFilter::
+cpPluginsITKImageGenericFilters_1::RegionOfInterestImageFilter::
RegionOfInterestImageFilter( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-cpPluginsITKGenericFilters::RegionOfInterestImageFilter::
+cpPluginsITKImageGenericFilters_1::RegionOfInterestImageFilter::
~RegionOfInterestImageFilter( )
{
}
// -------------------------------------------------------------------------
-void cpPluginsITKGenericFilters::RegionOfInterestImageFilter::
+void cpPluginsITKImageGenericFilters_1::RegionOfInterestImageFilter::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void cpPluginsITKGenericFilters::RegionOfInterestImageFilter::
+void cpPluginsITKImageGenericFilters_1::RegionOfInterestImageFilter::
_GD0( _TImage* input )
{
typedef cpInstances::BoundingBox _TBBox;
--- /dev/null
+#ifndef __cpPluginsITKImageGenericFilters_1__RegionOfInterestImageFilter__h__
+#define __cpPluginsITKImageGenericFilters_1__RegionOfInterestImageFilter__h__
+
+#include <cpPluginsITKImageGenericFilters_1_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsITKImageGenericFilters_1
+{
+ /**
+ */
+ class cpPluginsITKImageGenericFilters_1_EXPORT RegionOfInterestImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ RegionOfInterestImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ ImageFilters
+ );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* input );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKImageGenericFilters_1__RegionOfInterestImageFilter__h__
+
+// eof - $RCSfile$