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
41 //EED 2020-04-28 BORRAME Change to local variables to use with openmp
59 //---------------------------------------------------------------------------
60 baseFilterManualPaint::~baseFilterManualPaint() // virtual
64 //---------------------------------------------------------------------------
65 void baseFilterManualPaint::Run(int px, int py, int pz) // virtual
69 //---------------------------------------------------------------------------
70 void baseFilterManualPaint::SetGrayLevel(double graylevel)
72 _graylevel = graylevel;
75 //---------------------------------------------------------------------------
76 void baseFilterManualPaint::Set2D3D(int dim2D3D)
81 //---------------------------------------------------------------------------
82 void baseFilterManualPaint::SetDirection(int direction)
84 _direction = direction;
87 /* //EED 2020-04-28 BORRAME Change to local variables to use with openmp
88 //---------------------------------------------------------------------------
89 void baseFilterManualPaint::SetPoint(int px, int py, int pz)
97 //---------------------------------------------------------------------------
98 void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
103 //EED 2017-01-01 Migration VTK7
104 #if VTK_MAJOR_VERSION <= 5
105 _image->GetWholeExtent(ext);
107 _image->GetExtent(ext);
116 //EED 2017-01-01 Migration VTK7
117 #if VTK_MAJOR_VERSION <= 5
118 _image2->GetWholeExtent(extB);
120 _image2->GetExtent(extB);
123 _dimX = std::min( ext[1]-ext[0]+1 , extB[1]-extB[0]+1 );
124 _dimY = std::min( ext[3]-ext[2]+1 , extB[3]-extB[2]+1 );
125 _dimZ = std::min( ext[5]-ext[4]+1 , extB[5]-extB[4]+1 );
127 _dimX = ext[1]-ext[0]+1;
128 _dimY = ext[3]-ext[2]+1;
129 _dimZ = ext[5]-ext[4]+1;
134 _OnePlane = _dimX*_dimY;
139 /*//EED 2020-04-28 BORRAME Change to local variables to use with openmp
141 //---------------------------------------------------------------------------
142 void baseFilterManualPaint::ResetGeneralMinMax()
152 //---------------------------------------------------------------------------
153 void baseFilterManualPaint::SetGeneralMinMax(int minX, int maxX, int minY,
154 int maxY, int minZ, int maxZ)
156 if (_pMinX > minX) { _pMinX = minX; }
157 if (_pMinY > minY) { _pMinY = minY; }
158 if (_pMinZ > minZ) { _pMinZ = minZ; }
159 if (_pMaxX < maxX) { _pMaxX = maxX; }
160 if (_pMaxY < maxY) { _pMaxY = maxY; }
161 if (_pMaxZ < maxZ) { _pMaxZ = maxZ; }
166 //---------------------------------------------------------------------------
167 void baseFilterManualPaint::GetScalarRange(double * range)
169 range = this->_image->GetScalarRange();
172 //---------------------------------------------------------------------------
173 ImageMManager* baseFilterManualPaint::GetImageMManager()
175 return (this->_IMManager);
178 //---------------------------------------------------------------------------
179 void baseFilterManualPaint::CleanImageMManager()
181 this->_IMManager->CleanModifiedRegion();
184 //---------------------------------------------------------------------------
185 void baseFilterManualPaint::SetRangeMin(int min)
190 //---------------------------------------------------------------------------
191 void baseFilterManualPaint::SetRangeMax(int max)
196 //---------------------------------------------------------------------------
197 int baseFilterManualPaint::GetRangeMin()
202 //---------------------------------------------------------------------------
203 int baseFilterManualPaint::GetRangeMax()