]> Creatis software - clitk.git/blob - vv/vvBinaryImageOverlayActor.h
- small correction about Render (a bit less unuseful Render)
[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);
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   vtkLookupTable * mColorLUT;
60
61   std::vector<vtkImageMapToRGBA *> mMapperList;
62   std::vector<vtkImageActor*> mImageActorList;
63
64   void ComputeExtent(int orientation, 
65                      int slice, 
66                      int * inExtent,
67                      int * outExtent);
68   void ComputeExtent(int * inExtent, 
69                      int * outExtent, 
70                      vtkImageData * image, 
71                      vtkImageData * overlay);
72   void SetDisplayExtentAndCameraPosition(int orientation, 
73                                          int slice, 
74                                          int * extent, 
75                                          vtkImageActor * actor, 
76                                          double position);
77
78 }; // end class vvBinaryImageOverlayActor
79 //------------------------------------------------------------------------------
80
81 #endif
82