Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkVTKImageToImageFilter_txx
00018 #define _itkVTKImageToImageFilter_txx
00019
00020 #include "itkVTKImageToImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00025
00026
00030 template <class TOutputImage>
00031 VTKImageToImageFilter<TOutputImage>
00032 ::VTKImageToImageFilter()
00033 {
00034
00035 m_Exporter = vtkImageExport::New();
00036
00037 m_Importer = ImporterFilterType::New();
00038
00039 m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());
00040 m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());
00041 m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());
00042 m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback());
00043 m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback());
00044 m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());
00045 m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());
00046 m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());
00047 m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());
00048 m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());
00049 m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
00050 m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData());
00051
00052 }
00053
00054
00055
00056
00060 template <class TOutputImage>
00061 VTKImageToImageFilter<TOutputImage>
00062 ::~VTKImageToImageFilter()
00063 {
00064 if( m_Exporter )
00065 {
00066 m_Exporter->Delete();
00067 m_Exporter = 0;
00068 }
00069 }
00070
00071
00072
00076 template <class TOutputImage>
00077 void
00078 VTKImageToImageFilter<TOutputImage>
00079 ::SetInput( vtkImageData * inputImage )
00080 {
00081 m_Exporter->SetInput( inputImage );
00082 }
00083
00084
00085
00089 template <class TOutputImage>
00090 const typename VTKImageToImageFilter<TOutputImage>::OutputImageType *
00091 VTKImageToImageFilter<TOutputImage>
00092 ::GetOutput() const
00093 {
00094 return m_Importer->GetOutput();
00095 }
00096
00097
00098
00099
00103 template <class TOutputImage>
00104 vtkImageExport *
00105 VTKImageToImageFilter<TOutputImage>
00106 ::GetExporter() const
00107 {
00108 return m_Exporter;
00109 }
00110
00111
00112
00116 template <class TOutputImage>
00117 typename VTKImageToImageFilter<TOutputImage>::ImporterFilterType *
00118 VTKImageToImageFilter<TOutputImage>
00119 ::GetImporter() const
00120 {
00121 return m_Importer;
00122 }
00123
00124
00125
00126
00130 template <class TOutputImage>
00131 void
00132 VTKImageToImageFilter<TOutputImage>
00133 ::Update()
00134 {
00135 m_Importer->Update();
00136 }
00137
00138
00139
00140
00141 }
00142
00143 #endif
00144