]> Creatis software - clitk.git/blob - vv/vvBinaryImageOverlayActor.h
changes in license header
[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://www.centreleonberard.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 : public itk::LightObject
33 {
34   //  Q_OBJECT
35  public:
36   typedef vvBinaryImageOverlayActor Self;
37   typedef itk::SmartPointer<Self> Pointer;
38   itkNewMacro(Self);
39
40   void SetSlicer(vvSlicer * slicer);
41   void SetColor(double r, double g, double b);
42   void SetOpacity(double d);
43   void SetImage(vvImage * image, double bg, bool modeBG=true);
44   void Initialize(bool IsVisible=true);
45   void UpdateColor();
46   void UpdateSlice(int slicer, int slice);
47   void HideActors();
48   void ShowActors();
49
50  protected:
51   vvSlicer * mSlicer;
52   int mSlice;
53   int mTSlice;
54   int mPreviousTSlice;
55   int mPreviousSlice;
56   vvImage * mImage;
57   std::vector<double> mColor;
58   double mAlpha;
59   double mBackgroundValue;
60   double mForegroundValue;
61   bool m_modeBG;
62   vtkSmartPointer<vtkLookupTable> mColorLUT;
63
64   std::vector<vtkSmartPointer<vtkImageMapToRGBA> > mMapperList;
65   std::vector<vtkSmartPointer<vtkImageActor> > mImageActorList;
66
67   void ComputeExtent(int orientation, 
68                      int slice, 
69                      int * inExtent,
70                      int * outExtent);
71   void ComputeExtent(int * inExtent, 
72                      int * outExtent, 
73                      vtkImageData * image, 
74                      vtkImageData * overlay);
75   void SetDisplayExtentAndCameraPosition(int orientation, 
76                                          int slice, 
77                                          int * extent, 
78                                          vtkImageActor * actor, 
79                                          double position);
80
81 private:
82   vvBinaryImageOverlayActor();
83   ~vvBinaryImageOverlayActor();
84     
85 }; // end class vvBinaryImageOverlayActor
86 //------------------------------------------------------------------------------
87
88 #endif
89