]> Creatis software - clitk.git/blob - vv/vvBinaryImageOverlayActor.h
Update clitkProfileImage Tool
[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::Pointer image, double bg, bool modeBG=true);
44   void SetDepth(double d) { mDepth = d; }
45   void Initialize(bool IsVisible=true);
46   void UpdateColor();
47   void UpdateSlice(int slicer, int slice, bool force=false);
48   void HideActors();
49   void ShowActors();
50   void RemoveActors();
51
52  protected:
53   vvSlicer * mSlicer;
54   int mSlice;
55   int mTSlice;
56   int mPreviousTSlice;
57   int mPreviousSlice;
58   vvImage::Pointer mImage;
59   std::vector<double> mColor;
60   double mAlpha;
61   double mBackgroundValue;
62   double mForegroundValue;
63   bool m_modeBG;
64   vtkSmartPointer<vtkLookupTable> mColorLUT;
65   double mDepth;
66
67   std::vector<vtkSmartPointer<vtkImageMapToRGBA> > mMapperList;
68   std::vector<vtkSmartPointer<vtkImageActor> > mImageActorList;
69
70   void ComputeExtent(int orientation, 
71                      int slice, 
72                      int * inExtent,
73                      int * outExtent);
74   void ComputeExtent(int * inExtent, 
75                      int * outExtent, 
76                      vtkImageData * image, 
77                      vtkImageData * overlay);
78   void SetDisplayExtentAndCameraPosition(int orientation, 
79                                          int slice, 
80                                          int * extent, 
81                                          vtkImageActor * actor, 
82                                          double position);
83
84 private:
85   vvBinaryImageOverlayActor();
86   ~vvBinaryImageOverlayActor();
87     
88 }; // end class vvBinaryImageOverlayActor
89 //------------------------------------------------------------------------------
90
91 #endif
92