DGtalTools  0.9.4
Data Structures | Public Types | Public Slots | Public Member Functions | Private Attributes
MainWindow Class Reference

#include <visualisation/sliceViewer.h>

Inherits QMainWindow.

Collaboration diagram for MainWindow:
Collaboration graph
[legend]

Data Structures

struct  ColorMapFunctor
 

Public Types

enum  ColorMapType { Id, GradientMapHot, GradientMapCool, HueshadeCM }
 
typedef DGtal::ImageContainerBySTLVector< DGtal::Z3i::Domain, unsigned char > Image3D
 
typedef DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned char > Image2D
 
typedef DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::IdentitySliceImageAdapter
 
typedef DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, ColorMapFunctorSliceImageAdapterFct
 

Public Slots

void updateSliceImageX ()
 
void updateSliceImageY ()
 
void updateSliceImageZ ()
 
void updateZoomImageX ()
 
void updateZoomImageY ()
 
void updateZoomImageZ ()
 
void setScale1_1_ImageX ()
 
void setScale1_1_ImageY ()
 
void setScale1_1_ImageZ ()
 
void changeNormalColorMap ()
 
void changeCoolColorMap ()
 
void changeHueColorMap ()
 
void changeHotColorMap ()
 

Public Member Functions

 MainWindow (DGtal::Viewer3D<> *viewer, DGtal::ImageContainerBySTLVector< DGtal::Z3i::Domain, unsigned char > *myImage3D, const ColorMapFunctor &aFunctor, QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~MainWindow ()
 
void setImageProjX (const QPixmap &aPixMap)
 
void setImageProjY (const QPixmap &aPixMap)
 
void setImageProjZ (const QPixmap &aPixMap)
 
void updateSliceImageX (int sliceNumber, bool init)
 
void updateSliceImageY (int sliceNumber, bool init)
 
void updateSliceImageZ (int sliceNumber, bool init)
 
void updateZoomImageX (int sliceNumber, double gridSize)
 
void updateZoomImageY (int sliceNumber, double gridSize)
 
void updateZoomImageZ (int sliceNumber, double gridSize)
 
void updateAllDisplayedImages ()
 

Private Attributes

Ui::MainWindow * ui
 
DGtal::Viewer3DmyViewer
 
Image3DmyImage3D
 
ColorMapFunctor myColorMap
 

Detailed Description

Definition at line 48 of file sliceViewer.h.

Member Typedef Documentation

Definition at line 96 of file sliceViewer.h.

Definition at line 95 of file sliceViewer.h.

Definition at line 98 of file sliceViewer.h.

Definition at line 100 of file sliceViewer.h.

Member Enumeration Documentation

Enumerator
Id 
GradientMapHot 
GradientMapCool 
HueshadeCM 

Definition at line 54 of file sliceViewer.h.

Constructor & Destructor Documentation

MainWindow::MainWindow ( DGtal::Viewer3D<> *  viewer,
DGtal::ImageContainerBySTLVector< DGtal::Z3i::Domain, unsigned char > *  myImage3D,
const ColorMapFunctor aFunctor,
QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)
explicit

Definition at line 138 of file sliceViewer.cpp.

References changeCoolColorMap(), changeHotColorMap(), changeHueColorMap(), changeNormalColorMap(), DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::HyperRectDomain< TSpace >::lowerBound(), setScale1_1_ImageX(), setScale1_1_ImageY(), setScale1_1_ImageZ(), ui, updateSliceImageX(), updateSliceImageY(), updateSliceImageZ(), updateZoomImageX(), updateZoomImageY(), updateZoomImageZ(), and DGtal::HyperRectDomain< TSpace >::upperBound().

140  :
141  QMainWindow(parent),
142  ui(new Ui::MainWindow),
143  myViewer(aViewer),
144  myImage3D(anImage),
145  myColorMap(aFunctor)
146 {
147 
148  ui->setupUi(this);
149  ui->verticalLayout_5->addWidget(aViewer);
150 
151 
152  ui->_horizontalSliderZ->setMinimum(anImage->domain().lowerBound()[2]);
153  ui->_horizontalSliderZ->setMaximum(anImage->domain().upperBound()[2]);
154  ui->_horizontalSliderZ->setValue(anImage->domain().lowerBound()[2]);
155 
156  ui->_horizontalSliderY->setMinimum(anImage->domain().lowerBound()[1]);
157  ui->_horizontalSliderY->setMaximum(anImage->domain().upperBound()[1]);
158  ui->_horizontalSliderY->setValue(anImage->domain().lowerBound()[1]);
159 
160  ui->_horizontalSliderX->setMinimum(anImage->domain().lowerBound()[0]);
161  ui->_horizontalSliderX->setMaximum(anImage->domain().upperBound()[0]);
162  ui->_horizontalSliderX->setValue(anImage->domain().lowerBound()[0]);
163 
164  ui->_zoomXSlider->setMinimum( MIN_ZOOM_FACTOR);
165  ui->_zoomXSlider->setMaximum( MAX_ZOOM_FACTOR);
166  ui->_zoomXSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
167 
168  ui->_zoomYSlider->setMinimum(MIN_ZOOM_FACTOR);
169  ui->_zoomYSlider->setMaximum(MAX_ZOOM_FACTOR);
170  ui->_zoomYSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
171 
172  ui->_zoomZSlider->setMinimum(MIN_ZOOM_FACTOR);
173  ui->_zoomZSlider->setMaximum(MAX_ZOOM_FACTOR);
174  ui->_zoomZSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
175 
176  QObject::connect(ui->_horizontalSliderX, SIGNAL(valueChanged(int)), this, SLOT(updateSliceImageX()));
177  QObject::connect(ui->_horizontalSliderY, SIGNAL(valueChanged(int)), this, SLOT(updateSliceImageY()));
178  QObject::connect(ui->_horizontalSliderZ, SIGNAL(valueChanged(int)), this, SLOT(updateSliceImageZ()));
179  QObject::connect(ui->_zoomXSlider, SIGNAL(valueChanged(int)), this, SLOT(updateZoomImageX()));
180  QObject::connect(ui->_zoomYSlider, SIGNAL(valueChanged(int)), this, SLOT(updateZoomImageY()));
181  QObject::connect(ui->_zoomZSlider, SIGNAL(valueChanged(int)), this, SLOT(updateZoomImageZ()));
182 
183  QObject::connect(ui->_scale1ButtonX, SIGNAL(clicked()), this, SLOT(setScale1_1_ImageX()));
184  QObject::connect(ui->_scale1ButtonY, SIGNAL(clicked()), this, SLOT(setScale1_1_ImageY()));
185  QObject::connect(ui->_scale1ButtonZ, SIGNAL(clicked()), this, SLOT(setScale1_1_ImageZ()));
186 
187  QObject::connect(ui->_CoolButton, SIGNAL(clicked()), this, SLOT(changeCoolColorMap()));
188  QObject::connect(ui->_HotButton, SIGNAL(clicked()), this, SLOT(changeHotColorMap()));
189  QObject::connect(ui->_HueButton, SIGNAL(clicked()), this, SLOT(changeHueColorMap()));
190  QObject::connect(ui->_NormalButton, SIGNAL(clicked()), this, SLOT(changeNormalColorMap()));
191 
192 
193 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void setScale1_1_ImageY()
void changeNormalColorMap()
void updateZoomImageX()
void changeCoolColorMap()
void updateZoomImageY()
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
void setScale1_1_ImageZ()
void updateSliceImageX()
void updateSliceImageZ()
void changeHotColorMap()
void setScale1_1_ImageX()
void updateZoomImageZ()
void changeHueColorMap()
DGtal::Viewer3D * myViewer
Definition: sliceViewer.h:143
void updateSliceImageY()
MainWindow::~MainWindow ( )

Definition at line 195 of file sliceViewer.cpp.

References ui.

196 {
197  delete ui;
198 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142

Member Function Documentation

void MainWindow::changeCoolColorMap ( )
slot

Definition at line 210 of file sliceViewer.cpp.

References GradientMapCool, myColorMap, and updateAllDisplayedImages().

Referenced by MainWindow().

210  {
213 }
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
void updateAllDisplayedImages()
void MainWindow::changeHotColorMap ( )
slot

Definition at line 218 of file sliceViewer.cpp.

References GradientMapHot, myColorMap, and updateAllDisplayedImages().

Referenced by MainWindow().

218  {
221 }
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
void updateAllDisplayedImages()
void MainWindow::changeHueColorMap ( )
slot

Definition at line 214 of file sliceViewer.cpp.

References HueshadeCM, myColorMap, and updateAllDisplayedImages().

Referenced by MainWindow().

214  {
217 }
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
void updateAllDisplayedImages()
void MainWindow::changeNormalColorMap ( )
slot

Definition at line 205 of file sliceViewer.cpp.

References Id, myColorMap, and updateAllDisplayedImages().

Referenced by MainWindow().

205  {
208 }
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
void updateAllDisplayedImages()
void MainWindow::setImageProjX ( const QPixmap &  aPixMap)

Definition at line 224 of file sliceViewer.cpp.

References ui.

Referenced by updateSliceImageX(), and updateZoomImageX().

224  {
225  ui->ImageProjX->setPixmap(aPixMap);
226 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void MainWindow::setImageProjY ( const QPixmap &  aPixMap)

Definition at line 227 of file sliceViewer.cpp.

References ui.

Referenced by updateSliceImageY(), and updateZoomImageY().

227  {
228  ui->ImageProjY->setPixmap(aPixMap);
229 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void MainWindow::setImageProjZ ( const QPixmap &  aPixMap)

Definition at line 230 of file sliceViewer.cpp.

References ui.

Referenced by updateSliceImageZ(), and updateZoomImageZ().

230  {
231  ui->ImageProjZ->setPixmap(aPixMap);
232 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void MainWindow::setScale1_1_ImageX ( )
slot

Definition at line 248 of file sliceViewer.cpp.

References ui, and updateZoomImageX().

Referenced by MainWindow().

248  {
249  ui->_zoomXSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
251 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageX()
void MainWindow::setScale1_1_ImageY ( )
slot

Definition at line 253 of file sliceViewer.cpp.

References ui, and updateZoomImageY().

Referenced by MainWindow().

253  {
254  ui->_zoomYSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
256 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageY()
void MainWindow::setScale1_1_ImageZ ( )
slot

Definition at line 258 of file sliceViewer.cpp.

References ui, and updateZoomImageZ().

Referenced by MainWindow().

258  {
259  ui->_zoomZSlider->setValue(INIT_SCALE1_ZOOM_FACTOR);
261 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageZ()
void MainWindow::updateAllDisplayedImages ( )

Definition at line 200 of file sliceViewer.cpp.

References updateSliceImageX(), updateSliceImageY(), and updateSliceImageZ().

Referenced by changeCoolColorMap(), changeHotColorMap(), changeHueColorMap(), and changeNormalColorMap().

200  {
204 }
void updateSliceImageX()
void updateSliceImageZ()
void updateSliceImageY()
void MainWindow::updateSliceImageX ( int  sliceNumber,
bool  init 
)

Definition at line 329 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, setImageProjX(), and ui.

329  {
331  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
332  invFunctor(myImage3D->domain().upperBound()));
333  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(0);
334  const functors::Identity identityFunctor{};
335  SliceImageAdapter sliceImage ( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
336 
337  double gridSize = ((double)INIT_SCALE1_ZOOM_FACTOR)/ui->_zoomXSlider->value();
338  QImage anImage = getImage(sliceImage, gridSize,myColorMap);
339  setImageProjX(QPixmap::fromImage(anImage));
340  Z3i::Point imageOrigin = myImage3D->domain().lowerBound();
341  if(init){
344  imageOrigin[1], imageOrigin[2]);
345  (*myViewer) << Viewer3D<>::updateDisplay;
346  }else{
348  (*myViewer) << DGtal::UpdateImagePosition< Space, KSpace >(0, DGtal::Viewer3D<>::xDirection, sliceNumber, imageOrigin[1],
349  imageOrigin[2]);
350 
351  (*myViewer).updateList(init);
352  (*myViewer).update();
353  }
354 
355 
356 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
const Domain & domain() const
void setImageProjX(const QPixmap &aPixMap)
void MainWindow::updateSliceImageX ( )
slot

Definition at line 235 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and updateAllDisplayedImages().

235  {
236  updateSliceImageX(ui->_horizontalSliderX->value(), false);
237 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateSliceImageX()
void MainWindow::updateSliceImageY ( int  sliceNumber,
bool  init 
)

Definition at line 359 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, setImageProjY(), and ui.

359  {
360 
362  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
363  invFunctor(myImage3D->domain().upperBound()));
364  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(1);
365  const functors::Identity identityFunctor{};
366  SliceImageAdapter sliceImage( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
367 
368  double gridSize = ((double)INIT_SCALE1_ZOOM_FACTOR)/ui->_zoomYSlider->value();
369  QImage anImage = getImage(sliceImage, gridSize, myColorMap);
370  setImageProjY(QPixmap::fromImage(anImage));
371  Z3i::Point imageOrigin = myImage3D->domain().lowerBound();
372  if(init){
375  sliceNumber, imageOrigin[2]);
376  (*myViewer) << Viewer3D<>::updateDisplay;
377  }else{
379  (*myViewer) << DGtal::UpdateImagePosition< Space, KSpace >(1, DGtal::Viewer3D<>::yDirection, imageOrigin[0],
380  sliceNumber, imageOrigin[2]);
381  (*myViewer).updateList(init);
382  (*myViewer).update();
383  }
384 
385 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
void setImageProjY(const QPixmap &aPixMap)
const Domain & domain() const
void MainWindow::updateSliceImageY ( )
slot

Definition at line 239 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and updateAllDisplayedImages().

239  {
240  updateSliceImageY(ui->_horizontalSliderY->value(), false);
241 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateSliceImageY()
void MainWindow::updateSliceImageZ ( int  sliceNumber,
bool  init 
)

Definition at line 388 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, setImageProjZ(), and ui.

388  {
389 
391  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
392  invFunctor(myImage3D->domain().upperBound()));
393  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(2);
394  const functors::Identity identityFunctor{};
395  SliceImageAdapter sliceImage( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
396  double gridSize = (double)INIT_SCALE1_ZOOM_FACTOR/ui->_zoomZSlider->value();
397  QImage anImage = getImage(sliceImage, gridSize, myColorMap);
398  setImageProjZ(QPixmap::fromImage(anImage));
399  Z3i::Point imageOrigin = myImage3D->domain().lowerBound();
400  if(init){
403  imageOrigin[1], sliceNumber);
404 
405  (*myViewer) << Viewer3D<>::updateDisplay;
406  }else{
408  myColorMap);
409  (*myViewer) << DGtal::UpdateImagePosition< Space, KSpace >(2, DGtal::Viewer3D<>::zDirection, imageOrigin[0],
410  imageOrigin[1], sliceNumber);
411  (*myViewer).updateList(init);
412  (*myViewer).update();
413  }
414 
415 
416 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
void setImageProjZ(const QPixmap &aPixMap)
const Domain & domain() const
void MainWindow::updateSliceImageZ ( )
slot

Definition at line 243 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and updateAllDisplayedImages().

243  {
244  updateSliceImageZ(ui->_horizontalSliderZ->value(), false);
245 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateSliceImageZ()
void MainWindow::updateZoomImageX ( int  sliceNumber,
double  gridSize 
)

Definition at line 293 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, and setImageProjX().

293  {
295  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
296  invFunctor(myImage3D->domain().upperBound()));
297  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(0);
298  const functors::Identity identityFunctor{};
299  SliceImageAdapter sliceImage( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
300  QImage anImage = getImage(sliceImage, gridSize, myColorMap);
301  setImageProjX(QPixmap::fromImage(anImage));
302 }
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
const Domain & domain() const
void setImageProjX(const QPixmap &aPixMap)
void MainWindow::updateZoomImageX ( )
slot

Definition at line 265 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and setScale1_1_ImageX().

265  {
266  double gridSize = (double)INIT_SCALE1_ZOOM_FACTOR/ui->_zoomXSlider->value();
267  updateZoomImageX(ui->_horizontalSliderX->value(), gridSize );
268  QString gridStr = QString::number(gridSize, 'f', 3);
269  QString scaleStr = QString::number(1.0/gridSize, 'f', 3);
270  ui->_groupBoxX->setTitle(QString("Slice View X: sampling grid size: ").append(gridStr).
271  append(QString(" (zoom x "). append(scaleStr).append(QString(")") )));
272 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageX()
void MainWindow::updateZoomImageY ( int  sliceNumber,
double  gridSize 
)

Definition at line 304 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, and setImageProjY().

304  {
306  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
307  invFunctor(myImage3D->domain().upperBound()));
308  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(1);
309  const functors::Identity identityFunctor{};
310  SliceImageAdapter sliceImage( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
311 
312  QImage anImage = getImage(sliceImage, gridSize, myColorMap);
313  setImageProjY(QPixmap::fromImage(anImage));
314 }
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
void setImageProjY(const QPixmap &aPixMap)
const Domain & domain() const
void MainWindow::updateZoomImageY ( )
slot

Definition at line 273 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and setScale1_1_ImageY().

273  {
274  double gridSize = (double)INIT_SCALE1_ZOOM_FACTOR/ui->_zoomYSlider->value();
275  updateZoomImageY(ui->_horizontalSliderY->value(), gridSize );
276  QString gridStr = QString::number(gridSize, 'f', 3);
277  QString scaleStr = QString::number(1.0/gridSize, 'f', 3);
278  ui->_groupBoxY->setTitle(QString("Slice View Y: sampling grid size: ").append(gridStr).
279  append(QString(" (zoom x "). append(scaleStr).append(QString(")") )));
280 
281 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageY()
void MainWindow::updateZoomImageZ ( int  sliceNumber,
double  gridSize 
)

Definition at line 317 of file sliceViewer.cpp.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::functors::Projector< S >::initAddOneDim(), DGtal::functors::Projector< S >::initRemoveOneDim(), myColorMap, myImage3D, and setImageProjZ().

317  {
319  DGtal::Z2i::Domain domain2D(invFunctor(myImage3D->domain().lowerBound()),
320  invFunctor(myImage3D->domain().upperBound()));
321  DGtal::functors::Projector<DGtal::Z3i::Space> aSliceFunctor(sliceNumber); aSliceFunctor.initAddOneDim(2);
322  const functors::Identity identityFunctor{};
323  SliceImageAdapter sliceImage( *myImage3D, domain2D, aSliceFunctor, identityFunctor );
324  QImage anImage = getImage(sliceImage, gridSize, myColorMap );
325  setImageProjZ(QPixmap::fromImage(anImage));
326 }
void initRemoveOneDim(const Dimension &dimRemoved)
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: sliceViewer.h:98
ColorMapFunctor myColorMap
Definition: sliceViewer.h:145
Image3D * myImage3D
Definition: sliceViewer.h:144
void setImageProjZ(const QPixmap &aPixMap)
const Domain & domain() const
void MainWindow::updateZoomImageZ ( )
slot

Definition at line 282 of file sliceViewer.cpp.

References ui.

Referenced by MainWindow(), and setScale1_1_ImageZ().

282  {
283  double gridSize = (double)INIT_SCALE1_ZOOM_FACTOR/ui->_zoomZSlider->value();
284  updateZoomImageZ(ui->_horizontalSliderZ->value(), gridSize );
285  QString gridStr = QString::number(gridSize, 'f', 3);
286  QString scaleStr = QString::number(1.0/gridSize, 'f', 3);
287  ui->_groupBoxZ->setTitle(QString("Slice View Z: sampling grid size: ").append(gridStr).
288  append(QString(" (zoom x "). append(scaleStr).append(QString(")") )));
289 
290 }
Ui::MainWindow * ui
Definition: sliceViewer.h:142
void updateZoomImageZ()

Field Documentation

ColorMapFunctor MainWindow::myColorMap
private
Image3D* MainWindow::myImage3D
private
DGtal::Viewer3D* MainWindow::myViewer
private

Definition at line 143 of file sliceViewer.h.

Ui::MainWindow* MainWindow::ui
private

The documentation for this class was generated from the following files: