fw4spl
SNegato.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "scene2D/adaptor/SNegato.hpp"
8 
9 #include <fwCom/Signal.hpp>
10 #include <fwCom/Signal.hxx>
11 #include <fwCom/Signals.hpp>
12 #include <fwCom/Slot.hpp>
13 #include <fwCom/Slot.hxx>
14 #include <fwCom/Slots.hpp>
15 #include <fwCom/Slots.hxx>
16 
17 #include <fwData/Image.hpp>
18 #include <fwData/TransferFunction.hpp>
19 
20 #include <fwDataTools/fieldHelper/Image.hpp>
21 #include <fwDataTools/fieldHelper/MedicalImageHelpers.hpp>
22 #include <fwDataTools/helper/Image.hpp>
23 
24 #include <fwRenderQt/Scene2DGraphicsView.hpp>
25 
26 #include <fwServices/macros.hpp>
27 
28 #include <QBitmap>
29 #include <QGraphicsItemGroup>
30 #include <QPixmap>
31 #include <QPoint>
32 
33 fwServicesRegisterMacro( ::fwRenderQt::IAdaptor, ::scene2D::adaptor::SNegato );
34 
35 namespace scene2D
36 {
37 namespace adaptor
38 {
39 static const ::fwServices::IService::KeyType s_IMAGE_INOUT = "image";
40 static const ::fwServices::IService::KeyType s_TF_INOUT = "tf";
41 
42 static const ::fwCom::Slots::SlotKeyType s_UPDATE_SLICE_INDEX_SLOT = "updateSliceIndex";
43 static const ::fwCom::Slots::SlotKeyType s_UPDATE_SLICE_TYPE_SLOT = "updateSliceType";
44 static const ::fwCom::Slots::SlotKeyType s_UPDATE_BUFFER_SLOT = "updateBuffer";
45 static const ::fwCom::Slots::SlotKeyType s_UPDATE_VISIBILITY_SLOT = "updateVisibility";
46 
47 typedef ::fwDataTools::helper::MedicalImageAdaptor MedicalImageAdaptor;
48 
49 //-----------------------------------------------------------------------------
50 
51 SNegato::SNegato() noexcept :
52  m_qimg(nullptr),
53  m_pixmapItem(nullptr),
54  m_layer(nullptr),
55  m_orientation(MedicalImageAdaptor::Z_AXIS),
56  m_pointIsCaptured(false),
57  m_changeSliceTypeAllowed(true)
58 {
59  this->installTFSlots(this);
60  newSlot(s_UPDATE_SLICE_INDEX_SLOT, &SNegato::updateSliceIndex, this);
61  newSlot(s_UPDATE_SLICE_TYPE_SLOT, &SNegato::updateSliceType, this);
62  newSlot(s_UPDATE_BUFFER_SLOT, &SNegato::updateBuffer, this);
63  newSlot(s_UPDATE_VISIBILITY_SLOT, &SNegato::updateVisibility, this);
64 }
65 
66 //-----------------------------------------------------------------------------
67 
68 SNegato::~SNegato() noexcept
69 {
70 }
71 
72 //-----------------------------------------------------------------------------
73 
75 {
76  this->configureParams();
77 
78  const ConfigType config = this->getConfigTree().get_child("config.<xmlattr>");
79 
80  if( config.count("orientation") )
81  {
82  const std::string orientationValue = config.get<std::string>("orientation");
83 
84  if ( orientationValue == "axial" )
85  {
86  m_orientation = MedicalImageAdaptor::Z_AXIS;
87  }
88  else if ( orientationValue == "sagittal" )
89  {
90  m_orientation = MedicalImageAdaptor::X_AXIS;
91  }
92  else if ( orientationValue == "frontal" )
93  {
94  m_orientation = MedicalImageAdaptor::Y_AXIS;
95  }
96  }
97 
98  if(config.count("changeSliceType"))
99  {
100  const std::string changeValue = config.get<std::string>("changeSliceType");
101 
102  if(changeValue == "true" || changeValue == "yes")
103  {
104  m_changeSliceTypeAllowed = true;
105  }
106  else if(changeValue == "no" || changeValue == "false")
107  {
108  m_changeSliceTypeAllowed = false;
109  }
110  }
111 }
112 
113 //-----------------------------------------------------------------------------
114 
115 void SNegato::updateBufferFromImage( QImage* qimg )
116 {
117  if(!qimg)
118  {
119  return;
120  }
121  // Window min/max
122  ::fwData::TransferFunction::sptr tf = this->getTransferFunction();
123  const double wlMin = tf->getWLMinMax().first;
124 
125  // Window max
126  ::fwData::Image::sptr image = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
127  ::fwDataTools::helper::Image imgHelper(image);
128  const ::fwData::Image::SizeType size = image->getSize();
129  const short* imgBuff = static_cast<const short*>(imgHelper.getBuffer());
130  const size_t imageZOffset = size[0] * size[1];
131 
132  const double tfMin = tf->getMinMaxTFValues().first;
133  const double tfMax = tf->getMinMaxTFValues().second;
134  const double tfWin = (1. / tf->getWindow()) * ((tfMax - tfMin) + tfMin);
135 
136  std::uint8_t* pDest = qimg->bits();
137 
138  // Fill image according to current slice type:
139  if( m_orientation == MedicalImageAdaptor::X_AXIS ) // sagittal
140  {
141  const size_t sagitalIndex = static_cast<size_t>(m_sagittalIndex->value());
142 
143  for( size_t z = 0; z < size[2]; ++z)
144  {
145  const size_t zOffset = (size[2] - 1 - z) * imageZOffset;
146  const size_t zxOffset = zOffset + sagitalIndex;
147 
148  for( size_t y = 0; y < size[1]; ++y )
149  {
150  const QRgb val = this->getQImageVal(zxOffset + y * size[0], imgBuff, wlMin, tfWin, tf);
151 
152  *pDest++ = static_cast<std::uint8_t>(qRed(val));
153  *pDest++ = static_cast<std::uint8_t>(qGreen(val));
154  *pDest++ = static_cast<std::uint8_t>(qBlue(val));
155  }
156  }
157  }
158  else if( m_orientation == MedicalImageAdaptor::Y_AXIS ) // frontal
159  {
160  const size_t frontalIndex = static_cast<size_t>(m_frontalIndex->value());
161  const size_t yOffset = frontalIndex * size[0];
162 
163  for( size_t z = 0; z < size[2]; ++z)
164  {
165  const size_t zOffset = (size[2] - 1 - z) * imageZOffset;
166  const size_t zyOffset = zOffset + yOffset;
167 
168  for( size_t x = 0; x < size[0]; ++x )
169  {
170  const QRgb val = this->getQImageVal(zyOffset + x, imgBuff, wlMin, tfWin, tf);
171 
172  *pDest++ = static_cast<std::uint8_t>(qRed(val));
173  *pDest++ = static_cast<std::uint8_t>(qGreen(val));
174  *pDest++ = static_cast<std::uint8_t>(qBlue(val));
175  }
176  }
177  }
178  else if( m_orientation == MedicalImageAdaptor::Z_AXIS ) // axial
179  {
180  const size_t axialIndex = static_cast<size_t>(m_axialIndex->value());
181  const size_t zOffset = axialIndex * imageZOffset;
182 
183  for( size_t y = 0; y < size[1]; ++y )
184  {
185  const size_t yOffset = y * size[0];
186  const size_t zyOffset = zOffset + yOffset;
187 
188  for( size_t x = 0; x < size[0]; ++x )
189  {
190  const QRgb val = this->getQImageVal(zyOffset + x, imgBuff, wlMin, tfWin, tf);
191 
192  *pDest++ = static_cast<std::uint8_t>(qRed(val));
193  *pDest++ = static_cast<std::uint8_t>(qGreen(val));
194  *pDest++ = static_cast<std::uint8_t>(qBlue(val));
195  }
196  }
197  }
198 
199  QPixmap m_pixmap = QPixmap::fromImage( *m_qimg );
200  m_pixmapItem->setPixmap(m_pixmap);
201 }
202 
203 //-----------------------------------------------------------------------------
204 
205 QRgb SNegato::getQImageVal(const size_t index, const short* buffer, double wlMin, double tfWin,
206  const fwData::TransferFunction::sptr& tf)
207 {
208  const short val16 = buffer[index];
209 
210  double value = (val16 - wlMin) * tfWin;
211 
212  const ::fwData::TransferFunction::TFColor color = tf->getInterpolatedColor(value);
213 
214  // use QImage::Format_RGBA8888 in QImage if you need alpha value
215  return qRgb(static_cast<int>(color.r*255), static_cast<int>(color.g*255), static_cast<int>(color.b*255));
216 }
217 
218 //---------------------------------------------------------------------------
219 
220 QImage* SNegato::createQImage()
221 {
222  ::fwData::Image::sptr img = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
223 
225  {
226  return nullptr;
227  }
228 
229  const ::fwData::Image::SizeType size = img->getSize();
230  const ::fwData::Image::SpacingType spacing = img->getSpacing();
231  const ::fwData::Image::OriginType origin = img->getOrigin();
232 
233  double qImageSpacing[2];
234  double qImageOrigin[2];
235  int qImageSize[2];
236 
237  switch ( m_orientation )
238  {
239  case MedicalImageAdaptor::X_AXIS:// sagittal
240  this->m_yAxis->setScale(-1);
241  qImageSize[0] = static_cast<int>(size[1]);
242  qImageSize[1] = static_cast<int>(size[2]);
243  qImageSpacing[0] = spacing[1];
244  qImageSpacing[1] = spacing[2];
245  qImageOrigin[0] = origin[1] - 0.5f*spacing[1];
246  qImageOrigin[1] = -( origin[2] + size[2] * spacing[2] - 0.5f*spacing[2]);
247  break;
248 
249  case MedicalImageAdaptor::Y_AXIS:// frontal
250  qImageSize[0] = static_cast<int>(size[0]);
251  qImageSize[1] = static_cast<int>(size[2]);
252  qImageSpacing[0] = spacing[0];
253  qImageSpacing[1] = spacing[2];
254  qImageOrigin[0] = origin[0] - 0.5f*spacing[0];
255  qImageOrigin[1] = -( origin[2] + size[2] * spacing[2] - 0.5f*spacing[2]);
256  break;
257 
258  case MedicalImageAdaptor::Z_AXIS:// axial
259  qImageSize[0] = static_cast<int>(size[0]);
260  qImageSize[1] = static_cast<int>(size[1]);
261  qImageSpacing[0] = spacing[0];
262  qImageSpacing[1] = spacing[1];
263  qImageOrigin[0] = origin[0] - 0.5f*spacing[0];
264  qImageOrigin[1] = origin[1] - 0.5f*spacing[1];
265  break;
266 
267  default:
268  SLM_FATAL("Unsupported value for m_orientation");
269  break;
270  }
271 
272  // Create empty QImage
273  QImage* qimage = new QImage(qImageSize[0], qImageSize[1], QImage::Format_RGB888);
274 
275  // Place m_pixmapItem
276  m_pixmapItem->resetTransform();
277  m_pixmapItem->setTransform(QTransform::fromScale(qImageSpacing[0], qImageSpacing[1]), true);
278  m_pixmapItem->setPos(qImageOrigin[0], qImageOrigin[1]);
279 
280  // Force bounding box recomputing ( Qt bug )
281  m_layer->removeFromGroup( m_pixmapItem );
282  m_layer->addToGroup( m_pixmapItem );
283 
284  // Update image scene
285  this->getScene2DRender()->updateSceneSize( 0.20f );
286 
287  return qimage;
288 }
289 
290 //-----------------------------------------------------------------------------
291 
293 {
294  ::fwData::TransferFunction::sptr tf = this->getInOut< ::fwData::TransferFunction >(s_TF_INOUT);
295  this->setTransferFunction(tf);
296 
297  ::fwData::Image::sptr image = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
298  this->updateImageInfos( image );
299  this->createTransferFunction( image );
300 
301  m_pixmapItem = new QGraphicsPixmapItem();
302  m_pixmapItem->setShapeMode( QGraphicsPixmapItem::BoundingRectShape );
303  m_pixmapItem->setTransformationMode(Qt::SmoothTransformation);
304  m_layer = new QGraphicsItemGroup();
305  m_layer->resetTransform();
306  m_layer->addToGroup( m_pixmapItem );
307  m_layer->setPos( m_xAxis->getOrigin(), m_yAxis->getOrigin() );
308  m_layer->setZValue( m_zValue );
309  this->getScene2DRender()->getScene()->addItem( m_layer );
310 
311  m_qimg = this->createQImage();
312  this->updateBufferFromImage( m_qimg );
313 
314  this->getScene2DRender()->updateSceneSize( 1.f );
315 
316  this->installTFConnections();
317 }
318 
319 //-----------------------------------------------------------------------------
320 
322 {
323  m_qimg = this->createQImage();
324  this->updateBufferFromImage( m_qimg );
325 }
326 
327 //------------------------------------------------------------------------------
328 
329 void SNegato::swapping(const KeyType& key)
330 {
331  if (key == s_TF_INOUT)
332  {
333  ::fwData::TransferFunction::sptr tf = this->getInOut< ::fwData::TransferFunction >(s_TF_INOUT);
334  ::fwData::Image::sptr image = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
335  SLM_ASSERT("Missing image", image);
336 
337  this->setOrCreateTF(tf, image);
338  this->updating();
339  }
340 }
341 
342 //-----------------------------------------------------------------------------
343 
344 void SNegato::updateSliceIndex(int axial, int frontal, int sagittal)
345 {
346  m_axialIndex->value() = axial;
347  m_frontalIndex->value() = frontal;
348  m_sagittalIndex->value() = sagittal;
349 
350  ::fwData::Image::sptr image = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
351  this->updateImageInfos( image );
352  this->updateBufferFromImage( m_qimg );
353 }
354 
355 //-----------------------------------------------------------------------------
356 
357 void SNegato::updateSliceType(int from, int to)
358 {
359  if (m_changeSliceTypeAllowed)
360  {
361  if( to == static_cast< int > ( m_orientation ) )
362  {
363  m_orientation = static_cast< MedicalImageAdaptor::Orientation > ( from );
364  }
365  else if(from == static_cast<int>(m_orientation))
366  {
367  m_orientation = static_cast< MedicalImageAdaptor::Orientation >( to );
368  }
369 
370  // manages the modification of axes
371  if ( m_orientation == MedicalImageAdaptor::Z_AXIS )
372  {
373  this->m_yAxis->setScale(1);
374  }
375  else
376  {
377  this->m_yAxis->setScale(-1);
378  }
379 
380  this->updating();
381  }
382 }
383 
384 //-----------------------------------------------------------------------------
385 
386 void SNegato::updateVisibility(bool isVisible)
387 {
388  if( isVisible ) // display the scene
389  {
390  m_layer->setVisible(true);
391  }
392  else // remove the layer from the scene
393  {
394  m_layer->setVisible(false);
395  }
396 }
397 
398 //-----------------------------------------------------------------------------
399 
400 void SNegato::updateBuffer()
401 {
402  this->updateBufferFromImage(m_qimg);
403 }
404 
405 //------------------------------------------------------------------------------
406 
408 {
409  this->updateBufferFromImage( m_qimg );
410 }
411 
412 //------------------------------------------------------------------------------
413 
414 void SNegato::updateTFWindowing(double window, double level)
415 {
416  this->updateBufferFromImage( m_qimg );
417 }
418 
419 //-----------------------------------------------------------------------------
420 
422 {
423  this->removeTFConnections();
424 
425  this->getScene2DRender()->getScene()->removeItem(m_layer);
426 
427  delete m_qimg;
428  delete m_pixmapItem;
429  delete m_layer;
430 }
431 
432 //-----------------------------------------------------------------------------
433 
435 {
436  // if a key is pressed
437  if(_event.getType() == ::fwRenderQt::data::Event::KeyRelease)
438  {
439  // if pressed key is 'R'
440  if ( _event.getKey() == Qt::Key_R )
441  {
442  // get image origin
443  QRectF recImage = m_pixmapItem->sceneBoundingRect();
444 
445  ::fwRenderQt::data::Viewport::sptr sceneViewport = this->getScene2DRender()->getViewport();
446 
447  float sceneWidth = static_cast<float>(this->getScene2DRender()->getView()->width());
448  float sceneHeight = static_cast<float>(this->getScene2DRender()->getView()->height());
449 
450  float ratioYonXimage = recImage.height() / recImage.width();
451  float sceneRatio = sceneHeight / sceneWidth;
452 
453  if ( sceneRatio > ratioYonXimage ) // used scene ratio
454  {
455  float widthViewPortNew = recImage.width();
456  float heightViewPortNew = widthViewPortNew * sceneRatio;
457 
458  // computes new y origin
459  float newOrigineY = recImage.y() - ( heightViewPortNew - recImage.height() ) / 2.f;
460 
461  sceneViewport->setX( recImage.x() );
462  sceneViewport->setY( newOrigineY );
463  sceneViewport->setWidth( widthViewPortNew );
464  sceneViewport->setHeight( heightViewPortNew );
465  }
466  else
467  {
468  float heightViewPortNew = recImage.height();
469  float widthViewPortNew = heightViewPortNew / sceneRatio;
470 
471  // computes new x origin
472  float newOrigineX = recImage.x() - (widthViewPortNew - recImage.width() )/ 2.f;
473 
474  sceneViewport->setX( newOrigineX );
475  sceneViewport->setY( recImage.y() );
476  sceneViewport->setWidth( widthViewPortNew );
477  sceneViewport->setHeight( heightViewPortNew );
478  }
479 
480  this->getScene2DRender()->getView()->updateFromViewport();
481  }
482 
483  //image pixel
484  if ( _event.getKey() == Qt::Key_F )
485  {
486  m_pixmapItem->setTransformationMode(Qt::FastTransformation);
487  this->updating();
488  }
489 
490  //image smooth
491  if ( _event.getKey() == Qt::Key_S )
492  {
493  m_pixmapItem->setTransformationMode(Qt::SmoothTransformation);
494  this->updating();
495  }
496  }
497 
498  ::fwRenderQt::data::Coord coord = this->getScene2DRender()->mapToScene( _event.getCoord() );
499  coord.setX( coord.getX() / m_layer->scale());
500  coord.setY( coord.getY() / m_layer->scale());
501 
502  if ( _event.getType() == ::fwRenderQt::data::Event::MouseButtonPress
503  && _event.getButton() == ::fwRenderQt::data::Event::RightButton
504  && _event.getModifier() == ::fwRenderQt::data::Event::NoModifier )
505  {
506  m_pointIsCaptured = true;
507  m_oldCoord = _event.getCoord();
508  _event.setAccepted(true);
509  }
510  else if ( m_pointIsCaptured )
511  {
512  if( _event.getType() == ::fwRenderQt::data::Event::MouseMove )
513  {
514  ::fwRenderQt::data::Coord newCoord = _event.getCoord();
515  this->changeImageMinMaxFromCoord( m_oldCoord, newCoord );
516  m_oldCoord = newCoord;
517  _event.setAccepted(true);
518  }
519  else if( _event.getButton() == ::fwRenderQt::data::Event::RightButton
520  && _event.getType() == ::fwRenderQt::data::Event::MouseButtonRelease )
521  {
522  m_pointIsCaptured = false;
523  _event.setAccepted(true);
524  }
525  }
526 }
527 
528 //-----------------------------------------------------------------------------
529 
530 void SNegato::changeImageMinMaxFromCoord( ::fwRenderQt::data::Coord& oldCoord, ::fwRenderQt::data::Coord& newCoord )
531 {
532  ::fwData::Image::sptr image = this->getInOut< ::fwData::Image >(s_IMAGE_INOUT);
533  ::fwData::TransferFunction::sptr tf = this->getTransferFunction();
534 
535  const double min = tf->getWLMinMax().first;
536  const double max = tf->getWLMinMax().second;
537 
538  const double window = newCoord.getX() - m_oldCoord.getX();
539  const double level = newCoord.getY() - m_oldCoord.getY();
540 
541  const double imgWindow = max - min;
542  const double imgLevel = min + imgWindow/2.0;
543 
544  const double newImgLevel = imgLevel + level;
545  const double newImgWindow = imgWindow + imgWindow * window/100.0;
546 
547  this->updating();
548 
549  // Send signal
550  tf->setWindow(newImgWindow);
551  tf->setLevel(newImgLevel);
554  {
555  ::fwCom::Connection::Blocker block(sig->getConnection(m_slotUpdateTFWindowing));
556  sig->asyncEmit( newImgWindow, newImgLevel);
557  }
558 }
559 
560 //------------------------------------------------------------------------------
561 
563 {
564  KeyConnectionsMap connections;
565  connections.push( s_IMAGE_INOUT, ::fwData::Image::s_MODIFIED_SIG, s_UPDATE_SLOT );
566  connections.push( s_IMAGE_INOUT, ::fwData::Image::s_SLICE_INDEX_MODIFIED_SIG, s_UPDATE_SLICE_INDEX_SLOT );
567  connections.push( s_IMAGE_INOUT, ::fwData::Image::s_SLICE_TYPE_MODIFIED_SIG, s_UPDATE_SLICE_TYPE_SLOT );
568  connections.push( s_IMAGE_INOUT, ::fwData::Image::s_BUFFER_MODIFIED_SIG, s_UPDATE_BUFFER_SLOT );
569  connections.push( s_IMAGE_INOUT, ::fwData::Image::s_VISIBILITY_MODIFIED_SIG, s_UPDATE_VISIBILITY_SLOT );
570  return connections;
571 }
572 
573 //-----------------------------------------------------------------------------
574 
575 } // namespace adaptor
576 } // namespace scene2D
577 
Root class for all scene2d adaptors.
SCENE2D_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
Definition: SNegato.cpp:421
::fwRenderQt::data::Axis::sptr m_xAxis
The x Axis.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_SLICE_INDEX_MODIFIED_SIG
Type of signal when image&#39;s buffer is added.
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
SCENE2D_API::fwServices::IService::KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
Definition: SNegato.cpp:562
FWDATATOOLS_API::fwData::TransferFunction::sptr getTransferFunction() const
Get the current transfer function.
SCENE2D_API void processInteraction(::fwRenderQt::data::Event &_event) override
Definition: SNegato.cpp:434
FWDATATOOLS_API void setTransferFunction(const ::fwData::TransferFunction::sptr &tf)
Set the current TransferFunction.
FWDATATOOLS_API void installTFSlots(::fwCom::HasSlots *hasslots)
Install the slots to managed TF modifications.
IAdaptor implementation to display one slice of an image.
Definition: SNegato.hpp:63
Class allowing to block a Connection.
Definition: Connection.hpp:20
::fwData::Integer::sptr m_axialIndex
Axial slice index.
FWRENDERQT_API std::shared_ptr< ::fwRenderQt::SRender > getScene2DRender() const
Get the render that manages the IAdaptor.
FWDATATOOLS_API void createTransferFunction(::fwData::Image::sptr image)
Create and set the default transfer function.
virtual void swapping()
Swap the service from associated object to another object.
Definition: IService.hpp:613
::fwData::Integer::sptr m_sagittalIndex
Sagittal slice index.
UpdateTFWindowingSlotType::sptr m_slotUpdateTFWindowing
Slot called when transfer function windowing is modified.
SCENE2D_API void starting() override
Initialize the service activity.
Definition: SNegato.cpp:292
This bundles contains data and services used to display a 2D Qt scene.
Defines an helper to modify an fwData::Image by adding few medical fields and create in parallel the ...
virtual SCENE2D_API void updateTFPoints() override
Slot: updates the displayed image.
Definition: SNegato.cpp:407
#define SLM_FATAL(message)
Definition: spyLog.hpp:283
SCENE2D_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
Definition: SNegato.cpp:321
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_VISIBILITY_MODIFIED_SIG
Type of signal when image&#39;s buffer is added.
SCENE2D_API void configuring() override
Configure the service before starting. Apply the configuration to service.
Definition: SNegato.cpp:74
FWDATATOOLS_API void updateImageInfos(::fwData::Image::sptr image)
Update the image information (slice index, min/max,...)
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
::fwRenderQt::data::Axis::sptr m_yAxis
The y Axis.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_BUFFER_MODIFIED_SIG
Type of signal when image&#39;s buffer is added.
FWRENDERQT_API void configureParams()
Parse the xml configuration for Axis, z value and opacity.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_MODIFIED_SIG
Key in m_signals map of signal m_sigModified.
::fwData::Integer::sptr m_frontalIndex
Frontal slice index.
FWDATATOOLS_API void removeTFConnections()
Remove the TF connections.
static FWDATATOOLS_API bool checkImageValidity(::fwData::Image::csptr _pImg)
Check if the image is valid.
FWDATATOOLS_API void installTFConnections()
Install connections to listen TF modifications.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_WINDOWING_MODIFIED_SIG
Type of signal when points are modified.
FWDATATOOLS_API void setOrCreateTF(const ::fwData::TransferFunction::sptr &_tf, const fwData::Image::sptr &_image)
Sets the transfer function, creates one if _tf is null (.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_SLICE_TYPE_MODIFIED_SIG
Type of signal when image&#39;s buffer is added.
virtual SCENE2D_API void updateTFWindowing(double window, double level) override
Slot: updates the displayed image.
Definition: SNegato.cpp:414
This class manage events on the scene 2D (mouse event, keyboard event , ...).
Definition: Event.hpp:26
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_SLOT
Slot to call start method.
Definition: IService.hpp:177
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.
Definition: IService.cpp:247