]> Creatis software - clitk.git/blobdiff - itk/itkVTKImageToImageFilter.txx
Add preserve studyUID in clitkImage2Dicom
[clitk.git] / itk / itkVTKImageToImageFilter.txx
index 035035b2cac7270a1f802c2eceff046a1498ce78..5fddba28f6d49f17db81cd18ae91f8435a234e88 100644 (file)
@@ -1,7 +1,7 @@
 /*=========================================================================
   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
-  Authors belong to: 
+  Authors belong to:
   - University of LYON              http://www.universite-lyon.fr/
   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
-#ifndef _itkVTKImageToImageFilter_txx\r
-#define _itkVTKImageToImageFilter_txx\r
-#include "itkVTKImageToImageFilter.h"\r
-\r
-namespace itk\r
-{\r
-\r
-\r
-\r
-/**\r
- * Constructor\r
- */\r
-template <class TOutputImage>\r
-VTKImageToImageFilter<TOutputImage>\r
-::VTKImageToImageFilter()\r
-{\r
-\r
-    m_Exporter = vtkImageExport::New();\r
-\r
-    m_Importer = ImporterFilterType::New();\r
-\r
-    m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());\r
-    m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());\r
-    m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());\r
-    m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback());\r
-    m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback());\r
-    m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());\r
-    m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());\r
-    m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());\r
-    m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());\r
-    m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());\r
-    m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());\r
-    m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData());\r
-\r
-}\r
-\r
-\r
-\r
-\r
-/**\r
- * Destructor\r
- */\r
-template <class TOutputImage>\r
-VTKImageToImageFilter<TOutputImage>\r
-::~VTKImageToImageFilter()\r
-{\r
-    if ( m_Exporter )\r
-    {\r
-        m_Exporter->Delete();\r
-        m_Exporter = 0;\r
-    }\r
-}\r
-\r
-\r
-\r
-/**\r
- * Set a vtkImageData as input\r
- */\r
-template <class TOutputImage>\r
-void\r
-VTKImageToImageFilter<TOutputImage>\r
-::SetInput( vtkImageData * inputImage )\r
-{\r
-    m_Exporter->SetInput( inputImage );\r
-}\r
-\r
-\r
-\r
-/**\r
- * Get an itk::Image as output\r
- */\r
-template <class TOutputImage>\r
-const typename VTKImageToImageFilter<TOutputImage>::OutputImageType *\r
-VTKImageToImageFilter<TOutputImage>\r
-::GetOutput() const\r
-{\r
-    return m_Importer->GetOutput();\r
-}\r
-\r
-\r
-\r
-\r
-/**\r
- * Get the exporter filter\r
- */\r
-template <class TOutputImage>\r
-vtkImageExport *\r
-VTKImageToImageFilter<TOutputImage>\r
-::GetExporter() const\r
-{\r
-    return m_Exporter;\r
-}\r
-\r
-\r
-\r
-/**\r
- * Get the importer filter\r
- */\r
-template <class TOutputImage>\r
-typename VTKImageToImageFilter<TOutputImage>::ImporterFilterType *\r
-VTKImageToImageFilter<TOutputImage>\r
-::GetImporter() const\r
-{\r
-    return m_Importer;\r
-}\r
-\r
-\r
-\r
-\r
-/**\r
- * Delegate the Update to the importer\r
- */\r
-template <class TOutputImage>\r
-void\r
-VTKImageToImageFilter<TOutputImage>\r
-::Update()\r
-{\r
-    m_Importer->Update();\r
-}\r
-\r
-\r
-\r
-\r
-} // end namespace itk\r
-\r
-#endif\r
-\r
+#ifndef _itkVTKImageToImageFilter_txx
+#define _itkVTKImageToImageFilter_txx
+#include "itkVTKImageToImageFilter.h"
+
+namespace itk
+{
+
+
+
+/**
+ * Constructor
+ */
+template <class TOutputImage>
+VTKImageToImageFilter<TOutputImage>
+::VTKImageToImageFilter()
+{
+
+  m_Exporter = vtkImageExport::New();
+
+  m_Importer = ImporterFilterType::New();
+
+  m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());
+  m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());
+  m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());
+  m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback());
+  m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback());
+  m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());
+  m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());
+  m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());
+  m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());
+  m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());
+  m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
+  m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData());
+
+}
+
+
+
+
+/**
+ * Destructor
+ */
+template <class TOutputImage>
+VTKImageToImageFilter<TOutputImage>
+::~VTKImageToImageFilter()
+{
+  if ( m_Exporter ) {
+    m_Exporter->Delete();
+    m_Exporter = 0;
+  }
+}
+
+
+
+/**
+ * Set a vtkImageData as input
+ */
+template <class TOutputImage>
+void
+VTKImageToImageFilter<TOutputImage>
+::SetInput( vtkImageData * inputImage )
+{
+#if VTK_MAJOR_VERSION <= 5
+  m_Exporter->SetInput( inputImage );
+#else
+  m_Exporter->SetInputData( inputImage );
+#endif
+}
+
+
+
+/**
+ * Get an itk::Image as output
+ */
+template <class TOutputImage>
+//const 
+typename VTKImageToImageFilter<TOutputImage>::OutputImageType *
+VTKImageToImageFilter<TOutputImage>
+::GetOutput() const
+{
+  return m_Importer->GetOutput();
+}
+
+
+
+
+/**
+ * Get the exporter filter
+ */
+template <class TOutputImage>
+vtkImageExport *
+VTKImageToImageFilter<TOutputImage>
+::GetExporter() const
+{
+  return m_Exporter;
+}
+
+
+
+/**
+ * Get the importer filter
+ */
+template <class TOutputImage>
+typename VTKImageToImageFilter<TOutputImage>::ImporterFilterType *
+VTKImageToImageFilter<TOutputImage>
+::GetImporter() const
+{
+  return m_Importer;
+}
+
+
+
+
+/**
+ * Delegate the Update to the importer
+ */
+template <class TOutputImage>
+void
+VTKImageToImageFilter<TOutputImage>
+::Update()
+{
+  m_Importer->Update();
+}
+
+
+
+
+} // end namespace itk
+
+#endif
+