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"
29 vtkCxxRevisionMacro(VolumeRendererData, "$Revision: 1.11 $");
30 vtkStandardNewMacro(VolumeRendererData);
32 VolumeRendererData::VolumeRendererData()
34 VolRendManager = NULL;
39 //ImageDataSeparateComponents = false;
43 void VolumeRendererData::ShowVolume(bool checked){
48 VolRendManager = new VolumeRendererManager();
49 VolRendManager->addVolume(ImageData, Interactor);
53 VolRendManager->SetLookupTable(LookUpTable);
55 vector< vtkProp3D* > props = VolRendManager->getProps3D();
56 for(unsigned i = 0; i < props.size(); i++){
57 Renderer->AddActor(props[i]);
61 vector< vtkProp3D* > props = VolRendManager->getProps3D();
62 for(unsigned i = 0; i < props.size(); i++){
63 Renderer->RemoveActor(props[i]);
65 delete VolRendManager;
69 cout<<"Exception in: "<<e<<endl;
71 cout<<"Exception in: "<<e.what()<<endl;
76 void VolumeRendererData::invariant()
80 throw "Image data not set";
84 throw "renderer not initialized";
88 void VolumeRendererData::OpacityChanged(vector<double> greyvalues, vector<double> values)
91 if(VolRendManager!=NULL)
94 VolRendManager->setVolumeOpacity(greyvalues,values);
99 void VolumeRendererData::BoundingBoxChanged(bool checked){
102 if(VolRendManager==NULL)
108 if(VolRendManager && Interactor){
110 VolRendManager->EnableBoundingBox(Interactor);
112 VolRendManager->DisableBoundingBox();
119 void VolumeRendererData::changeCompositeMIPFunction(int function){
123 VolRendManager->changeCompositeMIPFunction(0, function);
128 changes the interoplation type of the volume
132 void VolumeRendererData::changeInterpolationType(int type){
136 VolRendManager->changeInterpolationType(type);