1 /*=========================================================================
3 * Copyright Insight Software Consortium
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *=========================================================================*/
19 #ifndef itkVTKImageToImageFilter_hxx
20 #define itkVTKImageToImageFilter_hxx
22 #include "itkVTKImageToImageFilter.h"
24 #include "vtkVersion.h"
32 template <typename TOutputImage>
33 VTKImageToImageFilter<TOutputImage>
34 ::VTKImageToImageFilter()
37 m_Exporter = vtkImageExport::New();
39 this->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());
40 this->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());
41 this->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());
42 this->SetSpacingCallback( m_Exporter->GetSpacingCallback());
43 this->SetOriginCallback( m_Exporter->GetOriginCallback());
44 this->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());
45 this->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());
46 this->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());
47 this->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());
48 this->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());
49 this->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
50 this->SetCallbackUserData( m_Exporter->GetCallbackUserData());
57 template <typename TOutputImage>
58 VTKImageToImageFilter<TOutputImage>
59 ::~VTKImageToImageFilter()
69 * Set a vtkImageData as input
71 template <typename TOutputImage>
73 VTKImageToImageFilter<TOutputImage>
74 ::SetInput( vtkImageData * inputImage )
76 #if VTK_MAJOR_VERSION <= 5
77 m_Exporter->SetInput( inputImage );
79 m_Exporter->SetInputData( inputImage );
84 * Get the exporter filter
86 template <typename TOutputImage>
88 VTKImageToImageFilter<TOutputImage>
95 * Get the importer filter
97 template <typename TOutputImage>
98 const typename VTKImageToImageFilter<TOutputImage>::Superclass *
99 VTKImageToImageFilter<TOutputImage>
100 ::GetImporter() const
105 } // end namespace itk