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() // 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 //---------------------------------------------------------------------------
88 void baseFilterManualPaint::SetPoint(int px, int py, int pz)
95 //---------------------------------------------------------------------------
96 void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
101 //EED 2017-01-01 Migration VTK7
102 #if VTK_MAJOR_VERSION <= 5
103 _image->GetWholeExtent(ext);
105 _image->GetExtent(ext);
114 //EED 2017-01-01 Migration VTK7
115 #if VTK_MAJOR_VERSION <= 5
116 _image2->GetWholeExtent(extB);
118 _image2->GetExtent(extB);
121 _dimX = std::min( ext[1]-ext[0]+1 , extB[1]-extB[0]+1 );
122 _dimY = std::min( ext[3]-ext[2]+1 , extB[3]-extB[2]+1 );
123 _dimZ = std::min( ext[5]-ext[4]+1 , extB[5]-extB[4]+1 );
125 _dimX = ext[1]-ext[0]+1;
126 _dimY = ext[3]-ext[2]+1;
127 _dimZ = ext[5]-ext[4]+1;
132 _OnePlane = _dimX*_dimY;
137 /*//EED 2020-04-28 BORRAME Change to local variables to use with openmp
139 //---------------------------------------------------------------------------
140 void baseFilterManualPaint::ResetGeneralMinMax()
150 //---------------------------------------------------------------------------
151 void baseFilterManualPaint::SetGeneralMinMax(int minX, int maxX, int minY,
152 int maxY, int minZ, int maxZ)
154 if (_pMinX > minX) { _pMinX = minX; }
155 if (_pMinY > minY) { _pMinY = minY; }
156 if (_pMinZ > minZ) { _pMinZ = minZ; }
157 if (_pMaxX < maxX) { _pMaxX = maxX; }
158 if (_pMaxY < maxY) { _pMaxY = maxY; }
159 if (_pMaxZ < maxZ) { _pMaxZ = maxZ; }
164 //---------------------------------------------------------------------------
165 void baseFilterManualPaint::GetScalarRange(double * range)
167 range = this->_image->GetScalarRange();
170 //---------------------------------------------------------------------------
171 ImageMManager* baseFilterManualPaint::GetImageMManager()
173 return (this->_IMManager);
176 //---------------------------------------------------------------------------
177 void baseFilterManualPaint::CleanImageMManager()
179 this->_IMManager->CleanModifiedRegion();
182 //---------------------------------------------------------------------------
183 void baseFilterManualPaint::SetRangeMin(int min)
188 //---------------------------------------------------------------------------
189 void baseFilterManualPaint::SetRangeMax(int max)
194 //---------------------------------------------------------------------------
195 int baseFilterManualPaint::GetRangeMin()
200 //---------------------------------------------------------------------------
201 int baseFilterManualPaint::GetRangeMax()