1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #include "baseFilterManualPaint.h"
28 baseFilterManualPaint::baseFilterManualPaint()
30 _IMManager = new ImageMManager();
31 _IMManager->CleanModifiedRegion();
33 _2D3D = 1; // 0 2D , 1 true 3D
34 _direction = 0; // 1 XZ , 0 YZ , 2 XY
55 //---------------------------------------------------------------------------
56 baseFilterManualPaint::~baseFilterManualPaint() // virtual
60 //---------------------------------------------------------------------------
61 void baseFilterManualPaint::Run() // virtual
65 //---------------------------------------------------------------------------
66 void baseFilterManualPaint::SetGrayLevel(double graylevel) {
67 _graylevel = graylevel;
70 //---------------------------------------------------------------------------
71 void baseFilterManualPaint::Set2D3D(int dim2D3D) {
75 //---------------------------------------------------------------------------
76 void baseFilterManualPaint::SetDirection(int direction) {
77 _direction = direction;
80 //---------------------------------------------------------------------------
81 void baseFilterManualPaint::SetPoint(int px, int py, int pz) {
87 //---------------------------------------------------------------------------
88 void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
94 //EED 2017-01-01 Migration VTK7
95 #if VTK_MAJOR_VERSION <= 5
96 _image->GetWholeExtent(ext);
98 _image->GetExtent(ext);
108 //EED 2017-01-01 Migration VTK7
109 #if VTK_MAJOR_VERSION <= 5
110 _image2->GetWholeExtent(extB);
112 _image2->GetExtent(extB);
115 _maxX = std::min( ext[1]-ext[0] , extB[1]-extB[0] );
116 _maxY = std::min( ext[3]-ext[2] , extB[3]-extB[2] );
117 _maxZ = std::min( ext[5]-ext[4] , extB[5]-extB[4] );
119 _maxX = ext[1]-ext[0];
120 _maxY = ext[3]-ext[2];
121 _maxZ = ext[5]-ext[4];
126 //---------------------------------------------------------------------------
127 void baseFilterManualPaint::ResetGeneralMinMax() {
136 //---------------------------------------------------------------------------
137 void baseFilterManualPaint::SetGeneralMinMax(int minX, int maxX, int minY,
138 int maxY, int minZ, int maxZ) {
165 //---------------------------------------------------------------------------
166 void baseFilterManualPaint::GetScalarRange(double * range) {
167 range = this->_image->GetScalarRange();
170 //---------------------------------------------------------------------------
171 ImageMManager* baseFilterManualPaint::GetImageMManager() {
172 return (this->_IMManager);
175 //---------------------------------------------------------------------------
176 void baseFilterManualPaint::CleanImageMManager() {
177 this->_IMManager->CleanModifiedRegion();
183 //---------------------------------------------------------------------------
184 void baseFilterManualPaint::SetRangeMin(int min)
189 //---------------------------------------------------------------------------
190 void baseFilterManualPaint::SetRangeMax(int max)
195 //---------------------------------------------------------------------------
196 int baseFilterManualPaint::GetRangeMin()
201 //---------------------------------------------------------------------------
202 int baseFilterManualPaint::GetRangeMax()