1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
19 #ifndef VVTOOLROIMANAGER_H
20 #define VVTOOLROIMANAGER_H
22 #include <QtDesigner/QDesignerExportWidget>
23 #include <QSharedPointer>
25 #include "vvToolBase.h"
26 #include "vvROIActor.h"
27 #include "clitkDicomRT_ROI.h"
28 #include "ui_vvToolROIManager.h"
32 //------------------------------------------------------------------------------
33 class vvToolROIManager:
35 public vvToolBase<vvToolROIManager>,
36 public Ui::vvToolROIManager
40 vvToolROIManager(vvMainWindowBase* parent=0, Qt::WindowFlags f=Qt::Dialog);
41 virtual ~vvToolROIManager();
43 static void Initialize();
44 virtual void InputIsSelected(vvSlicerManager *m);
46 void AddImage(vvImage * binaryImage, std::string filename, double BG, bool m_modeBG=true);
47 void UpdateAllContours();
48 void UpdateAllROIStatus();
51 void AnImageIsBeingClosed(vvSlicerManager *);
52 void SelectedImageHasChanged(vvSlicerManager *);
53 void OpenBinaryImage();
54 void OpenDicomImage();
55 void SelectedItemChangedInTree();
56 void VisibleROIToggled(bool b);
57 void VisibleContourROIToggled(bool b);
58 void OpacityChanged(int v);
60 void ChangeContourColor();
61 void ChangeContourWidth(int n);
62 void ChangeDepth(int n);
63 void AllVisibleROIToggled(int b);
64 void AllVisibleContourROIToggled(bool b);
65 void ReloadCurrentROI();
69 Ui::vvToolROIManager ui;
70 vvSlicerManager * mSlicerManager;
71 vvImage * mCurrentImage;
72 vvMainWindowBase * mMainWindow;
75 int mNumberOfVisibleROI;
76 int mNumberOfVisibleContourROI;
78 vtkSmartPointer<vtkLookupTable> mDefaultLUTColor;
80 std::vector<vvImage::Pointer> mOpenedBinaryImage;
81 std::vector<clitk::DicomRT_ROI::Pointer> mROIList;
82 std::vector<QSharedPointer<vvROIActor> > mROIActorsList;
84 // Data for the widget Tree
85 std::vector< QSharedPointer<QTreeWidgetItem> > mTreeWidgetList;
86 std::map<clitk::DicomRT_ROI::Pointer, QTreeWidgetItem *> mMapROIToTreeWidget;
87 std::map<QTreeWidgetItem *, clitk::DicomRT_ROI::Pointer> mMapTreeWidgetToROI;
89 // Data for current selected roi
90 clitk::DicomRT_ROI::Pointer mCurrentROI;
91 QSharedPointer<vvROIActor> mCurrentROIActor;
93 }; // end class vvToolROIManager
94 //------------------------------------------------------------------------------