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 ===========================================================================**/
18 #ifndef VVTOOLSEGMENTATION_H
19 #define VVTOOLSEGMENTATION_H
21 #include <QtDesigner/QDesignerExportWidget>
23 #include "vvToolBase.h"
24 #include "vvToolWidgetBase.h"
25 #include "vvROIActor.h"
26 #include "ui_vvToolSegmentation.h"
28 #include "vtkLookupTable.h"
30 //------------------------------------------------------------------------------
31 class vvToolSegmentation:
32 public vvToolWidgetBase,
33 public vvToolBase<vvToolSegmentation>,
34 private Ui::vvToolSegmentation
38 vvToolSegmentation(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
39 ~vvToolSegmentation();
41 //-----------------------------------------------------
42 static void Initialize();
43 virtual void InputIsSelected(vvSlicerManager * m);
44 void OpenBinaryImage();
49 void UpdateAndRenderNewMask();
51 //-----------------------------------------------------
54 bool eventFilter(QObject *object, QEvent *event);
56 virtual void MousePositionChanged(int slicer);
57 // virtual void keyPressEvent(QKeyEvent * event);
58 // virtual void reject();
61 // virtual void closeEvent(QCloseEvent *event);
62 Ui::vvToolSegmentation ui;
63 QSharedPointer<vvROIActor> mRefMaskActor;
64 QSharedPointer<vvROIActor> mCurrentMaskActor;
65 std::vector<QSharedPointer<vvROIActor> > mCurrentCCLActors;
66 vvImage::Pointer mRefMaskImage;
67 vvImage::Pointer mCurrentMaskImage;
68 vvImage::Pointer mCurrentCCLImage;
70 vtkSmartPointer<vtkLookupTable> mDefaultLUTColor;
71 enum { Mode_Default, Mode_CCL};
74 QSharedPointer<vvROIActor> CreateMaskActor(vvImage::Pointer image, int i, int colorID, bool BGMode=false);
76 }; // end class vvToolSegmentation
77 //------------------------------------------------------------------------------