diff --git a/Common/Examples/CheckOrientation.cxx b/Common/Examples/CheckOrientation.cxx index df9ddd5..a76cf8d 100644 --- a/Common/Examples/CheckOrientation.cxx +++ b/Common/Examples/CheckOrientation.cxx @@ -3,23 +3,24 @@ * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include #include @@ -31,7 +32,7 @@ int main( int argc, char *argv[] ) { if (argc < 2) { - cout << "Usage : CheckOrientation input" << endl; + std::cout << "Usage : CheckOrientation input" << std::endl; exit (1); } vtkSurface *Mesh = vtkSurface::New(); diff --git a/Common/Examples/CleanMesh.cxx b/Common/Examples/CleanMesh.cxx index d88289e..04d65a8 100644 --- a/Common/Examples/CleanMesh.cxx +++ b/Common/Examples/CleanMesh.cxx @@ -20,10 +20,14 @@ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ +#include #include #include "vtkSurface.h" #include "RenderWindow.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<3) diff --git a/Common/Examples/ExamplevtkSurface.cxx b/Common/Examples/ExamplevtkSurface.cxx index 83b69a8..43586a0 100644 --- a/Common/Examples/ExamplevtkSurface.cxx +++ b/Common/Examples/ExamplevtkSurface.cxx @@ -3,27 +3,31 @@ * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include "vtkSurface.h" #include "RenderWindow.h" +using std::cout; +using std::endl; + void traverse( vtkSurface *test ) { vtkIdType v1,v2,v3; // stockage de l'identite de points @@ -77,7 +81,7 @@ int main( int argc, char *argv[] ) // points and cells definitions static double x[7][3]={{0,0,1},{0.707,0.707,0},{0.707,-0.707,0},{-0.707,-0.707,0},{-0.707,0.707,0},{0,0,-1}, {0,0,2}}; - static int pts[12][3]={{0,1,2},{0,2,3},{0,3,4},{0,4,1},{5,1,2},{5,2,3},{5,3,4},{5,4,1},{6,1,2},{6,2,3},{6,3,4},{6,4,1} }; + static int pts[12][3]={{0,1,2},{0,2,3},{0,3,4},{0,4,1},{5,1,2},{5,2,3},{5,3,4},{5,4,1},{6,1,2},{6,2,3},{6,3,4},{6,4,1} }; vtkSurface *test=vtkSurface::New(); @@ -85,7 +89,7 @@ int main( int argc, char *argv[] ) for (int i=0;i<7;i++) test->AddVertex(x[i]); // create triangles - for (int i=0;i<6;i++) + for (int i=0;i<6;i++) test->AddFace(pts[i][0],pts[i][1],pts[i][2]); traverse( test ); @@ -98,7 +102,7 @@ int main( int argc, char *argv[] ) Window->Interact(); // add more triangles - for (int i=6;i<8;i++) + for (int i=6;i<8;i++) test->AddFace(pts[i][0],pts[i][1],pts[i][2]); traverse( test ); @@ -111,13 +115,13 @@ int main( int argc, char *argv[] ) for (int i=0;i<4;i++) test->DeleteFace( i ); traverse( test ); - + //render again Window->Render(); Window->Interact(); // add more triangles - for (int i=8;i<12;i++) + for (int i=8;i<12;i++) test->AddFace(pts[i][0],pts[i][1],pts[i][2]); traverse( test ); diff --git a/Common/Examples/ManifoldSimplification.cxx b/Common/Examples/ManifoldSimplification.cxx index 043245f..42da607 100644 --- a/Common/Examples/ManifoldSimplification.cxx +++ b/Common/Examples/ManifoldSimplification.cxx @@ -13,33 +13,37 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ // .NAME ManifoldSimplification // .SECTION Description +#include #include #include "vtkManifoldSimplification.h" +using std::cout; +using std::endl; + ///////////////////////////////////////////////////////////////////////////////////////// // ManifoldSimplification program: ///////////////////////////////////////////////////////////////////////////////////////// -// +// // Coarsening of triangular meshes // This program should be run with 2 arguments: // run: "ManifoldSimplification file nvertices" diff --git a/Common/Examples/RandomTriangulation.cxx b/Common/Examples/RandomTriangulation.cxx index d503dce..b049ca8 100644 --- a/Common/Examples/RandomTriangulation.cxx +++ b/Common/Examples/RandomTriangulation.cxx @@ -13,30 +13,34 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME meshviewer +// .NAME meshviewer // .SECTION Description +#include #include #include "vtkSurface.h" #include "RenderWindow.h" #include "vtkRandomTriangulation.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<3) @@ -51,25 +55,25 @@ int main( int argc, char *argv[] ) cout<<"4 : half pipe cut on one corner"<BuildRandomTriangulation(atoi(argv[1]),atoi(argv[2])); - + Mesh->DisplayMeshProperties(); - + RenderWindow *Window=RenderWindow::New(); Window->SetInputData(Mesh); Window->Render(); Window->Interact(); - + vtkPLYWriter *Writer=vtkPLYWriter::New(); Writer->SetInputData(Mesh); Writer->SetFileName("mesh.ply"); Writer->Write(); Writer->Delete(); - + Mesh->Delete(); - Window->Delete(); + Window->Delete(); return (0); -} - +} + diff --git a/Common/Examples/clipMesh.cxx b/Common/Examples/clipMesh.cxx index b90062b..73e33c0 100644 --- a/Common/Examples/clipMesh.cxx +++ b/Common/Examples/clipMesh.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ // .NAME clipMesh // .SECTION Description +#include #include #include #include @@ -41,6 +42,9 @@ Author: Sebastien Valette #include "vtkSurface.h" #include "RenderWindow.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc < 3 ) { diff --git a/Common/Examples/icp.cxx b/Common/Examples/icp.cxx index 9d42f1c..25e09c3 100644 --- a/Common/Examples/icp.cxx +++ b/Common/Examples/icp.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME icp +// .NAME icp // .SECTION Description +#include #include #include #include @@ -40,6 +41,9 @@ Author: Sebastien Valette #include "vtkSurface.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc < 3 ) { diff --git a/Common/Examples/mesh2obj.cxx b/Common/Examples/mesh2obj.cxx index 0ed38b1..f2d97f2 100644 --- a/Common/Examples/mesh2obj.cxx +++ b/Common/Examples/mesh2obj.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME mesh2obj +// .NAME mesh2obj // .SECTION Description +#include #include "vtkSurface.h" #include @@ -47,18 +48,18 @@ int main( int argc, char *argv[] ) if (argc<2) { - cout<<"Usage : mesh2obj inputmesh"<CreateFromFile(argv[1]); vtkOBJWriter *Writer=vtkOBJWriter::New(); Writer->SetInputData(Mesh); Writer->SetFileName("mesh.obj"); Writer->Write(); - cout<<"conversion to mesh.obj finished!"< #include "vtkSurface.h" #include "vtkOFFWriter.h" @@ -41,6 +42,9 @@ Author: Sebastien Valette /// where inputfile is a mesh /// the output is mesh.vtk +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { vtkSurface *Mesh; diff --git a/Common/Examples/mesh2ply.cxx b/Common/Examples/mesh2ply.cxx index cbaec87..5254585 100644 --- a/Common/Examples/mesh2ply.cxx +++ b/Common/Examples/mesh2ply.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME mesh2ply +// .NAME mesh2ply // .SECTION Description +#include #include "vtkSurface.h" #include #include @@ -42,6 +43,9 @@ Author: Sebastien Valette /// where inputfile is a mesh /// the output is mesh.vtk +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { diff --git a/Common/Examples/mesh2stl.cxx b/Common/Examples/mesh2stl.cxx index 3c900fd..c5761c2 100644 --- a/Common/Examples/mesh2stl.cxx +++ b/Common/Examples/mesh2stl.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME mesh2vtk +// .NAME mesh2vtk // .SECTION Description +#include #include "vtkSurface.h" #include @@ -41,6 +42,9 @@ Author: Sebastien Valette /// where inputfile is a mesh /// the output is mesh.vtk +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { vtkSurface *Mesh; diff --git a/Common/Examples/mesh2vtk.cxx b/Common/Examples/mesh2vtk.cxx index 804666b..00f484e 100644 --- a/Common/Examples/mesh2vtk.cxx +++ b/Common/Examples/mesh2vtk.cxx @@ -13,29 +13,33 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME mesh2vtk +// .NAME mesh2vtk // .SECTION Description +#include #include "vtkSurface.h" #include +using std::cout; +using std::endl; + /// a simple mesh consersion tool /// Usage : mesh2vtk inputfile /// where inputfile is a mesh diff --git a/Common/Examples/meshComponents.cxx b/Common/Examples/meshComponents.cxx index 79734ac..5615d98 100644 --- a/Common/Examples/meshComponents.cxx +++ b/Common/Examples/meshComponents.cxx @@ -13,29 +13,32 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME meshComponents +// .NAME meshComponents // .SECTION Description +#include #include "vtkSurface.h" #include +using std::cout; +using std::endl; int main( int argc, char *argv[] ) { diff --git a/Common/Examples/meshCurvature.cxx b/Common/Examples/meshCurvature.cxx index 8129ced..b20e0a5 100644 --- a/Common/Examples/meshCurvature.cxx +++ b/Common/Examples/meshCurvature.cxx @@ -33,11 +33,15 @@ Author: Sebastien Valette // .NAME meshCurvature // .SECTION Description +#include #include #include #include "vtkSurface.h" #include "vtkCurvatureMeasure.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { diff --git a/Common/Examples/meshDifference.cxx b/Common/Examples/meshDifference.cxx index ca2fe9c..9c10105 100644 --- a/Common/Examples/meshDifference.cxx +++ b/Common/Examples/meshDifference.cxx @@ -13,31 +13,34 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME meshDifference +// .NAME meshDifference // .SECTION Description +#include #include #include "vtkSurface.h" #include #include +using std::cout; +using std::endl; int main( int argc, char *argv[] ) { @@ -88,7 +91,7 @@ int main( int argc, char *argv[] ) averageDisplacements->SetNumberOfComponents( 3 ); averageDisplacements->SetNumberOfTuples( numberOfPoints ); double d[ 3 ] = { 0, 0, 0}; - + for ( int j = 0; j < numberOfPoints; j++ ) { maxErrors->SetValue( j, 0 ); averageErrors->SetValue( j, 0 ); diff --git a/Common/Examples/sampleMesh.cxx b/Common/Examples/sampleMesh.cxx index 02ebcea..0851c56 100644 --- a/Common/Examples/sampleMesh.cxx +++ b/Common/Examples/sampleMesh.cxx @@ -9,11 +9,15 @@ Auteur: Sebastien Valette // .NAME sampleMesh // .SECTION Description +#include #include #include #include #include "vtkSurface.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc < 3) { diff --git a/Common/Examples/stl2ply.cxx b/Common/Examples/stl2ply.cxx index cf4b95c..0f347e0 100644 --- a/Common/Examples/stl2ply.cxx +++ b/Common/Examples/stl2ply.cxx @@ -13,30 +13,34 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ // .NAME stl2ply // .SECTION Description +#include #include #include #include +using std::cout; +using std::endl; + /// a simple mesh consersion tool /// Usage : stl2ply inputfile /// where inputfile is a mesh in stl format diff --git a/Common/Examples/subdivideMesh.cxx b/Common/Examples/subdivideMesh.cxx index f641bca..3db7fc8 100644 --- a/Common/Examples/subdivideMesh.cxx +++ b/Common/Examples/subdivideMesh.cxx @@ -13,29 +13,33 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME subdivideMesh +// .NAME subdivideMesh // .SECTION Description +#include #include "vtkSurface.h" #include "RenderWindow.h" +using std::cout; +using std::endl; + /// A simple example of mesh subdivision (mostly for benchmarking...) /// Usage : subdivideMesh mesh n diff --git a/Common/Examples/subdivideMesh2.cxx b/Common/Examples/subdivideMesh2.cxx index 94260ff..1cd21ea 100644 --- a/Common/Examples/subdivideMesh2.cxx +++ b/Common/Examples/subdivideMesh2.cxx @@ -13,31 +13,35 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ // .NAME subdivideMesh2 // .SECTION Description +#include #include #include #include "vtkSurface.h" #include "RenderWindow.h" +using std::cout; +using std::endl; + /// A simple example of mesh subdivision (mostly for benchmarking...) /// Usage : subdivideMesh mesh type n diff --git a/Common/Examples/viewer.cxx b/Common/Examples/viewer.cxx index 4763878..edae566 100644 --- a/Common/Examples/viewer.cxx +++ b/Common/Examples/viewer.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME meshviewer +// .NAME meshviewer // .SECTION Description +#include #include "vtkSurface.h" #include "RenderWindow.h" @@ -48,10 +49,10 @@ int main( int argc, char *argv[] ) for (int i=0;iCreateFromFile(argv[i+1]); // prints to standard output the mesh caracteristics @@ -61,7 +62,7 @@ int main( int argc, char *argv[] ) Window[i]=RenderWindow::New(); Window[i]->SetInputData(Mesh); - // synchronize the viewport with the first created window + // synchronize the viewport with the first created window if (i>0) Window[i]->AttachToRenderWindow(Window[0]); @@ -72,7 +73,7 @@ int main( int argc, char *argv[] ) // start interaction Window[0]->Interact(); - + // Delete objects before exit for (int i=0;iDelete(); diff --git a/Common/Examples/viewer2.cxx b/Common/Examples/viewer2.cxx index 28df628..ccb33cf 100644 --- a/Common/Examples/viewer2.cxx +++ b/Common/Examples/viewer2.cxx @@ -13,26 +13,27 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME meshviewer +// .NAME meshviewer // .SECTION Description +#include #include "vtkSurface.h" #include "RenderWindow.h" #include "vtkOBJExporter.h" @@ -50,7 +51,7 @@ int main( int argc, char *argv[] ) { // Load the mesh and create the vtkSurface data structure Mesh=vtkSurface::New(); - cout <<"load : "<CreateFromFile(argv[i+1]); // prints to standard output the mesh caracteristics @@ -69,13 +70,13 @@ int main( int argc, char *argv[] ) // start display and interaction Window->Render(); Window->Interact(); - + vtkOBJExporter *Export=vtkOBJExporter::New(); Export->SetInput(Window->GetvtkRenderWindow()); Export->SetFilePrefix("export"); Export->Write(); - - + + Window->Delete(); return (0); } diff --git a/Common/Examples/vtk2ply.cxx b/Common/Examples/vtk2ply.cxx index ef8a6d6..5ca3ea2 100644 --- a/Common/Examples/vtk2ply.cxx +++ b/Common/Examples/vtk2ply.cxx @@ -13,30 +13,34 @@ Author: Sebastien Valette * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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. -* ------------------------------------------------------------------------ */ +* ------------------------------------------------------------------------ */ -// .NAME mesh2vtk +// .NAME mesh2vtk // .SECTION Description +#include #include #include #include +using std::cout; +using std::endl; + /// a simple mesh consersion tool /// Usage : vtk2ply inputfile /// where inputfile is a mesh diff --git a/Common/RenderWindow.cxx b/Common/RenderWindow.cxx index 135901a..c4c8794 100644 --- a/Common/RenderWindow.cxx +++ b/Common/RenderWindow.cxx @@ -31,6 +31,7 @@ #include #endif +#include #include #include #include @@ -70,6 +71,10 @@ #include "RenderWindow.h" #include "vtkSurfaceIterators.h" +using std::cout; +using std::cin; +using std::endl; + #define _RANDOM_SEED 1000 class MyInteractorStyleTrackballCamera:public diff --git a/Common/vtkCurvatureMeasure.cxx b/Common/vtkCurvatureMeasure.cxx index 40ca6a5..77ad53d 100644 --- a/Common/vtkCurvatureMeasure.cxx +++ b/Common/vtkCurvatureMeasure.cxx @@ -3,7 +3,7 @@ vtkCurvatureMeasure.h - description ------------------- begin : July 10 2005 copyright : (C) 2005 by Sebastien Valette -email : +email : ***************************************************************************/ /* --------------------------------------------------------------------- @@ -11,23 +11,24 @@ email : * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include #include @@ -39,6 +40,9 @@ email : #define DISPLAYINTERVAL 10000 +using std::cout; +using std::endl; + /// this class is made to compute curvature measure of a vtkIdList with polynomial fitting /// It was created to ease mumtithreading class vtkSinglePolynomialMeasure:public vtkObject @@ -50,8 +54,8 @@ class vtkSinglePolynomialMeasure:public vtkObject this->Input = Input; }; - // Computes the curvature for a given group of triangles. Returns sqrt(c1^2+c2^2) where c1 and c2 are - // principal curvatures. Can also write the two principal directions and Curvatures if the second parameter is provided. + // Computes the curvature for a given group of triangles. Returns sqrt(c1^2+c2^2) where c1 and c2 are + // principal curvatures. Can also write the two principal directions and Curvatures if the second parameter is provided. // Principal directions and curvatures are stored this way : c1,x1,y1,z1,c2,x2,y2,z2; double ComputeFitting (vtkIdList * FList, double *CurvatureInfo = 0); @@ -948,15 +952,15 @@ vtkCurvatureMeasure::ComputeCurvatureIndicatorWithPolynomialFitting () this->StartTime = this->Timer->GetCurrentTime (); #endif vtkMultiThreader *Threader=vtkMultiThreader::New(); - + Threader->SetSingleMethod (ThreadedCurvatureComputation, (void *) this); if (this->NumberOfThreads) Threader->SetNumberOfThreads (this->NumberOfThreads); Threader->SingleMethodExecute (); cout << (char) 13; - + Threader->Delete(); - + if (NumberOfBadMatrices > 0) { cout << endl << NumberOfBadMatrices << @@ -1184,18 +1188,18 @@ vtkCurvatureMeasure::vtkCurvatureMeasure () this->DisplayCurvatureInfoFlag = 0; this->ComputeCurvatureInfoFlag = 1; this->CellsCurvatureInfo = 0; - + this->StatisticsLock = new std::mutex(); this->Timer = vtkTimerLog::New (); this->NumberOfBadMatrices = 0; - this->NumberOfCellsWithSmallNeighbourhood = 0; + this->NumberOfCellsWithSmallNeighbourhood = 0; } vtkCurvatureMeasure::~vtkCurvatureMeasure () { delete this->StatisticsLock; this->Timer->Delete (); - + if (this->CurvatureCollection) this->CurvatureCollection->Delete(); if (this->CellsCurvatureIndicator) diff --git a/Common/vtkNeighbourhoodComputation.cxx b/Common/vtkNeighbourhoodComputation.cxx index ae99e6a..3a393d1 100644 --- a/Common/vtkNeighbourhoodComputation.cxx +++ b/Common/vtkNeighbourhoodComputation.cxx @@ -3,34 +3,37 @@ vtkNeighbourhoodComputation.h - description ------------------- begin : January 4 2006 copyright : (C) 2006 by Sebastien Valette -email : +email : ***************************************************************************/ /* --------------------------------------------------------------------- * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include "vtkMath.h" #include "vtkNeighbourhoodComputation.h" +using std::cout; +using std::endl; void vtkNeighbourhoodComputation::ComputeNRingCells(vtkIdType Cell,int RingSize, vtkIdList *FList) { @@ -66,8 +69,8 @@ void vtkNeighbourhoodComputation::ComputeNRingCells(vtkIdType Cell,int RingSize, { VList2->Reset(); for (k=0;kGetNumberOfIds();k++) - { - v1=VList->GetId(k); + { + v1=VList->GetId(k); if (!VisitedVertices->IsTagged(v1)) { VisitedVertices->Tag(v1); @@ -211,7 +214,7 @@ vtkNeighbourhoodComputation* vtkNeighbourhoodComputation::New() void vtkNeighbourhoodComputation::SetInputData(vtkSurface *Mesh) { this->Input=Mesh; - + // Allocate the arrays with respect to the input mesh this->VisitedCells->SetNumberOfItems(Mesh->GetNumberOfCells()); this->VisitedVertices->SetNumberOfItems(Mesh->GetNumberOfPoints()); diff --git a/Common/vtkOFFReader.cxx b/Common/vtkOFFReader.cxx index 6a9dcc0..8ccb12b 100644 --- a/Common/vtkOFFReader.cxx +++ b/Common/vtkOFFReader.cxx @@ -23,23 +23,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include #include @@ -47,6 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "vtkOFFReader.h" +using std::cout; +using std::cerr; + #ifdef read #undef read #endif @@ -79,7 +83,7 @@ vtkOFFReader::vtkOFFReader() //---------------------------------------------------------------------------- vtkOFFReader::~vtkOFFReader() -{ +{ if (this->FileName) { delete [] this->FileName; @@ -113,7 +117,7 @@ int vtkOFFReader::RequestData(vtkInformation* vtkNotUsed(request), int NumberOfPoints; int NumberOfCells; - float tampon; + float tampon; // ouverture pas propre stream = fopen(this->FileName, "r" ); @@ -127,7 +131,7 @@ int vtkOFFReader::RequestData(vtkInformation* vtkNotUsed(request), UnusedResult=fscanf( stream, "%d", &buffer); NumberOfPoints = buffer; -#if ALEX_DEBUG +#if ALEX_DEBUG cout << "nb de points " << buffer << endl; #endif @@ -151,14 +155,14 @@ int vtkOFFReader::RequestData(vtkInformation* vtkNotUsed(request), for (i=0;iInsertNextCell(CellType,Temp_Cell); - + if (this->InfoOnCells) { // * lecture de ce qui reste, et on jete * @@ -224,16 +228,16 @@ int vtkOFFReader::RequestData(vtkInformation* vtkNotUsed(request), } } - + // fermeture du fichier fclose( stream ); - + } - + // copy de la liste de points dans la structure et desallocation de la memoire output_mesh->SetPoints(temp_points); temp_points->Delete(); - + // copy de la liste de cellules dans la structure et desallocation de la memoire output_mesh->SetPolys(temp_cells); temp_cells->Delete(); diff --git a/Common/vtkRandomTriangulation.cxx b/Common/vtkRandomTriangulation.cxx index 5356803..bcd5dd4 100644 --- a/Common/vtkRandomTriangulation.cxx +++ b/Common/vtkRandomTriangulation.cxx @@ -3,23 +3,24 @@ * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include #include @@ -68,18 +69,18 @@ vtkSurface *vtkRandomTriangulation::BuildRandomTriangulation (int NumberOfPoints Mesh->AddVertex (0, 0, 0); Mesh->AddVertex (1, 0, 0); Mesh->AddVertex (0.5, 0.866, 0); - + Mesh->AddFace (0, 1, 2); - + Mesh->SubdivideInPlace(); Mesh->SubdivideInPlace(); Mesh->SubdivideInPlace(); Mesh->SubdivideInPlace(); - + Mesh->AddVertex (0.5, 0.289, 0); Mesh->AddVertex (0,1, 0); Mesh->AddVertex (1,1, 0); - + vtkDelaunay2D *Delaunay = vtkDelaunay2D::New (); vtkPolyData *Poly = vtkPolyData::New (); Poly->SetPoints(Mesh->GetPoints()); @@ -88,11 +89,11 @@ vtkSurface *vtkRandomTriangulation::BuildRandomTriangulation (int NumberOfPoints Delaunay->Update (); vtkSurface *Mesh2 = vtkSurface::New (); Mesh2->CreateFromPolyData (Delaunay->GetOutput ()); - + return (Mesh2); } - + if (Type == 5) { vtkSurface *Mesh = vtkSurface::New (); @@ -128,7 +129,7 @@ vtkSurface *vtkRandomTriangulation::BuildRandomTriangulation (int NumberOfPoints int i; double P[3]; - cout << Mesh->GetNumberOfPoints () << " points" << endl; + std::cout << Mesh->GetNumberOfPoints () << " points" << endl; for (i = 0; i < Mesh->GetNumberOfPoints (); i++) { Mesh->GetPoint (i, P); diff --git a/Common/vtkSurface.cxx b/Common/vtkSurface.cxx index 3f201e2..557f646 100644 --- a/Common/vtkSurface.cxx +++ b/Common/vtkSurface.cxx @@ -20,6 +20,7 @@ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ +#include #include #include #include @@ -58,6 +59,9 @@ #include "RenderWindow.h" #endif +using std::cout; +using std::endl; + bool sortByDecreasingSecond( const std::pair< int,int > &a, const std::pair< int,int > &b ) { return ( a.second > b.second ); } diff --git a/Common/vtkSurfaceBase.cxx b/Common/vtkSurfaceBase.cxx index d0b08e3..d15e0ad 100644 --- a/Common/vtkSurfaceBase.cxx +++ b/Common/vtkSurfaceBase.cxx @@ -3,23 +3,24 @@ * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) * Author : Sebastien Valette * -* 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 +* 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. +* 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 #include #include #include @@ -30,6 +31,9 @@ #include "vtkSurfaceBase.h" +using std::cout; +using std::endl; + void vtkSurfaceBase::DisplayInternals( bool exitOnError ) { cout << "********************************************" << endl; @@ -89,7 +93,7 @@ vtkIdType vtkSurfaceBase::BisectEdge(vtkIdType e) vtkIdList *FList=vtkIdList::New(); this->GetEdgeVertices(e,v1,v2); this->GetEdgeFaces(e,FList); - + double P1[3]; double P2[3]; @@ -109,7 +113,7 @@ vtkIdType vtkSurfaceBase::BisectEdge(vtkIdType e) vtkIdType Face=FList->GetId(i); v3=this->GetThirdPoint(Face,v1,v2); this->DeleteFaceInRing(Face,this->IsEdge(v1,v3)); - + vtkIdType ve1,ve2,ve3; this->GetFaceVertices(Face,ve1,ve2,ve3); if (((ve1==v1)&&(ve2==v2)) @@ -127,7 +131,7 @@ vtkIdType vtkSurfaceBase::BisectEdge(vtkIdType e) this->AddEdge(v3,NewVertex,Face); } - + this->InsertEdgeInRing(e,NewVertex); FList->Delete(); @@ -258,13 +262,13 @@ bool vtkSurfaceBase::IsVertexManifold( const vtkIdType& iV ) vtkIdType FirstEdge,FirstVertex; vtkIdType f1,f2,f3; vtkIdType *Edges,NumberOfRemainingEdges; - + this->GetVertexNeighbourEdges(iV,NumberOfRemainingEdges,Edges); // if there is only one edge, the vertex is non manifold if (NumberOfRemainingEdges<2) return (false); - + // detect non-manifold edges for (vtkIdType i=0;iGetEdgeFaces(FirstEdge,f1,f2); - + // turn in the first direction v2=this->GetThirdPoint(f1,iV,FirstVertex); do @@ -306,7 +310,7 @@ bool vtkSurfaceBase::IsVertexManifold( const vtkIdType& iV ) Conquer(f2,iV,v2,f3,v1); f2=f3; v2=v1; - + } while ((f2>=0)&&(v2!=FirstVertex)); // all adjacent faces have been visited, but there are edges remaining, so return false return (false); @@ -325,7 +329,7 @@ void vtkSurfaceBase::SwitchOrientation() for (i=0;iCheckNormals(); + this->CheckNormals(); delete [] Vertices2; } @@ -425,7 +429,7 @@ double vtkSurfaceBase::GetValenceEntropy() int v1; // Valence of given point double inv_number; // 1.0 / number of points double inv_Log2; // 1.0 / log(2.0) - double s; // + double s; // double p; // // Array of valences, indexed by point's ID @@ -576,7 +580,7 @@ void vtkSurfaceBase::DeleteFace(vtkIdType f1) { // test whether the face was already deleted if (this->IsFaceActive(f1)==0) return; - + vtkIdType NumberOfPoints,*Points; this->GetFaceVertices(f1,NumberOfPoints,Points); @@ -615,9 +619,9 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) { vtkIdList *List=vtkIdList::New(); vtkIdList *List2=vtkIdList::New(); - + vtkIdType e=this->IsEdge(v1,v2); - + // delete polygons adjacent to the edge [v1 v2] (if there are any) if (e>=0) { @@ -625,7 +629,7 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) for (int i=0;iGetNumberOfIds();i++) this->DeleteFace(List->GetId(i)); } - + // for each remaining face adjacent to v2, replace v2 by v1 this->GetVertexNeighbourFaces(v2,List); for (vtkIdType i=0;iGetNumberOfIds();i++) @@ -635,7 +639,7 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) GetFaceVertices(List->GetId(i), NumberOfVertices, Vertices); Vertices[FindVertexIndex (Vertices,v2,NumberOfVertices)]=v1; } - + // Modify every edge adjacent to v2 this->GetVertexNeighbourEdges(v2,List); for (vtkIdType i=0;iGetNumberOfIds();i++) @@ -650,7 +654,7 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) v3=v4; v4=Vertex; } - + vtkIdType Edge2; Edge2=this->IsEdge(v1,v4); if (Edge2>=0) @@ -664,7 +668,7 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) this->DeleteFaceInRing(Face,e); this->InsertFaceInRing(Face,Edge2); } - + // delete [v2 v4] this->DeleteEdge(e); } @@ -679,7 +683,7 @@ void vtkSurfaceBase::MergeVertices(vtkIdType v1, vtkIdType v2) this->InsertEdgeInRing(e,v1); } } - + this->DeleteVertex(v2); List->Delete(); List2->Delete(); @@ -723,32 +727,32 @@ vtkIdType vtkSurfaceBase::IsFace(const vtkIdType &v1, const vtkIdType &v2, const vtkIdType f2; int F; edge = this->IsEdge(v1,v2); - + // test if the edge [v1v2] exists or not - if (edge<0) + if (edge<0) return (-1); this->GetEdgeFaces(edge,f1,f2); - + // test whether the edge [v1v2] is isolated or not - if (f1<0) + if (f1<0) return (-1); - - if (v3 == this->GetThirdPoint(f1,v1,v2)) + + if (v3 == this->GetThirdPoint(f1,v1,v2)) return (f1); - + // test whether if there is another adjacent face - if (f2<0) + if (f2<0) return (-1); - if (v3==this->GetThirdPoint(f2,v1,v2)) + if (v3==this->GetThirdPoint(f2,v1,v2)) return (f2); // test whether there are non-manifold adjacent faces vtkIdList *FList2=this->Edges[edge].NonManifoldFaces; if (FList2==0) return (-1); - + int NumberOfFaces=FList2->GetNumberOfIds()-1; for (;NumberOfFaces!=-1;NumberOfFaces--) { @@ -763,16 +767,16 @@ void vtkSurfaceBase :: GetFaceNeighbours(vtkIdType Face,vtkIdListCollection *FLi { vtkIdType v0,v1,v2; vtkIdType e0,e1,e2; - + vtkIdList *e0Face = vtkIdList :: New(); vtkIdList *e1Face = vtkIdList :: New(); vtkIdList *e2Face = vtkIdList :: New(); - + this->GetFaceVertices(Face,v0,v1,v2); e0=this->IsEdge(v0,v1); e1=this->IsEdge(v0,v2); e2=this->IsEdge(v1,v2); - + if(e0!=-1) { this->GetEdgeFaces(e0,e0Face); @@ -790,7 +794,7 @@ void vtkSurfaceBase :: GetFaceNeighbours(vtkIdType Face,vtkIdListCollection *FLi this->GetEdgeFaces(e2,e2Face); FList->AddItem(e2Face); } - + e0Face->Delete(); e1Face->Delete(); e2Face->Delete(); @@ -969,7 +973,7 @@ void vtkSurfaceBase::GetVertexNeighbourFaces(const vtkIdType &v1, vtkIdList *Out this->GetEdgeFaces(Edges[i],f1,f2); if (f1>=0) Output->InsertUniqueId(f1); if (f2>=0) Output->InsertUniqueId(f2); - + vtkIdList *OtherFaces=this->Edges[Edges[i]].NonManifoldFaces; if (OtherFaces) { @@ -1026,9 +1030,9 @@ vtkIdType vtkSurfaceBase::IsEdgeBetweenFaces(const vtkIdType &f1, const vtkIdTyp vtkIdType *Vertices2; vtkIdType NumberOfVertices2; this->GetFaceVertices(f2,NumberOfVertices2,Vertices2); - + vtkIdType Vertices[2]; - + int Count=0; for (vtkIdType i=0;iIsEdge(Vertices[0],Vertices[1])); + return (this->IsEdge(Vertices[0],Vertices[1])); } return (-1); } @@ -1121,7 +1125,7 @@ void vtkSurfaceBase::DeleteFaceInRing(const vtkIdType &Face, const vtkIdType &e) } vtkIdType Index=FList->IsId(Face); if (Index>=0) - FList->DeleteId(Face); + FList->DeleteId(Face); else { int LastPosition=FList->GetNumberOfIds()-1; @@ -1233,13 +1237,13 @@ vtkIdType vtkSurfaceBase::AddPolygon(int NumberOfVertices,vtkIdType *Vertices) { vtkIdType face; int Type=0; - + // Check if the vertices of the polygon have been created - + for (int i=0;i=this->GetNumberOfPoints()) - Type=99; + Type=99; } if (Type) { @@ -1251,7 +1255,7 @@ vtkIdType vtkSurfaceBase::AddPolygon(int NumberOfVertices,vtkIdType *Vertices) exit(1); } - + switch (NumberOfVertices) { case 3: @@ -1453,7 +1457,7 @@ void vtkSurfaceBase::CreateFromPolyData(vtkPolyData *input) { // The face is not used. Let's push it in the garbage collector this->ActivePolygons->SetValue(i,0); - this->CellsGarbage[NumberOfVertices].push(i); + this->CellsGarbage[NumberOfVertices].push(i); } } @@ -1471,13 +1475,13 @@ vtkSurfaceBase::vtkSurfaceBase() // vertices attributes this->ActiveVertices = vtkBitArray::New(); - // faces attributes + // faces attributes this->VisitedPolygons = vtkBitArray::New(); this->ActivePolygons = vtkBitArray::New(); this->CleanEdges=1; this->CleanVertices=0; - + this->Init(50,100,150); } diff --git a/Common/vtkUniformClustering.h b/Common/vtkUniformClustering.h index a1b124f..4d17021 100644 --- a/Common/vtkUniformClustering.h +++ b/Common/vtkUniformClustering.h @@ -33,6 +33,7 @@ #ifndef _VTKUNIFORMCLUSTERING_H_ #define _VTKUNIFORMCLUSTERING_H_ +#include #include #include #include @@ -41,6 +42,9 @@ #include #include "RenderWindow.h" +using std::cout; +using std::endl; + /// A Class to process uniform clustering, Implemented from the paper: /// "Approximated Centroidal Voronoi Diagrams for Uniform Polygonal Mesh Coarsening" /// [Valette & Chassery, Eurographics 2004] diff --git a/DiscreteRemeshing/vtkDiscreteRemeshing.h b/DiscreteRemeshing/vtkDiscreteRemeshing.h index 968710c..b52a71b 100644 --- a/DiscreteRemeshing/vtkDiscreteRemeshing.h +++ b/DiscreteRemeshing/vtkDiscreteRemeshing.h @@ -31,6 +31,7 @@ #ifndef _VTKDISCRETEREMESHING_H_ #define _VTKDISCRETEREMESHING_H_ +#include #include #include #include @@ -45,6 +46,8 @@ #include "vtkCurvatureMeasure.h" #include "vtkTag.h" +using std::cin; + // A Class to process coarsening of vtkSurface PolyData. It derives from vtkSurfaceClustering // This class adds meshing features to the clustering class, as proposed in : // " Approximated Centroidal Voronoi Diagrams for Uniform Polygonal Mesh Coarsening", Valette & Chassery, Eurographics 2004 diff --git a/VolumeProcessing/Examples/Minc2Mhd.cxx b/VolumeProcessing/Examples/Minc2Mhd.cxx index 5689674..69004fe 100644 --- a/VolumeProcessing/Examples/Minc2Mhd.cxx +++ b/VolumeProcessing/Examples/Minc2Mhd.cxx @@ -10,11 +10,15 @@ Auteur: Sebastien Valette // .NAME Minc2Mhd // .SECTION Description +#include #include #include #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { diff --git a/VolumeProcessing/Examples/ReadImage.cxx b/VolumeProcessing/Examples/ReadImage.cxx index 4b8ff44..ca80a5b 100644 --- a/VolumeProcessing/Examples/ReadImage.cxx +++ b/VolumeProcessing/Examples/ReadImage.cxx @@ -10,12 +10,16 @@ Auteur: Sebastien Valette // .NAME meshviewer // .SECTION Description +#include #include //#include #include #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { vtkImageData *Image=0; diff --git a/VolumeProcessing/Examples/VolumeAnisotropicDiffusion.cxx b/VolumeProcessing/Examples/VolumeAnisotropicDiffusion.cxx index 12a27b7..a0860aa 100644 --- a/VolumeProcessing/Examples/VolumeAnisotropicDiffusion.cxx +++ b/VolumeProcessing/Examples/VolumeAnisotropicDiffusion.cxx @@ -10,11 +10,15 @@ Auteur: Sebastien Valette // .NAME VolumeMedian // .SECTION Description +#include #include #include #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<3) diff --git a/VolumeProcessing/Examples/VolumeCleanLabels.cxx b/VolumeProcessing/Examples/VolumeCleanLabels.cxx index 3eb8fec..420b9bb 100644 --- a/VolumeProcessing/Examples/VolumeCleanLabels.cxx +++ b/VolumeProcessing/Examples/VolumeCleanLabels.cxx @@ -10,10 +10,14 @@ Auteur: Sebastien Valette // .NAME VolumeCleanLabels // .SECTION Description +#include #include #include #include "vtkImageDataCleanLabels.h" +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<2) diff --git a/VolumeProcessing/Examples/VolumeMedian.cxx b/VolumeProcessing/Examples/VolumeMedian.cxx index de31ec9..90e7e1e 100644 --- a/VolumeProcessing/Examples/VolumeMedian.cxx +++ b/VolumeProcessing/Examples/VolumeMedian.cxx @@ -10,11 +10,15 @@ Auteur: Sebastien Valette // .NAME VolumeMedian // .SECTION Description +#include #include #include #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<3) diff --git a/VolumeProcessing/Examples/VolumeOOCSlice.cxx b/VolumeProcessing/Examples/VolumeOOCSlice.cxx index 013dc31..081421f 100644 --- a/VolumeProcessing/Examples/VolumeOOCSlice.cxx +++ b/VolumeProcessing/Examples/VolumeOOCSlice.cxx @@ -11,6 +11,7 @@ Auteur: Sebastien Valette / J. Eckert // .NAME VolueSection // .SECTION Description +#include #include "vtkOOCMetaImageReader.h" #include #include @@ -20,6 +21,9 @@ Auteur: Sebastien Valette / J. Eckert #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc < 3) { diff --git a/VolumeProcessing/Examples/VolumeSubsample.cxx b/VolumeProcessing/Examples/VolumeSubsample.cxx index 160a649..ee510db 100644 --- a/VolumeProcessing/Examples/VolumeSubsample.cxx +++ b/VolumeProcessing/Examples/VolumeSubsample.cxx @@ -10,12 +10,16 @@ Auteur: Sebastien Valette // .NAME VolumeSubsample2Mhd // .SECTION Description +#include #include #include #include #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { diff --git a/VolumeProcessing/Examples/png2raw.cxx b/VolumeProcessing/Examples/png2raw.cxx index f6104b3..b50d1c8 100644 --- a/VolumeProcessing/Examples/png2raw.cxx +++ b/VolumeProcessing/Examples/png2raw.cxx @@ -10,6 +10,7 @@ Auteur: Sebastien Valette // .NAME png2raw // .SECTION Description +#include #include //#include #include @@ -18,6 +19,9 @@ Auteur: Sebastien Valette #include #include +using std::cout; +using std::endl; + int main( int argc, char *argv[] ) { if (argc<4) diff --git a/VolumeProcessing/vtkImageDataCleanLabels.cxx b/VolumeProcessing/vtkImageDataCleanLabels.cxx index bc284d1..ae7bf66 100644 --- a/VolumeProcessing/vtkImageDataCleanLabels.cxx +++ b/VolumeProcessing/vtkImageDataCleanLabels.cxx @@ -1,3 +1,4 @@ +#include #include #include #include @@ -7,6 +8,8 @@ vtkStandardNewMacro(vtkImageDataCleanLabels); +using std::cout; +using std::endl; struct voxel { int pointer; diff --git a/VolumeProcessing/vtkOOCMetaImageReader.cxx b/VolumeProcessing/vtkOOCMetaImageReader.cxx index 430f38b..fc7fc92 100644 --- a/VolumeProcessing/vtkOOCMetaImageReader.cxx +++ b/VolumeProcessing/vtkOOCMetaImageReader.cxx @@ -14,6 +14,7 @@ PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkOOCMetaImageReader.h" +#include #include #include @@ -34,6 +35,9 @@ PURPOSE. See the above copyright notice for more information. #include #include +using std::cout; +using std::endl; + vtkStandardNewMacro(vtkOOCMetaImageReader); //vtkCxxRevisionMacro(vtkOOCMetaImageReader, "$Revision: 1.1 $"); @@ -94,7 +98,7 @@ vtkOOCMetaImageReader::vtkOOCMetaImageReader() //---------------------------------------------------------------------------- vtkOOCMetaImageReader::~vtkOOCMetaImageReader() -{ +{ delete this->MetaImagePtr; this->SetTransform(NULL); this->SetScalarArrayName(NULL); @@ -160,7 +164,7 @@ void vtkOOCMetaImageReader::ReadImageParameters ( ) { return; } - //The cout qui montre la dimensionalité du fichier + //The cout qui montre la dimensionalit� du fichier vtkDebugMacro(<< "* This image has " << FileDimensionality << " dimensions"); int i; @@ -168,7 +172,7 @@ void vtkOOCMetaImageReader::ReadImageParameters ( ) { switch(this->MetaImagePtr->ElementType()) { default: - vtkErrorMacro(<< "Unknown data type: " + vtkErrorMacro(<< "Unknown data type: " << this->MetaImagePtr->ElementType()); return; case vtkmetaio::MET_CHAR: @@ -195,7 +199,7 @@ void vtkOOCMetaImageReader::ReadImageParameters ( ) { case vtkmetaio::MET_UINT_ARRAY: this->DataScalarType = VTK_UNSIGNED_INT; break; - case vtkmetaio::MET_LONG: + case vtkmetaio::MET_LONG: case vtkmetaio::MET_LONG_ARRAY: this->DataScalarType = VTK_LONG; break; @@ -376,25 +380,25 @@ int vtkOOCMetaImageReader::OpenAndSeekFile(int dataExtent[6], int idx) return 0; } // convert data extent into constants that can be used to seek. - streamStart = + streamStart = (dataExtent[0] - this->DataExtent[0]) * this->DataIncrements[0]; if (this->FileLowerLeft) { - streamStart = streamStart + + streamStart = streamStart + (dataExtent[2] - this->DataExtent[2]) * this->DataIncrements[1]; } else { - streamStart = streamStart + - (this->DataExtent[3] - this->DataExtent[2] - dataExtent[2]) * + streamStart = streamStart + + (this->DataExtent[3] - this->DataExtent[2] - dataExtent[2]) * this->DataIncrements[1]; } // handle three and four dimensional files if (this->GetFileDimensionality() >= 3) { - streamStart = streamStart + + streamStart = streamStart + (dataExtent[4] - this->DataExtent[4]) * this->DataIncrements[2]; } @@ -415,7 +419,7 @@ int vtkOOCMetaImageReader::OpenAndSeekFile(int dataExtent[6], int idx) << this->DataExtent[4] << ", " << this->DataExtent[5]); return 0; } - return 1; + return 1; } //---------------------------------------------------------------------------- @@ -441,7 +445,7 @@ void vtkOOCMetaImageReaderUpdate2(vtkOOCMetaImageReader *self, vtkImageData *dat // Get the requested extents. data->GetExtent(inExtent); - // Convert them into to the extent needed from the file. + // Convert them into to the extent needed from the file. self->ComputeInverseTransformedExtent(inExtent,dataExtent); // get and transform the increments @@ -450,36 +454,36 @@ void vtkOOCMetaImageReaderUpdate2(vtkOOCMetaImageReader *self, vtkImageData *dat DataMask = self->GetDataMask(); - // compute outPtr2 + // compute outPtr2 outPtr2 = outPtr; - if (outIncr[0] < 0) + if (outIncr[0] < 0) { outPtr2 = outPtr2 - outIncr[0]*(dataExtent[1] - dataExtent[0]); } - if (outIncr[1] < 0) + if (outIncr[1] < 0) { outPtr2 = outPtr2 - outIncr[1]*(dataExtent[3] - dataExtent[2]); } - if (outIncr[2] < 0) + if (outIncr[2] < 0) { outPtr2 = outPtr2 - outIncr[2]*(dataExtent[5] - dataExtent[4]); } // length of a row, num pixels read at a time - pixelRead = dataExtent[1] - dataExtent[0] + 1; - streamRead = static_cast(pixelRead * - self->GetDataIncrements()[0]); + pixelRead = dataExtent[1] - dataExtent[0] + 1; + streamRead = static_cast(pixelRead * + self->GetDataIncrements()[0]); streamSkip0 = (long)(self->GetDataIncrements()[1] - streamRead); - streamSkip1 = (long)(self->GetDataIncrements()[2] - + streamSkip1 = (long)(self->GetDataIncrements()[2] - (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1]); pixelSkip = data->GetNumberOfScalarComponents(); // read from the bottom up - if (!self->GetFileLowerLeft()) + if (!self->GetFileLowerLeft()) { - streamSkip0 = (long)(-static_cast(streamRead) + streamSkip0 = (long)(-static_cast(streamRead) - self->GetDataIncrements()[1]); - streamSkip1 = (long)(self->GetDataIncrements()[2] + + streamSkip1 = (long)(self->GetDataIncrements()[2] + (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1]); } @@ -511,7 +515,7 @@ void vtkOOCMetaImageReaderUpdate2(vtkOOCMetaImageReader *self, vtkImageData *dat } } outPtr1 = outPtr2; - for (idx1 = dataExtent[2]; + for (idx1 = dataExtent[2]; !self->AbortExecute && idx1 <= dataExtent[3]; ++idx1) { if (!(count%target)) @@ -527,7 +531,7 @@ void vtkOOCMetaImageReaderUpdate2(vtkOOCMetaImageReader *self, vtkImageData *dat if (static_cast(self->GetFile()->gcount()) != streamRead) // Apple's gcc3 returns fail when reading _to_ eof #else - if ( static_cast(self->GetFile()->gcount()) != + if ( static_cast(self->GetFile()->gcount()) != streamRead || self->GetFile()->fail()) #endif { @@ -614,7 +618,7 @@ void vtkOOCMetaImageReaderUpdate2(vtkOOCMetaImageReader *self, vtkImageData *dat // move to the next image in the file and data //JF//VC : Modif //SetFilePointerEx( self->GetFile(),static_cast<_int64>(self->GetFile()->tellg()) + streamSkip1 + correction, 0, FILE_BEGIN); - self->GetFile()->seekg(static_cast(self->GetFile()->tellg()) + streamSkip1 + correction, + self->GetFile()->seekg(static_cast(self->GetFile()->tellg()) + streamSkip1 + correction, ios::beg); outPtr2 += outIncr[2]; } @@ -636,11 +640,11 @@ void vtkOOCMetaImageReaderUpdate1(vtkOOCMetaImageReader *self, vtkImageData *dat outPtr = data->GetScalarPointer(); switch (data->GetScalarType()) { - vtkTemplateMacro(vtkOOCMetaImageReaderUpdate2(self, data, inPtr, + vtkTemplateMacro(vtkOOCMetaImageReaderUpdate2(self, data, inPtr, (VTK_TT *)(outPtr))); default: vtkGenericWarningMacro("Update1: Unknown data type\n"); - } + } } //---------------------------------------------------------------------------- // This function reads a data from a file. The datas extent/axes @@ -666,7 +670,7 @@ void vtkOOCMetaImageReader::ExecuteData(vtkDataObject *output, } data->GetPointData()->GetScalars()->SetName("MetaImage"); - vtkDebugMacro(" ExecuteData, Reading extent: " << ext[0] << ", " << ext[1] << ", " + vtkDebugMacro(" ExecuteData, Reading extent: " << ext[0] << ", " << ext[1] << ", " << ext[2] << ", " << ext[3] << ", " << ext[4] << ", " << ext[5]); this->ComputeDataIncrements(); @@ -677,7 +681,7 @@ void vtkOOCMetaImageReader::ExecuteData(vtkDataObject *output, vtkTemplateMacro(vtkOOCMetaImageReaderUpdate1(this, data, (VTK_TT *)(ptr))); default: vtkErrorMacro(<< "UpdateFromFile: Unknown data type"); - } + } } @@ -727,7 +731,7 @@ void vtkOOCMetaImageReader::ComputeTransformedOrigin (double origin[3]) this->ComputeTransformedExtent(this->DataExtent,transformedExtent); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { if (transformedSpacing[i] < 0) { @@ -778,7 +782,7 @@ void vtkOOCMetaImageReader::ComputeTransformedExtent(int inExtent[6], for (idx = 0; idx < 6; idx += 2) { - if (dataExtent[idx] > dataExtent[idx+1]) + if (dataExtent[idx] > dataExtent[idx+1]) { temp = dataExtent[idx]; dataExtent[idx] = dataExtent[idx+1]; @@ -806,7 +810,7 @@ void vtkOOCMetaImageReader::ComputeTransformedExtent(int inExtent[6], for (idx = 0; idx < 6; idx += 2) { - if (outExtent[idx] > outExtent[idx+1]) + if (outExtent[idx] > outExtent[idx+1]) { temp = outExtent[idx]; outExtent[idx] = outExtent[idx+1]; @@ -817,7 +821,7 @@ void vtkOOCMetaImageReader::ComputeTransformedExtent(int inExtent[6], outExtent[idx+1] -= dataExtent[idx]; } - vtkDebugMacro(<< "Transformed extent are:" + vtkDebugMacro(<< "Transformed extent are:" << outExtent[0] << ", " << outExtent[1] << ", " << outExtent[2] << ", " << outExtent[3] << ", " << outExtent[4] << ", " << outExtent[5]); @@ -863,7 +867,7 @@ void vtkOOCMetaImageReader::ComputeInverseTransformedExtent(int inExtent[6], for (idx = 0; idx < 6; idx += 2) { - if (dataExtent[idx] > dataExtent[idx+1]) + if (dataExtent[idx] > dataExtent[idx+1]) { temp = dataExtent[idx]; dataExtent[idx] = dataExtent[idx+1]; @@ -881,7 +885,7 @@ void vtkOOCMetaImageReader::ComputeInverseTransformedExtent(int inExtent[6], transformedExtent[0] = inExtent[0]; transformedExtent[1] = inExtent[2]; transformedExtent[2] = inExtent[4]; - this->Transform->GetLinearInverse()->TransformPoint(transformedExtent, + this->Transform->GetLinearInverse()->TransformPoint(transformedExtent, transformedExtent); outExtent[0] = (int) transformedExtent[0]; outExtent[2] = (int) transformedExtent[1]; @@ -898,7 +902,7 @@ void vtkOOCMetaImageReader::ComputeInverseTransformedExtent(int inExtent[6], for (idx = 0; idx < 6; idx += 2) { - if (outExtent[idx] > outExtent[idx+1]) + if (outExtent[idx] > outExtent[idx+1]) { temp = outExtent[idx]; outExtent[idx] = outExtent[idx+1]; @@ -907,7 +911,7 @@ void vtkOOCMetaImageReader::ComputeInverseTransformedExtent(int inExtent[6], } } - vtkDebugMacro(<< "Inverse Transformed extent are:" + vtkDebugMacro(<< "Inverse Transformed extent are:" << outExtent[0] << ", " << outExtent[1] << ", " << outExtent[2] << ", " << outExtent[3] << ", " << outExtent[4] << ", " << outExtent[5]); @@ -931,7 +935,7 @@ void vtkOOCMetaImageReader::ComputeTransformedIncrements(vtkIdType inIncr[3], outIncr[0] = (vtkIdType) transformedIncr[0]; outIncr[1] = (vtkIdType) transformedIncr[1]; outIncr[2] = (vtkIdType) transformedIncr[2]; - vtkDebugMacro(<< "Transformed Incr are:" + vtkDebugMacro(<< "Transformed Incr are:" << outIncr[0] << ", " << outIncr[1] << ", " << outIncr[2]); } } @@ -956,7 +960,7 @@ void vtkOOCMetaImageReader::ComputeInverseTransformedIncrements(vtkIdType inIncr outIncr[0] = (vtkIdType) transformedIncr[0]; outIncr[1] = (vtkIdType) transformedIncr[1]; outIncr[2] = (vtkIdType) transformedIncr[2]; - vtkDebugMacro(<< "Inverse Transformed Incr are:" + vtkDebugMacro(<< "Inverse Transformed Incr are:" << outIncr[0] << ", " << outIncr[1] << ", " << outIncr[2]); } } @@ -1012,47 +1016,47 @@ int vtkOOCMetaImageReader::CanReadFile(const char* fname) return false; } - if( strcmp(key,"NDims")==0 ) + if( strcmp(key,"NDims")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"ObjectType")==0 ) + if( strcmp(key,"ObjectType")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"TransformType")==0 ) + if( strcmp(key,"TransformType")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"ID")==0 ) + if( strcmp(key,"ID")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"ParentID")==0 ) + if( strcmp(key,"ParentID")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"BinaryData")==0 ) + if( strcmp(key,"BinaryData")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"Comment")==0 ) + if( strcmp(key,"Comment")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"AcquisitionDate")==0 ) + if( strcmp(key,"AcquisitionDate")==0 ) { inputStream.close(); return 3; } - if( strcmp(key,"Modality")==0 ) + if( strcmp(key,"Modality")==0 ) { inputStream.close(); return 3; diff --git a/VolumeProcessing/vtkRobustImageReader.h b/VolumeProcessing/vtkRobustImageReader.h index 2d6453a..163e714 100644 --- a/VolumeProcessing/vtkRobustImageReader.h +++ b/VolumeProcessing/vtkRobustImageReader.h @@ -1,6 +1,7 @@ #ifndef __vtkRobustImageReader_h #define __vtkRobustImageReader_h +#include #include #include @@ -12,10 +13,13 @@ #include #include +using std::cout; +using std::endl; + // v2 : shift and scale values read by nifti reader when needed // v1 -class vtkRobustImageReader : public vtkObject +class vtkRobustImageReader : public vtkObject { public :