• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

tests/itkreader/itkVTKImageToImageFilter.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVTKImageToImageFilter.txx,v $
00005   Language:  C++
00006   Date:      $Date: 2005/06/12 01:23:44 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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 } // end namespace itk
00142 
00143 #endif
00144 

Generated on Wed Sep 8 2010 01:36:51 for DGV by  doxygen 1.7.1