]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/RegionOfInterestImageCalculator.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Algorithms / RegionOfInterestImageCalculator.h
diff --git a/lib/cpExtensions/Algorithms/RegionOfInterestImageCalculator.h b/lib/cpExtensions/Algorithms/RegionOfInterestImageCalculator.h
new file mode 100644 (file)
index 0000000..84102ad
--- /dev/null
@@ -0,0 +1,73 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__REGIONOFINTERESTIMAGECALCULATOR__H__
+#define __CPEXTENSIONS__ALGORITHMS__REGIONOFINTERESTIMAGECALCULATOR__H__
+
+#include <itkObject.h>
+#include <itkObjectFactory.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class _TImage >
+    class RegionOfInterestImageCalculator
+      : public itk::Object
+    {
+    public:
+      // Basic types
+      typedef RegionOfInterestImageCalculator Self;
+      typedef itk::Object                     Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef _TImage TImage;
+      typedef typename _TImage::IndexType TIndex;
+      typedef typename _TImage::PixelType TPixel;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( RegionOfInterestImageCalculator, itkObject );
+
+      itkGetConstObjectMacro( Image, _TImage );
+      itkGetConstMacro( BackgroundValue, TPixel );
+      itkGetConstMacro( Minimum, TIndex );
+      itkGetConstMacro( Maximum, TIndex );
+
+      itkSetConstObjectMacro( Image, _TImage );
+      itkSetMacro( BackgroundValue, TPixel );
+
+    public:
+      void Compute( );
+      
+    protected:
+      RegionOfInterestImageCalculator( );
+      virtual ~RegionOfInterestImageCalculator( );
+
+    private:
+      // Purposely not implemented
+      RegionOfInterestImageCalculator( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      typename _TImage::ConstPointer m_Image;
+      TPixel m_BackgroundValue;
+      TIndex m_Minimum;
+      TIndex m_Maximum;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/Algorithms/RegionOfInterestImageCalculator.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__REGIONOFINTERESTIMAGECALCULATOR__H__
+
+// eof - $RCSfile$