X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fitkvtk%2Fsrc%2FbbitkvtkvtkImageDataVector2itkImageVector.cxx;h=793b22d7834a58a4f5ad6a947ace14e8333d13e0;hb=c2d2ccbc4bac635e5d0b802d9830efd94b060dab;hp=678d43c8120ead4b0aa3f2be70cf12d02cafcfa5;hpb=48d234bd8fb5c1251b67a85599f832db414500ad;p=bbtk.git diff --git a/packages/itkvtk/src/bbitkvtkvtkImageDataVector2itkImageVector.cxx b/packages/itkvtk/src/bbitkvtkvtkImageDataVector2itkImageVector.cxx index 678d43c..793b22d 100644 --- a/packages/itkvtk/src/bbitkvtkvtkImageDataVector2itkImageVector.cxx +++ b/packages/itkvtk/src/bbitkvtkvtkImageDataVector2itkImageVector.cxx @@ -1,34 +1,41 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la SantÈ) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + + /*========================================================================= Program: bbtk Module: $RCSfile: bbitkvtkvtkImageDataVector2itkImageVector.cxx,v $ Language: C++ - Date: $Date: 2011/06/16 12:28:57 $ - Version: $Revision: 1.1 $ + Date: $Date: 2012/11/16 08:50:49 $ + Version: $Revision: 1.3 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux -* -* This software is governed by the CeCILL-B license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL-B -* license as circulated by CEA, CNRS and INRIA at the following URL -* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -* or in the file LICENSE.txt. -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL-B license and that you accept its terms. -* ------------------------------------------------------------------------ */ + /** * \file @@ -49,20 +56,21 @@ namespace bbitkvtk BBTK_ADD_BLACK_BOX_TO_PACKAGE(itkvtk,vtkImageDataVector2itkImageVector); -#define BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH_DIM(I,DIM,M) \ - if (I->GetDataDimension()==DIM) \ - { \ - if (I->GetScalarType()==VTK_CHAR) M(); \ - else if (I->GetScalarType()==VTK_SIGNED_CHAR) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_CHAR) M(); \ - else if (I->GetScalarType()==VTK_SHORT) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_SHORT) M(); \ - else if (I->GetScalarType()==VTK_INT) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_INT) M(); \ - else if (I->GetScalarType()==VTK_LONG) M(); \ - else if (I->GetScalarType()==VTK_UNSIGNED_LONG) M(); \ - else if (I->GetScalarType()==VTK_FLOAT) M(); \ - else if (I->GetScalarType()==VTK_DOUBLE) M(); \ +// we assume all the vector elements have the same type +#define BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH_DIM(I,DIM,M) \ + if (I[0]->GetDataDimension()==DIM) \ + { \ + if (I[0]->GetScalarType()==VTK_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_SIGNED_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_CHAR) M(); \ + else if (I[0]->GetScalarType()==VTK_SHORT) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_SHORT) M(); \ + else if (I[0]->GetScalarType()==VTK_INT) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_INT) M(); \ + else if (I[0]->GetScalarType()==VTK_LONG) M(); \ + else if (I[0]->GetScalarType()==VTK_UNSIGNED_LONG) M(); \ + else if (I[0]->GetScalarType()==VTK_FLOAT) M(); \ + else if (I[0]->GetScalarType()==VTK_DOUBLE) M(); \ } #define BBTK_TEMPLATE_VTK_IMAGE_DATA_SWITCH(I,M) \ @@ -135,7 +143,7 @@ namespace bbitkvtk bbtkDebugMessage("process",5," ["<Update(); itkImageType* out = const_cast(conv->GetOutput()); - m_Output_Vector.push_back(conv->GetOutput()); + m_Output_Vector.push_back(out); } catch( itk::ExceptionObject & e)