]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/SkeletonReader.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / SkeletonReader.h
diff --git a/lib/cpExtensions/Algorithms/SkeletonReader.h b/lib/cpExtensions/Algorithms/SkeletonReader.h
new file mode 100644 (file)
index 0000000..e1a3064
--- /dev/null
@@ -0,0 +1,85 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __cpExtensions__Algorithms__SkeletonReader__h__
+#define __cpExtensions__Algorithms__SkeletonReader__h__
+
+#include <cpExtensions/Config.h>
+#include <itkProcessObject.h>
+
+// -------------------------------------------------------------------------
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class _TSkeleton >
+    class SkeletonReader
+      : public itk::ProcessObject
+    {
+    public:
+      // Basic types
+      typedef SkeletonReader                  Self;
+      typedef itk::ProcessObject              Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef _TSkeleton TSkeleton;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( SkeletonReader, itk::ImageSource );
+
+      itkGetConstMacro( FileName, std::string );
+      itkSetMacro( FileName, std::string );
+
+    public:
+      TSkeleton* GetOutput( );
+      TSkeleton* GetOutput( unsigned int i );
+
+      virtual void GraftOutput( itk::DataObject* out );
+      virtual void GraftOutput(
+        const typename Superclass::DataObjectIdentifierType& key,
+        itk::DataObject* out
+        );
+      virtual void GraftNthOutput( unsigned int i, itk::DataObject* out );
+      virtual itk::DataObject::Pointer MakeOutput(
+        itk::ProcessObject::DataObjectPointerArraySizeType i
+        ) cpExtensions_OVERRIDE;
+
+      virtual void Update( ) cpExtensions_OVERRIDE
+        { this->GenerateData( ); }
+
+    protected:
+      SkeletonReader( );
+      virtual ~SkeletonReader( );
+
+      virtual void GenerateData( ) cpExtensions_OVERRIDE;
+
+      // Do nothing
+      virtual void GenerateOutputInformation( ) cpExtensions_OVERRIDE
+        { }
+
+    private:
+      // Purposely not implemented
+      SkeletonReader( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      std::string m_FileName;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+// -------------------------------------------------------------------------
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/Algorithms/SkeletonReader.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __cpExtensions__Algorithms__SkeletonReader__h__
+
+// eof - $RCSfile$