1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef VVIMAGECONTOUR_H
19 #define VVIMAGECONTOUR_H
21 #include "clitkCommon.h"
25 class vtkMarchingSquares;
29 //------------------------------------------------------------------------------
30 class vvImageContour: public itk::LightObject
34 typedef vvImageContour Self;
35 typedef itk::SmartPointer<Self> Pointer;
38 void SetSlicer(vvSlicer * slicer);
39 void Update(double value);
42 void SetColor(double r, double g, double b);
43 void SetLineWidth(double w);
44 void SetImage(vvImage * image);
45 void SetPreserveMemoryModeEnabled(bool b);
53 double mPreviousValue;
54 bool mHiddenImageIsUsed;
55 vvImage * mHiddenImage;
56 bool mDisplayModeIsPreserveMemory;
58 // For preserveMemory mode
59 std::vector<vtkSmartPointer<vtkActor> > mSquaresActorList;
60 std::vector<vtkSmartPointer<vtkImageClip> > mClipperList;
61 std::vector<vtkSmartPointer<vtkMarchingSquares> > mSquaresList;
62 std::vector<vtkSmartPointer<vtkPolyDataMapper> > mSquaresMapperList;
64 // For fast cache mode
66 int mPreviousOrientation;
67 std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
70 void InitializeCacheMode();
71 void UpdateWithPreserveMemoryMode();
72 void UpdateWithFastCacheMode();
73 void CreateNewActor(int numImage);
74 void UpdateActor(vtkActor * actor, vtkMarchingSquares * squares, vtkImageClip * clipper,
75 double threshold, int orientation, int slice);
76 void CreateActor(int orientation, int slice);
77 int ComputeCurrentOrientation();
82 }; // end class vvImageContour
83 //------------------------------------------------------------------------------