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://oncora1.lyon.fnclcc.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 //------------------------------------------------------------------------------
37 void SetSlicer(vvSlicer * slicer);
38 void Update(double value);
41 void SetColor(double r, double g, double b);
42 void SetLineWidth(double w);
43 void SetImage(vvImage * image);
44 void SetPreserveMemoryModeEnabled(bool b);
52 double mPreviousValue;
53 bool mHiddenImageIsUsed;
54 vvImage * mHiddenImage;
55 bool mDisplayModeIsPreserveMemory;
57 // For preserveMemory mode
58 std::vector<vtkSmartPointer<vtkImageClip> > mClipperList;
59 std::vector<vtkSmartPointer<vtkMarchingSquares> > mSquaresList;
60 std::vector<vtkSmartPointer<vtkActor> > mSquaresActorList;
62 // For fast cache mode
64 int mPreviousOrientation;
65 std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
68 void InitializeCacheMode();
69 void UpdateWithPreserveMemoryMode();
70 void UpdateWithFastCacheMode();
71 void CreateNewActor(vtkActor ** actor,
72 vtkMarchingSquares ** squares,
73 vtkImageClip ** clipper,
75 void UpdateActor(vtkActor * actor,
76 vtkMarchingSquares * squares,
77 vtkImageClip * clipper,
78 double threshold, int orientation, int slice);
79 void CreateActor(int orientation, int slice);
80 int ComputeCurrentOrientation();
82 }; // end class vvImageContour
83 //------------------------------------------------------------------------------