X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkUnMosaic.cxx;h=5e2209f171f5d12157a61c4c2acaeca4b85aed91;hb=36a131a7d47f451563f40b28047200b038905c92;hp=b449f144623ebf411a0d06d133fd4e625e494116;hpb=39eac72f8d3d9a0e5d6088819737d907e6bc5f43;p=bbtk.git diff --git a/packages/vtk/src/bbvtkUnMosaic.cxx b/packages/vtk/src/bbvtkUnMosaic.cxx index b449f14..5e2209f 100644 --- a/packages/vtk/src/bbvtkUnMosaic.cxx +++ b/packages/vtk/src/bbvtkUnMosaic.cxx @@ -1,33 +1,38 @@ -/*========================================================================= +/* + # --------------------------------------------------------------------- + # + # 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: bbvtkUnMosaic.cxx,v $ Language: C++ - Date: $Date: 2011/05/31 09:39:11 $ - Version: $Revision: 1.3 $ + Date: $Date: 2012/11/16 08:51:58 $ + Version: $Revision: 1.4 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* 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 * \brief @@ -108,7 +113,13 @@ vtkImageData * UnMosaic::unMosaic(vtkImageData *imageIn, int nbImagesPerRow, int int outputdims[3]; imageIn->GetDimensions (inputdims); unsigned short *input = (unsigned short *)(imageIn->GetScalarPointer()); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 imageIn->Update(); +#else + // .. +#endif unsigned int div = (unsigned int)ceil(sqrt( (double)numberOfImagesInMosaic ) ); outputdims[0] = inputdims[0] / div; @@ -119,12 +130,21 @@ vtkImageData * UnMosaic::unMosaic(vtkImageData *imageIn, int nbImagesPerRow, int vtkImageOut = vtkImageData::New(); vtkImageOut->SetDimensions( outputdims ); vtkImageOut->SetExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1); - vtkImageOut->SetWholeExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + vtkImageOut->SetWholeExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1); vtkImageOut->SetNumberOfScalarComponents(1); //vtkImageOut->SetSpacing( blabla ); vtkImageOut->SetScalarType( VTK_UNSIGNED_SHORT ); vtkImageOut->AllocateScalars(); vtkImageOut->Update(); +#else + vtkImageOut->AllocateScalars(VTK_UNSIGNED_SHORT,1); +#endif + + + unsigned short *output =(unsigned short *)(vtkImageOut->GetScalarPointer());