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://www.centreleonberard.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 _itkImageToVTKImageFilter_txx
19 #define _itkImageToVTKImageFilter_txx
20 #include "itkImageToVTKImageFilter.h"
30 template <class TInputImage>
31 ImageToVTKImageFilter<TInputImage>
32 ::ImageToVTKImageFilter()
35 m_Importer = vtkImageImport::New();
37 m_Exporter = ExporterFilterType::New();
39 m_Importer->SetUpdateInformationCallback(m_Exporter->GetUpdateInformationCallback());
40 m_Importer->SetPipelineModifiedCallback(m_Exporter->GetPipelineModifiedCallback());
41 m_Importer->SetWholeExtentCallback(m_Exporter->GetWholeExtentCallback());
42 m_Importer->SetSpacingCallback(m_Exporter->GetSpacingCallback());
43 m_Importer->SetOriginCallback(m_Exporter->GetOriginCallback());
44 m_Importer->SetScalarTypeCallback(m_Exporter->GetScalarTypeCallback());
45 m_Importer->SetNumberOfComponentsCallback(m_Exporter->GetNumberOfComponentsCallback());
46 m_Importer->SetPropagateUpdateExtentCallback(m_Exporter->GetPropagateUpdateExtentCallback());
47 m_Importer->SetUpdateDataCallback(m_Exporter->GetUpdateDataCallback());
48 m_Importer->SetDataExtentCallback(m_Exporter->GetDataExtentCallback());
49 m_Importer->SetBufferPointerCallback(m_Exporter->GetBufferPointerCallback());
50 m_Importer->SetCallbackUserData(m_Exporter->GetCallbackUserData());
60 template <class TInputImage>
61 ImageToVTKImageFilter<TInputImage>
62 ::~ImageToVTKImageFilter()
73 * Set an itk::Image as input
75 template <class TInputImage>
77 ImageToVTKImageFilter<TInputImage>
78 ::SetInput( const InputImageType * inputImage )
80 m_Exporter->SetInput( inputImage );
86 * Get a vtkImage as output
88 template <class TInputImage>
90 ImageToVTKImageFilter<TInputImage>
93 return m_Importer->GetOutput();
100 * Get the importer filter
102 template <class TInputImage>
104 ImageToVTKImageFilter<TInputImage>
105 ::GetImporter() const
113 * Get the exporter filter
115 template <class TInputImage>
116 typename ImageToVTKImageFilter<TInputImage>::ExporterFilterType *
117 ImageToVTKImageFilter<TInputImage>
118 ::GetExporter() const
120 return m_Exporter.GetPointer();
126 * Delegate the Update to the importer
128 template <class TInputImage>
130 ImageToVTKImageFilter<TInputImage>
133 m_Importer->Update();
140 } // end namespace itk