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::Pointer image);
45 void SetPreserveMemoryModeEnabled(bool b);
46 void SetDepth(double d);
55 double mPreviousValue;
56 bool mHiddenImageIsUsed;
57 vvImage::Pointer mHiddenImage;
58 bool mDisplayModeIsPreserveMemory;
61 // For preserveMemory mode
62 std::vector<vtkSmartPointer<vtkActor> > mSquaresActorList;
63 std::vector<vtkSmartPointer<vtkImageClip> > mClipperList;
64 std::vector<vtkSmartPointer<vtkMarchingSquares> > mSquaresList;
65 std::vector<vtkSmartPointer<vtkPolyDataMapper> > mSquaresMapperList;
67 // For fast cache mode
69 int mPreviousOrientation;
70 std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
73 void InitializeCacheMode();
74 void UpdateWithPreserveMemoryMode();
75 void UpdateWithFastCacheMode();
76 void CreateNewActor(int numImage);
77 void UpdateActor(vtkActor * actor, vtkPolyDataMapper * mapper, vtkMarchingSquares * squares, vtkImageClip * clipper,
78 double threshold, int orientation, int slice);
79 void CreateActor(int orientation, int slice);
80 int ComputeCurrentOrientation();
86 }; // end class vvImageContour
87 //------------------------------------------------------------------------------