X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkImagePlanes.cxx;h=d3cd9d4040fca938bd84fa6ed9446927fb706c20;hb=2ab6bff6c5478054c4fdc9d37304b28151251acb;hp=426189b031cf5d428edce3cc1b4cb5235d4d22d3;hpb=2825c6ab65c1333b6236d54bb157b315097e6fb5;p=bbtk.git diff --git a/packages/vtk/src/bbvtkImagePlanes.cxx b/packages/vtk/src/bbvtkImagePlanes.cxx index 426189b..d3cd9d4 100644 --- a/packages/vtk/src/bbvtkImagePlanes.cxx +++ b/packages/vtk/src/bbvtkImagePlanes.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: bbvtkImagePlanes.cxx,v $ Language: C++ - Date: $Date: 2012/07/09 13:02:42 $ - Version: $Revision: 1.37 $ + Date: $Date: 2012/11/16 08:51:58 $ + Version: $Revision: 1.38 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* 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 @@ -139,7 +144,7 @@ namespace bbvtk }; //================================================================ - //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.37 $"); + //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.38 $"); //================================================================ @@ -148,13 +153,13 @@ namespace bbvtk void ImagePlanes::bbUserSetDefaultValues() { - bbSetOutputPlaneX(0); - bbSetOutputPlaneY(0); - bbSetOutputPlaneZ(0); - bbSetOutputImageX(0); - bbSetOutputImageY(0); - bbSetOutputImageZ(0); - bbSetInputIn(0); + bbSetOutputPlaneX(NULL); + bbSetOutputPlaneY(NULL); + bbSetOutputPlaneZ(NULL); + bbSetOutputImageX(NULL); + bbSetOutputImageY(NULL); + bbSetOutputImageZ(NULL); + bbSetInputIn(NULL); std::vector vect; vect.push_back(0); vect.push_back(0); @@ -237,8 +242,10 @@ namespace bbvtk //bbSetOutputImage3Pts(planeWidget3Pts->GetResliceOutput()); if(picker != 0) + { picker->UnRegister(NULL); - + } + mVtkCallback = VtkCallbackType::New(); mVtkCallback->SetBlackBox(this); planeWidgetX->AddObserver(vtkCommand::InteractionEvent,mVtkCallback); @@ -357,27 +364,27 @@ namespace bbvtk //Get the corresponding three points out of the vectors double origin[3]; - origin[0] = pointsx[0]; - origin[1] = pointsy[0]; - origin[2] = pointsz[0]; + origin[0] = pointsx[0]; + origin[1] = pointsy[0]; + origin[2] = pointsz[0]; double point1[3]; - point1[0] = pointsx[1]; - point1[1] = pointsy[1]; - point1[2] = pointsz[1]; + point1[0] = pointsx[1]; + point1[1] = pointsy[1]; + point1[2] = pointsz[1]; double point2[3]; - point2[0]= pointsx[2]; - point2[1]= pointsy[2]; - point2[2]= pointsz[2]; + point2[0] = pointsx[2]; + point2[1] = pointsy[2]; + point2[2] = pointsz[2]; //With the three points we create the corresponding X, Y and Z vectors all orthogonal to each other - double* vect1= getNormal(makeVector(origin, point1)); - double* vect2= getNormal(makeVector(origin, point2)); - double* crossp = getCrossProduct(vect1, vect2); + double* vect1 = getNormal(makeVector(origin, point1)); + double* vect2 = getNormal(makeVector(origin, point2)); + double* crossp = getCrossProduct(vect1, vect2); - double *newx = getCrossProduct(vect2, crossp); + double *newx = getCrossProduct(vect2, crossp); - int ext[6],factor=0; + int ext[6],factor = 0; bbGetInputIn()->GetExtent(ext); factor = ext[0]GetResliceOutput()->Update(); //To get the slice of image out of the selected volume - if (_imageReslicer==NULL){ + if (_imageReslicer==NULL) + { _imageReslicer = vtkImageReslice::New(); _imageReslicer->SetOutputDimensionality(2); _transform = vtkTransform::New(); _matrix = vtkMatrix4x4::New(); - } + } // if _imageReslicer->SetInterpolationMode( bbGetInputInterpolation() ); _imageReslicer->SetInput( bbGetInputIn() ); _imageReslicer->SetInformationInput(bbGetInputIn()); @@ -439,23 +447,24 @@ namespace bbvtk } // bbGetInputIn } - void ImagePlanes::updateInteractor(){ - - vtkRenderWindowInteractor* interactor = bbGetInputInteractor(); - - if(interactor){ - bbGetOutputPlaneX()->SetInteractor(interactor); - bbGetOutputPlaneX()->EnabledOn(); - bbGetOutputPlaneY()->SetInteractor(interactor); - bbGetOutputPlaneY()->EnabledOn(); - bbGetOutputPlaneZ()->SetInteractor(interactor); - bbGetOutputPlaneZ()->EnabledOn(); - bbGetOutputPlane3Pts()->SetInteractor(interactor); - bbGetOutputPlane3Pts()->EnabledOn(); - } - } + void ImagePlanes::updateInteractor() + { + vtkRenderWindowInteractor* interactor = bbGetInputInteractor(); + if(interactor) + { + bbGetOutputPlaneX()->SetInteractor(interactor); + bbGetOutputPlaneX()->EnabledOn(); + bbGetOutputPlaneY()->SetInteractor(interactor); + bbGetOutputPlaneY()->EnabledOn(); + bbGetOutputPlaneZ()->SetInteractor(interactor); + bbGetOutputPlaneZ()->EnabledOn(); + bbGetOutputPlane3Pts()->SetInteractor(interactor); + bbGetOutputPlane3Pts()->EnabledOn(); + } // if + } + //----------------------------------------------------------------- - void vtkImageDataPointerRelay::bbUserSetDefaultValues() + void vtkImageDataPointerRelay::bbUserSetDefaultValues() { }