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 setImage(vvImage::Pointer image);
43 void setPreserveMemoryModeEnabled(bool b);
51 double mPreviousValue;
52 bool mHiddenImageIsUsed;
53 vvImage::Pointer mHiddenImage;
54 bool mDisplayModeIsPreserveMemory;
56 // For preserveMemory mode
57 std::vector<vtkImageClip*> mClipperList;
58 std::vector<vtkMarchingSquares*> mSquaresList;
59 std::vector<vtkActor*> mSquaresActorList;
61 // For fast cache mode
63 int mPreviousOrientation;
64 std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
67 void initializeCacheMode();
68 void updateWithPreserveMemoryMode();
69 void updateWithFastCacheMode();
70 void createNewActor(vtkActor ** actor,
71 vtkMarchingSquares ** squares,
72 vtkImageClip ** clipper, int numImage);
73 void updateActor(vtkActor * actor,
74 vtkMarchingSquares * squares,
75 vtkImageClip * clipper,
76 double threshold, int orientation, int slice);
77 void createActor(int orientation, int slice);
78 int computeCurrentOrientation();
80 }; // end class vvImageContour
81 //------------------------------------------------------------------------------