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