1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef _itkVTKImageToImageFilter_txx
\r
19 #define _itkVTKImageToImageFilter_txx
\r
20 #include "itkVTKImageToImageFilter.h"
\r
30 template <class TOutputImage>
\r
31 VTKImageToImageFilter<TOutputImage>
\r
32 ::VTKImageToImageFilter()
\r
35 m_Exporter = vtkImageExport::New();
\r
37 m_Importer = ImporterFilterType::New();
\r
39 m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());
\r
40 m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());
\r
41 m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());
\r
42 m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback());
\r
43 m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback());
\r
44 m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());
\r
45 m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());
\r
46 m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());
\r
47 m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());
\r
48 m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());
\r
49 m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
\r
50 m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData());
\r
60 template <class TOutputImage>
\r
61 VTKImageToImageFilter<TOutputImage>
\r
62 ::~VTKImageToImageFilter()
\r
66 m_Exporter->Delete();
\r
74 * Set a vtkImageData as input
\r
76 template <class TOutputImage>
\r
78 VTKImageToImageFilter<TOutputImage>
\r
79 ::SetInput( vtkImageData * inputImage )
\r
81 m_Exporter->SetInput( inputImage );
\r
87 * Get an itk::Image as output
\r
89 template <class TOutputImage>
\r
90 const typename VTKImageToImageFilter<TOutputImage>::OutputImageType *
\r
91 VTKImageToImageFilter<TOutputImage>
\r
94 return m_Importer->GetOutput();
\r
101 * Get the exporter filter
\r
103 template <class TOutputImage>
\r
105 VTKImageToImageFilter<TOutputImage>
\r
106 ::GetExporter() const
\r
114 * Get the importer filter
\r
116 template <class TOutputImage>
\r
117 typename VTKImageToImageFilter<TOutputImage>::ImporterFilterType *
\r
118 VTKImageToImageFilter<TOutputImage>
\r
119 ::GetImporter() const
\r
128 * Delegate the Update to the importer
\r
130 template <class TOutputImage>
\r
132 VTKImageToImageFilter<TOutputImage>
\r
135 m_Importer->Update();
\r
141 } // end namespace itk
\r