]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Algorithms / RGBImageToOtherChannelsFilter.h
diff --git a/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h b/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h
new file mode 100644 (file)
index 0000000..4ce6754
--- /dev/null
@@ -0,0 +1,67 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+
+#include <itkImageToImageFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O, class C >
+    class RGBImageToOtherChannelsFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef RGBImageToOtherChannelsFilter     Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+      typedef C TConverter;
+      typedef typename I::PixelType TInputPixel;
+      typedef typename O::PixelType TOutputPixel;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( RGBImageToOtherChannelsFilter, itkImageToImageFilter );
+
+    protected:
+      RGBImageToOtherChannelsFilter( );
+      virtual ~RGBImageToOtherChannelsFilter( );
+
+      virtual void BeforeThreadedGenerateData( );
+      virtual void AfterThreadedGenerateData( );
+
+      virtual void ThreadedGenerateData(
+        const typename Superclass::OutputImageRegionType& region,
+        itk::ThreadIdType threadId
+        );
+
+    private:
+      // Purposely not implemented
+      RGBImageToOtherChannelsFilter( const Self& other );
+      void operator=( const Self& other );
+
+    private:
+      TConverter Converter;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+
+// eof - $RCSfile$