1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #include "volumerendererdata.h"
27 #include "vtkObjectFactory.h"
30 //EED 2017-01-01 Migration VTK7
31 #if VTK_MAJOR_VERSION <= 5
32 vtkCxxRevisionMacro(VolumeRendererData, "$Revision: 1.11 $");
37 vtkStandardNewMacro(VolumeRendererData);
39 VolumeRendererData::VolumeRendererData()
41 VolRendManager = NULL;
46 //ImageDataSeparateComponents = false;
50 void VolumeRendererData::ShowVolume(bool checked){
55 VolRendManager = new VolumeRendererManager();
56 VolRendManager->addVolume(ImageData, Interactor);
60 VolRendManager->SetLookupTable(LookUpTable);
62 vector< vtkProp3D* > props = VolRendManager->getProps3D();
63 for(unsigned i = 0; i < props.size(); i++){
64 Renderer->AddActor(props[i]);
68 vector< vtkProp3D* > props = VolRendManager->getProps3D();
69 for(unsigned i = 0; i < props.size(); i++){
70 Renderer->RemoveActor(props[i]);
72 delete VolRendManager;
76 cout<<"Exception in: "<<e<<endl;
78 cout<<"Exception in: "<<e.what()<<endl;
83 void VolumeRendererData::invariant()
87 throw "Image data not set";
91 throw "renderer not initialized";
95 void VolumeRendererData::OpacityChanged(vector<double> greyvalues, vector<double> values)
98 if(VolRendManager!=NULL)
101 VolRendManager->setVolumeOpacity(greyvalues,values);
106 void VolumeRendererData::BoundingBoxChanged(bool checked){
109 if(VolRendManager==NULL)
115 if(VolRendManager && Interactor){
117 VolRendManager->EnableBoundingBox(Interactor);
119 VolRendManager->DisableBoundingBox();
126 void VolumeRendererData::changeCompositeMIPFunction(int function){
130 VolRendManager->changeCompositeMIPFunction(0, function);
135 changes the interoplation type of the volume
139 void VolumeRendererData::changeInterpolationType(int type){
143 VolRendManager->changeInterpolationType(type);