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 setPreserveModeEnabled(bool b);
50 bool mHiddenImageIsUsed;
51 vvImage::Pointer mHiddenImage;
52 bool mDisplayModeIsPreserveMemory;
54 // For preserveMemory mode
55 std::vector<vtkImageClip*> mClipperList;
56 std::vector<vtkMarchingSquares*> mSquaresList;
57 std::vector<vtkActor*> mSquaresActorList;
59 // For fast cache mode
61 int mPreviousOrientation;
62 std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
65 void initializeCacheMode();
66 void updateWithPreserveMemoryMode();
67 void updateWithFastCacheMode();
68 void createNewActor(vtkActor ** actor,
69 vtkMarchingSquares ** squares,
70 vtkImageClip ** clipper);
71 void updateActor(vtkActor * actor,
72 vtkMarchingSquares * squares,
73 vtkImageClip * clipper,
74 int threshold, int orientation, int slice);
75 void createActor(int orientation, int slice);
76 int computeCurrentOrientation();
78 }; // end class vvImageContour
79 //------------------------------------------------------------------------------