X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FitkVTKImageToImageFilter.txx;h=27a6595385a3fc2ef2daf2b8d36b318c0edc07e9;hb=02f230e65dbfde06e84da374bb085643e29b5090;hp=7117361cfea035899398e3b320f918919c1ed10e;hpb=758de1c14c7f16d924e1a2a575d52cd3e48ec503;p=clitk.git diff --git a/itk/itkVTKImageToImageFilter.txx b/itk/itkVTKImageToImageFilter.txx index 7117361..27a6595 100644 --- a/itk/itkVTKImageToImageFilter.txx +++ b/itk/itkVTKImageToImageFilter.txx @@ -1,141 +1,144 @@ -/*========================================================================= - - Program: Insight Segmentation & Registration Toolkit - Language: C++ - - Copyright (c) 2002 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#ifndef _itkVTKImageToImageFilter_txx -#define _itkVTKImageToImageFilter_txx - -#include "itkVTKImageToImageFilter.h" - -namespace itk -{ - - - -/** - * Constructor - */ -template -VTKImageToImageFilter -::VTKImageToImageFilter() -{ - - m_Exporter = vtkImageExport::New(); - - m_Importer = ImporterFilterType::New(); - - m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback()); - m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback()); - m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback()); - m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback()); - m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback()); - m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback()); - m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback()); - m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback()); - m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback()); - m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback()); - m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback()); - m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData()); - -} - - - - -/** - * Destructor - */ -template -VTKImageToImageFilter -::~VTKImageToImageFilter() -{ - if ( m_Exporter ) - { - m_Exporter->Delete(); - m_Exporter = 0; - } -} - - - -/** - * Set a vtkImageData as input - */ -template -void -VTKImageToImageFilter -::SetInput( vtkImageData * inputImage ) -{ - m_Exporter->SetInput( inputImage ); -} - - - -/** - * Get an itk::Image as output - */ -template -const typename VTKImageToImageFilter::OutputImageType * -VTKImageToImageFilter -::GetOutput() const -{ - return m_Importer->GetOutput(); -} - - - - -/** - * Get the exporter filter - */ -template -vtkImageExport * -VTKImageToImageFilter -::GetExporter() const -{ - return m_Exporter; -} - - - -/** - * Get the importer filter - */ -template -typename VTKImageToImageFilter::ImporterFilterType * -VTKImageToImageFilter -::GetImporter() const -{ - return m_Importer; -} - - - - -/** - * Delegate the Update to the importer - */ -template -void -VTKImageToImageFilter -::Update() -{ - m_Importer->Update(); -} - - - - -} // end namespace itk - -#endif - +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ +#ifndef _itkVTKImageToImageFilter_txx +#define _itkVTKImageToImageFilter_txx +#include "itkVTKImageToImageFilter.h" + +namespace itk +{ + + + +/** + * Constructor + */ +template +VTKImageToImageFilter +::VTKImageToImageFilter() +{ + + m_Exporter = vtkImageExport::New(); + + m_Importer = ImporterFilterType::New(); + + m_Importer->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback()); + m_Importer->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback()); + m_Importer->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback()); + m_Importer->SetSpacingCallback( m_Exporter->GetSpacingCallback()); + m_Importer->SetOriginCallback( m_Exporter->GetOriginCallback()); + m_Importer->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback()); + m_Importer->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback()); + m_Importer->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback()); + m_Importer->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback()); + m_Importer->SetDataExtentCallback( m_Exporter->GetDataExtentCallback()); + m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback()); + m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData()); + +} + + + + +/** + * Destructor + */ +template +VTKImageToImageFilter +::~VTKImageToImageFilter() +{ + if ( m_Exporter ) { + m_Exporter->Delete(); + m_Exporter = 0; + } +} + + + +/** + * Set a vtkImageData as input + */ +template +void +VTKImageToImageFilter +::SetInput( vtkImageData * inputImage ) +{ + m_Exporter->SetInput( inputImage ); +} + + + +/** + * Get an itk::Image as output + */ +template +//const +typename VTKImageToImageFilter::OutputImageType * +VTKImageToImageFilter +::GetOutput() const +{ + return m_Importer->GetOutput(); +} + + + + +/** + * Get the exporter filter + */ +template +vtkImageExport * +VTKImageToImageFilter +::GetExporter() const +{ + return m_Exporter; +} + + + +/** + * Get the importer filter + */ +template +typename VTKImageToImageFilter::ImporterFilterType * +VTKImageToImageFilter +::GetImporter() const +{ + return m_Importer; +} + + + + +/** + * Delegate the Update to the importer + */ +template +void +VTKImageToImageFilter +::Update() +{ + m_Importer->Update(); +} + + + + +} // end namespace itk + +#endif +