1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: itkVTKImageToImageFilter.txx,v $
6 Date: $Date: 2008/03/03 11:49:18 $
7 Version: $Revision: 1.1 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef _itkVTKImageToImageFilter_txx
18 #define _itkVTKImageToImageFilter_txx
20 #include "itkVTKImageToImageFilter.h"
30 template <class TOutputImage>
31 VTKImageToImageFilter<TOutputImage>
32 ::VTKImageToImageFilter()
35 m_Exporter = vtkImageExport::New();
37 m_Importer = ImporterFilterType::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 TOutputImage>
61 VTKImageToImageFilter<TOutputImage>
62 ::~VTKImageToImageFilter()
74 * Set a vtkImageData as input
76 template <class TOutputImage>
78 VTKImageToImageFilter<TOutputImage>
79 ::SetInput( vtkImageData * inputImage )
81 m_Exporter->SetInput( inputImage );
87 * Get an itk::Image as output
89 template <class TOutputImage>
90 const typename VTKImageToImageFilter<TOutputImage>::OutputImageType *
91 VTKImageToImageFilter<TOutputImage>
94 return m_Importer->GetOutput();
101 * Get the exporter filter
103 template <class TOutputImage>
105 VTKImageToImageFilter<TOutputImage>
106 ::GetExporter() const
114 * Get the importer filter
116 template <class TOutputImage>
117 typename VTKImageToImageFilter<TOutputImage>::ImporterFilterType *
118 VTKImageToImageFilter<TOutputImage>
119 ::GetImporter() const
128 * Delegate the Update to the importer
130 template <class TOutputImage>
132 VTKImageToImageFilter<TOutputImage>
135 m_Importer->Update();
141 } // end namespace itk