]> Creatis software - clitk.git/blob - vv/vvBinaryImageOverlayActor.h
- add other types/dim (warning still bugs ! do not use)
[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 update(int slicer, int slice);
41   void hideActors();
42   void showActors();
43   void setColor(double r, double g, double b);
44   void setImage(vvImage::Pointer image, double bg);
45   void initialize();
46   void SetOpacity(double d);
47
48  protected:
49   vvSlicer * mSlicer;
50   int mSlice;
51   int mTSlice;
52   int mPreviousTSlice;
53   int mPreviousSlice;
54   vvImage::Pointer mImage;
55   std::vector<double> mColor;
56   double mAlpha;
57   double mBackgroundValue;
58   vtkLookupTable * mColorLUT;
59
60   std::vector<vtkImageMapToRGBA *> mMapperList;
61   std::vector<vtkImageActor*> mImageActorList;
62
63   void ComputeExtent(int orientation, 
64                      int slice, 
65                      int * inExtent,
66                      int * outExtent);
67   void ComputeExtent(int * inExtent, 
68                      int * outExtent, 
69                      vtkImageData * image, 
70                      vtkImageData * overlay);
71   void SetDisplayExtentAndCameraPosition(int orientation, 
72                                          int slice, 
73                                          int * extent, 
74                                          vtkImageActor * actor, 
75                                          double position);
76
77 }; // end class vvBinaryImageOverlayActor
78 //------------------------------------------------------------------------------
79
80 #endif
81