]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 15 Apr 2016 20:00:47 +0000 (15:00 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 15 Apr 2016 20:00:47 +0000 (15:00 -0500)
lib/Airways/fpa2Airways/Converter.h
lib/Airways/fpa2Airways/Converter.hxx [new file with mode: 0644]

index da2f21468df061f971e71b049abc6432800104b9..13e31b28c78e805680cbb04a1daa3509393df133 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __FPA2AIRWAYS__CONVERTER__H__
-#define __FPA2AIRWAYS__CONVERTER__H__
+#ifndef __AIRWAYS__FPA2AIRWAYS__CONVERTER__H__
+#define __AIRWAYS__FPA2AIRWAYS__CONVERTER__H__
 
 #include <itkProcessObject.h>
 #include <itkSimpleDataObjectDecorator.h>
@@ -12,13 +12,26 @@ namespace fpa2Airways
   class Converter
     : public itk::ProcessObject
   {
+  public:
+    typedef Converter                       Self;
+    typedef itk::ProcessObject              Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+    typedef _TSkeleton TSkeleton;
+    typedef _TAirways  TAirways; 
+    typedef itk::SimpleDataObjectDecorator< _TAirways* > TOutput;
+
   public:
     itkNewMacro( Self );
     itkTypeMacro( Converter, itk::ProcessObject );
 
   public:
-    SetInput( TSkeleton );
-    TAirways GetOutput( );
+    void SetInput( const TSkeleton* sk );
+    TSkeleton* GetInput( );
+    const TSkeleton* GetInput( ) const;
+    TAirways* GetOutput( );
+    const TAirways* GetOutput( ) const;
 
   protected:
     Converter( );
@@ -35,9 +48,9 @@ namespace fpa2Airways
 } // ecapseman
 
 #ifndef ITK_MANUAL_INSTANTIATION 
-#include <fpa2Airways/Converter.hxx> 
+#include <Airways/fpa2Airways/Converter.hxx> 
 #endif // ITK_MANUAL_INSTANTIATION 
 
-#endif // __FPA2AIRWAYS__CONVERTER__H__
+#endif // __AIRWAYS__FPA2AIRWAYS__CONVERTER__H__
 
 // eof - $RCSfile$
diff --git a/lib/Airways/fpa2Airways/Converter.hxx b/lib/Airways/fpa2Airways/Converter.hxx
new file mode 100644 (file)
index 0000000..e3a564e
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef __AIRWAYS__FPA2AIRWAYS__CONVERTER__HXX__
+#define __AIRWAYS__FPA2AIRWAYS__CONVERTER__HXX__
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+void fpa2Airways::Converter< _TSkeleton, _TAirways >::
+SetInput( const _TSkeleton* sk )
+{
+  this->itk::ProcessObject::SetNthInput( 0, const_cast< _TSkeleton* >( sk ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+_TSkeleton* fpa2Airways::Converter< _TSkeleton, _TAirways >::
+GetInput( )
+{
+  return(
+    dynamic_cast< _TSkeleton* >( this->itk::ProcessObject::GetInput( 0 ) )
+    );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+const _TSkeleton* fpa2Airways::Converter< _TSkeleton, _TAirways >::
+GetInput( ) const
+{
+  return(
+    dynamic_cast< const _TSkeleton* >(
+      this->itk::ProcessObject::GetInput( 0 )
+      )
+    );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+_TAirways* fpa2Airways::Converter< _TSkeleton, _TAirways >::
+GetOutput( )
+{
+  auto o = dynamic_cast< _TAirways* >(
+    this->itk::ProcessObject::GetOutput( 0 )
+    );
+  return( o->Get( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+const _TAirways* fpa2Airways::Converter< _TSkeleton, _TAirways >::
+GetOutput( ) const
+{
+  auto o = dynamic_cast< const _TAirways* >(
+    this->itk::ProcessObject::GetOutput( 0 )
+    );
+  return( o->Get( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+fpa2Airways::Converter< _TSkeleton, _TAirways >::
+Converter( )
+  : Superclass( )
+{
+  this->SetNumberOfRequiredInputs( 1 );
+  this->SetNumberOfRequiredOutputs( 1 );
+  typename TOutput::Pointer o = TOutput::New( );
+  this->itk::ProcessObject::SetNthOutput( 0, o.GetPointer( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+fpa2Airways::Converter< _TSkeleton, _TAirways >::
+~Converter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton, class _TAirways >
+void fpa2Airways::Converter< _TSkeleton, _TAirways >::
+GenerateData( )
+{
+}
+
+#endif // __AIRWAYS__FPA2AIRWAYS__CONVERTER__HXX__
+
+// eof - $RCSfile$