]> Creatis software - clitk.git/blob - vv/vvBinaryImageOverlayActor.h
add possibility to display one ROI by FG value
[clitk.git] / vv / vvBinaryImageOverlayActor.h
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 #ifndef VVBINARYIMAGEOVERLAYACTOR_H
19 #define VVBINARYIMAGEOVERLAYACTOR_H
20
21 #include "clitkCommon.h"
22 #include "vvSlicer.h"
23
24 class vtkImageClip;
25 class vtkMarchingSquares;
26 class vtkActor;
27 class vvImage;
28 class vtkImageMapToRGBA;
29 class vtkImageActor;
30
31 //------------------------------------------------------------------------------
32 class vvBinaryImageOverlayActor
33 {
34   //  Q_OBJECT
35  public:
36   vvBinaryImageOverlayActor();
37   ~vvBinaryImageOverlayActor();
38
39   void SetSlicer(vvSlicer * slicer);
40   void SetColor(double r, double g, double b);
41   void SetOpacity(double d);
42   void SetImage(vvImage::Pointer image, double bg, bool modeBG=true);
43   void Initialize();
44   void UpdateColor();
45   void UpdateSlice(int slicer, int slice);
46   void HideActors();
47   void ShowActors();
48
49  protected:
50   vvSlicer * mSlicer;
51   int mSlice;
52   int mTSlice;
53   int mPreviousTSlice;
54   int mPreviousSlice;
55   vvImage::Pointer mImage;
56   std::vector<double> mColor;
57   double mAlpha;
58   double mBackgroundValue;
59   double mForegroundValue;
60   bool m_modeBG;
61   vtkLookupTable * mColorLUT;
62
63   std::vector<vtkImageMapToRGBA *> mMapperList;
64   std::vector<vtkImageActor*> mImageActorList;
65
66   void ComputeExtent(int orientation, 
67                      int slice, 
68                      int * inExtent,
69                      int * outExtent);
70   void ComputeExtent(int * inExtent, 
71                      int * outExtent, 
72                      vtkImageData * image, 
73                      vtkImageData * overlay);
74   void SetDisplayExtentAndCameraPosition(int orientation, 
75                                          int slice, 
76                                          int * extent, 
77                                          vtkImageActor * actor, 
78                                          double position);
79
80 }; // end class vvBinaryImageOverlayActor
81 //------------------------------------------------------------------------------
82
83 #endif
84