]> Creatis software - clitk.git/blob - vv/vvStructureSetActor.cxx
- display binary image as overlay
[clitk.git] / vv / vvStructureSetActor.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18
19 #include "vvStructureSetActor.h"
20 #include "vvROIActor.h"
21
22 //------------------------------------------------------------------------------
23 vvStructureSetActor::vvStructureSetActor() {
24
25 }
26 //------------------------------------------------------------------------------
27
28
29 //------------------------------------------------------------------------------
30 vvStructureSetActor::~vvStructureSetActor() {
31 }
32 //------------------------------------------------------------------------------
33
34
35 //------------------------------------------------------------------------------
36 void vvStructureSetActor::SetStructureSet(clitk::DicomRT_StructureSet * s) {
37   mStructureSet = s;
38 }
39 //------------------------------------------------------------------------------
40
41
42 //------------------------------------------------------------------------------
43 void vvStructureSetActor::SetSlicerManager(vvSlicerManager * s) {
44   mSlicerManager = s;
45 }
46 //------------------------------------------------------------------------------
47
48
49 //------------------------------------------------------------------------------
50 vvROIActor * vvStructureSetActor::GetROIActor(int n) {
51   if (mMapROIIndex.find(n) == mMapROIIndex.end()) {
52     std::cerr << "No ROI number " << n << std::endl;
53     return NULL;    
54   }
55   return mROIActors[mMapROIIndex[n]];
56 }
57 //------------------------------------------------------------------------------
58
59
60 //------------------------------------------------------------------------------
61 void vvStructureSetActor::CreateNewROIActor(int n) {
62   DD("AddROIActor");
63   DD(n);
64
65   // Check
66   const clitk::DicomRT_ROI * roi = mStructureSet->GetROI(n);
67   if (roi == NULL) {
68     std::cerr << "Error. No ROI number " << n << std::endl;
69     exit(0);
70   }
71
72   // Add ROI Actors
73   vvROIActor * actor = new vvROIActor;
74   mROIActors.push_back(actor);
75   actor->SetROI(roi);
76   actor->SetSlicerManager(mSlicerManager);
77   actor->Initialize();
78   mMapROIIndex[n] = mROIActors.size()-1;
79
80   //  actor->Update();
81 }
82 //------------------------------------------------------------------------------
83
84