X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Fkernel%2FvtkSTLExtractor.cpp;h=4b3981c9adb66973fdd7d98c834a00e2c95df8c6;hb=542063db4a06b1a74587bcab7d5c450ebdd53272;hp=7d8720df4353372c57f7e05020287154cebd2d15;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/kernel/vtkSTLExtractor.cpp b/lib/maracasVisuLib/src/kernel/vtkSTLExtractor.cpp index 7d8720d..4b3981c 100644 --- a/lib/maracasVisuLib/src/kernel/vtkSTLExtractor.cpp +++ b/lib/maracasVisuLib/src/kernel/vtkSTLExtractor.cpp @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# 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. +# ------------------------------------------------------------------------ */ + #include "vtkSTLExtractor.h" #include @@ -59,12 +84,22 @@ void vtkSTLExtractor::calculate(){ // 1. CALCULATING THE INNER SURFACE // ------------------------------------------------------------------------ vtkImageGaussianSmooth *gaussFilter = vtkImageGaussianSmooth::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 gaussFilter->SetInput(volume); +#else + gaussFilter->SetInputData(volume); +#endif gaussFilter->SetDimensionality(3); gaussFilter->SetStandardDeviation(sigmaLevel); vtkMarchingCubes *cubesFilter = vtkMarchingCubes::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 cubesFilter->SetInput(gaussFilter->GetOutput()); +#else + cubesFilter->SetInputData(gaussFilter->GetOutput()); +#endif cubesFilter->SetValue(0,marchingCubesLevel); cubesFilter->ComputeGradientsOn (); cubesFilter->ComputeScalarsOn (); @@ -72,11 +107,21 @@ void vtkSTLExtractor::calculate(){ // Unir puntos duplicados y remover primitivas degeneradas vtkCleanPolyData *cleanFilter = vtkCleanPolyData::New(); - cleanFilter->SetInput ( cubesFilter->GetOutput() ); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + cleanFilter->SetInput( cubesFilter->GetOutput() ); +#else + cleanFilter->SetInputData( cubesFilter->GetOutput() ); +#endif // crea poligonos triangulares vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 triangleFilter->SetInput( cleanFilter->GetOutput() ); +#else + triangleFilter->SetInputData( cleanFilter->GetOutput() ); +#endif triangleFilter->Update(); innerSurface->DeepCopy(triangleFilter->GetOutput()); @@ -86,9 +131,19 @@ void vtkSTLExtractor::calculate(){ // 2. CALCULATING THE OUTER SURFACE // ------------------------------------------------------------------------ vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New(); - dilateFilter->SetInput (volume); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + dilateFilter->SetInput(volume); +#else + dilateFilter->SetInputData(volume); +#endif dilateFilter->SetKernelSize (3, 3, 3); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 gaussFilter->SetInput( dilateFilter->GetOutput()); +#else + gaussFilter->SetInputData( dilateFilter->GetOutput()); +#endif triangleFilter->Update(); outerSurface->DeepCopy(triangleFilter->GetOutput());