]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Algorithms / ImageToBoundingBoxFromThreshold.h
diff --git a/lib/cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h b/lib/cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h
new file mode 100644 (file)
index 0000000..b970df4
--- /dev/null
@@ -0,0 +1,78 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __cpExtensions__Algorithms__ImageToBoundingBoxFromThreshold__h__
+#define __cpExtensions__Algorithms__ImageToBoundingBoxFromThreshold__h__
+
+#include <itkObject.h>
+#include <itkObjectFactory.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class _TImage >
+    class ImageToBoundingBoxFromThreshold
+      : public itk::Object
+    {
+    public:
+      typedef ImageToBoundingBoxFromThreshold Self;
+      typedef itk::Object                     Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef _TImage TImage;
+      typedef typename TImage::PixelType  TPixel;
+      typedef typename TImage::IndexType  TIndex;
+      typedef typename TImage::RegionType TRegion;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( ImageToBoundingBoxFromThreshold, itkObject );
+
+      itkGetConstObjectMacro( Image, TImage );
+      itkGetConstMacro( LowerThreshold, TPixel );
+      itkGetConstMacro( UpperThreshold, TPixel );
+      itkGetConstMacro( Region, TRegion );
+      itkGetConstMacro( PAD, unsigned int );
+
+      itkSetConstObjectMacro( Image, TImage );
+      itkSetMacro( LowerThreshold, TPixel );
+      itkSetMacro( UpperThreshold, TPixel );
+      itkSetMacro( Region, TRegion );
+      itkSetMacro( PAD, unsigned int );
+
+    public:
+      void Compute( );
+
+    protected:
+      ImageToBoundingBoxFromThreshold( );
+      virtual ~ImageToBoundingBoxFromThreshold( );
+
+    private:
+      // Purposely not implemented.
+      ImageToBoundingBoxFromThreshold( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      typename TImage::ConstPointer m_Image;
+      TPixel m_LowerThreshold;
+      TPixel m_UpperThreshold;
+      TRegion m_Region;
+      unsigned int m_PAD;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __cpExtensions__Algorithms__ImageToBoundingBoxFromThreshold__h__
+
+// eof - $RCSfile$