Fraxinus  16.5.0-fx-rc6
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxDataMetricWrappers.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #include <cxDataMetricWrappers.h>
33 
34 #include <QTreeWidget>
35 #include <QTreeWidgetItem>
36 #include <QStringList>
37 #include <QVBoxLayout>
38 #include <QHeaderView>
39 
40 #include "cxLogger.h"
41 #include "cxTypeConversions.h"
43 #include "cxTrackingService.h"
44 #include "cxPointMetric.h"
45 #include "cxDistanceMetric.h"
47 #include "cxVector3DWidget.h"
49 #include "cxHelperWidgets.h"
50 #include "cxBaseWidget.h"
51 #include "cxBoolProperty.h"
52 #include "cxSpaceProvider.h"
53 #include "cxPatientModelService.h"
54 #include "cxSpaceEditWidget.h"
55 #include "cxSpaceProperty.h"
56 
57 //TODO :remove
58 #include "cxLegacySingletons.h"
59 
60 namespace cx
61 {
62 
64  mViewService(viewService),
65  mPatientModelService(patientModelService)
66 {
67 }
68 
69 void MetricBase::colorSelected()
70 {
71  this->getData()->setColor(mColorSelector->getValue());
72 }
73 
74 QString MetricBase::getValue() const
75 {
76  QString retval = this->getData()->getValueAsString();
77  if (retval.isEmpty())
78  return "NA";
79  return retval;
80 }
81 
82 void MetricBase::addColorWidget(QVBoxLayout* layout)
83 {
84  mColorSelector = ColorProperty::initialize("color", "Color",
85  "Set color of metric",
86  this->getData()->getColor(), QDomNode());
87  QHBoxLayout* line = new QHBoxLayout;
89  line->addStretch();
90  line->setMargin(0);
91  layout->addLayout(line);
92  connect(mColorSelector.get(), SIGNAL(valueWasSet()), this, SLOT(colorSelected()));
93 }
94 
95 //---------------------------------------------------------
96 //---------------------------------------------------------
97 //---------------------------------------------------------
98 
100 {
101  mModified = true;
102  mInternalUpdate = false;
103 }
104 
106 {
107  mArguments = arguments;
108  connect(mArguments.get(), SIGNAL(argumentsChanged()), this, SLOT(dataChangedSlot()));
109 }
110 
112 {
113  QString value;
114 
115  mPSelector.resize(mArguments->getCount());
116  for (unsigned i=0; i<mPSelector.size(); ++i)
117  {
118  mPSelector[i] = StringProperty::initialize(QString("p%1").arg(i),
119  QString("p%1").arg(i),
120  mArguments->getDescription(i),
121  mArguments->get(i) ? mArguments->get(i)->getUid() : "",
122  QStringList(),
123  QDomNode());
124 // mPSelector[i]->setDisplayNames(names);
125  layout->addWidget(new LabeledComboBoxWidget(NULL, mPSelector[i]));
126  connect(mPSelector[i].get(), SIGNAL(valueWasSet()), this, SLOT(pointSelected()));
127  }
128 
129  this->dataChangedSlot();
130 }
131 
132 void MetricReferenceArgumentListGui::getAvailableArgumentMetrics(QStringList* uid, std::map<QString,QString>* namemap)
133 {
134  std::map<QString, DataPtr> data = patientService()->getData();
135  for (std::map<QString, DataPtr>::iterator iter=data.begin(); iter!=data.end(); ++iter)
136  {
137  if (mArguments->validArgument(iter->second))
138  {
139  *uid << iter->first;
140  (*namemap)[iter->first] = iter->second->getName();
141  }
142  }
143 }
144 
146 {
147  QStringList data;
148  for (unsigned i=0; i<mArguments->getCount(); ++i)
149  data << (mArguments->get(i) ? mArguments->get(i)->getName() : QString("*"));
150  return data.join("-");
151 }
152 
153 void MetricReferenceArgumentListGui::pointSelected()
154 {
155  if (mInternalUpdate)
156  return;
157  for (unsigned i=0; i<mPSelector.size(); ++i)
158  {
159  DataPtr data = patientService()->getData(mPSelector[i]->getValue());
160  if (mArguments->validArgument(data))
161  mArguments->set(i, data);
162  else
163  reportWarning(QString("Failed to set data [%1] in metric, invalid argument.").arg(data?data->getName():"NULL"));
164  }
165 }
166 
167 void MetricReferenceArgumentListGui::dataChangedSlot()
168 {
169 // mModified = true;
170 }
171 
173 {
174  if (!mModified)
175  return;
176  mInternalUpdate = true;
177 
178  QStringList range;
179  std::map<QString,QString> names;
180  this->getAvailableArgumentMetrics(&range, &names);
181 
182  for (unsigned i=0; i<mPSelector.size(); ++i)
183  {
184  if (!mArguments->get(i))
185  continue;
186  mPSelector[i]->setValue(mArguments->get(i)->getUid());
187  mPSelector[i]->setDisplayNames(names);
188  mPSelector[i]->setValueRange(range);
189  }
190 
191  mInternalUpdate = false;
192  mModified = true;
193 }
194 
195 
196 //---------------------------------------------------------
197 //---------------------------------------------------------
198 //---------------------------------------------------------
199 
201  MetricBase(viewService, patientModelService),
202  mData(data)
203 {
204  mInternalUpdate = false;
205 // connect(mData.get(), SIGNAL(transformChanged()), this, SLOT(dataChangedSlot()));
206 // connect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
207 }
208 
210 {
211 // disconnect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
212 }
213 
215 {
216  QWidget* widget = new QWidget;
217  QVBoxLayout* topLayout = new QVBoxLayout(widget);
218  QHBoxLayout* hLayout = new QHBoxLayout;
219  hLayout->setMargin(0);
220  topLayout->setMargin(0);
221  topLayout->addLayout(hLayout);
222 
223  mSpaceSelector = this->createSpaceSelector();
224  hLayout->addWidget(new SpaceEditWidget(widget, mSpaceSelector));
225 
226  mCoordinate = this->createCoordinateSelector();
227  topLayout->addWidget(Vector3DWidget::createSmallHorizontal(widget, mCoordinate));
228 
229  QWidget* sampleButton = this->createSampleButton(widget);
230  hLayout->addWidget(sampleButton);
231 
232  this->addColorWidget(topLayout);
233  topLayout->addStretch();
234 // this->dataChangedSlot();
235 
236  return widget;
237 }
238 
239 SpacePropertyPtr PointMetricWrapper::createSpaceSelector() const
240 {
241  SpacePropertyPtr retval;
242  retval = SpaceProperty::initialize("selectSpace",
243  "Space",
244  "Select coordinate system to store position in.");
245  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(spaceSelected()));
246  retval->setSpaceProvider(spaceProvider());
247  return retval;
248 }
249 
250 Vector3DPropertyPtr PointMetricWrapper::createCoordinateSelector() const
251 {
252  Vector3DPropertyPtr retval;
253  retval = Vector3DProperty::initialize("selectCoordinate",
254  "Coord",
255  "Coordinate values.",
256  Vector3D(0,0,0),
257  DoubleRange(-1000,1000,1),
258  1,
259  QDomNode());
260 
261  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(coordinateChanged()));
262  return retval;
263 }
264 
265 QWidget* PointMetricWrapper::createSampleButton(QWidget* parent) const
266 {
267  QAction* sampleAction = new QAction("Sample", parent);
268  QString sampleTip("Set the position equal to the current tool tip position.");
269  sampleAction->setStatusTip(sampleTip);
270  sampleAction->setWhatsThis(sampleTip);
271  sampleAction->setToolTip(sampleTip);
272  connect(sampleAction, SIGNAL(triggered()), this, SLOT(moveToToolPosition()));
273 
274  CXToolButton* sampleButton = new CXToolButton(parent);
275  sampleButton->setDefaultAction(sampleAction);
276  return sampleButton;
277 }
278 
280 {
281  return mData;
282 }
283 
285 {
286  return "point";
287 }
288 
290 {
291  Vector3D p = mData->getCoordinate();
292  QString coord = prettyFormat(p, 1, 1);
293  if (mData->getSpace().mId==csREF)
294  coord = ""; // ignore display of coord if in ref space
295 
296  return mData->getSpace().toString() + " " + coord;
297 }
298 
299 void PointMetricWrapper::moveToToolPosition()
300 {
301  Vector3D p = spaceProvider()->getActiveToolTipPoint(mData->getSpace(), true);
302  mData->setCoordinate(p);
303 }
304 
305 void PointMetricWrapper::spaceSelected()
306 {
307  if (mInternalUpdate)
308  return;
309  CoordinateSystem space = mSpaceSelector->getValue();
310  if (!space.isValid())
311  return;
312  mData->setSpace(space);
313 }
314 
315 void PointMetricWrapper::coordinateChanged()
316 {
317  if (mInternalUpdate)
318  return;
319  mData->setCoordinate(mCoordinate->getValue());
320 }
321 
322 //void PointMetricWrapper::dataChangedSlot()
323 //{
324 //}
325 
327 {
328  mInternalUpdate = true;
329  mSpaceSelector->setValue(mData->getSpace());
330  mCoordinate->setValue(mData->getCoordinate());
331  mInternalUpdate = false;
332 }
333 
334 //---------------------------------------------------------
335 //---------------------------------------------------------
336 //---------------------------------------------------------
337 
339  MetricBase(viewService, patientModelService),
340  mData(data)
341 {
342  mArguments.setArguments(data->getArguments());
343  mInternalUpdate = false;
344  connect(mData.get(), SIGNAL(transformChanged()), this, SLOT(dataChangedSlot()));
345  connect(mData.get(), SIGNAL(propertiesChanged()), this, SLOT(dataChangedSlot()));
346  connect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
347 }
348 
350 {
351  disconnect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
352 }
353 
355 {
356  QWidget* widget = new QWidget;
357  QVBoxLayout* topLayout = new QVBoxLayout(widget);
358  QHBoxLayout* hLayout = new QHBoxLayout;
359  hLayout->setMargin(0);
360  topLayout->setMargin(0);
361  topLayout->addLayout(hLayout);
362 
363  mArguments.addWidgets(hLayout);
364  this->addColorWidget(topLayout);
365  topLayout->addStretch();
366 
367  this->dataChangedSlot();
368 
369  return widget;
370 }
371 
373 {
374  return mData;
375 }
376 
378 {
379  return "plane";
380 }
381 
383 {
384  return mArguments.getAsString();
385 }
386 
387 void PlaneMetricWrapper::dataChangedSlot()
388 {
389 // mInternalUpdate = true;
390  mInternalUpdate = false;
391 }
392 
394 {
395  mArguments.update();
396 }
397 
398 //---------------------------------------------------------
399 //---------------------------------------------------------
400 //---------------------------------------------------------
401 
403  MetricBase(viewService, patientModelService),
404  mData(data)
405 {
406  mArguments.setArguments(data->getArguments());
407  mInternalUpdate = false;
408  connect(mData.get(), SIGNAL(transformChanged()), this, SLOT(dataChangedSlot()));
409  connect(patientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
410 }
411 
413 {
414  QWidget* widget = new QWidget;
415  QVBoxLayout* topLayout = new QVBoxLayout(widget);
416  QHBoxLayout* hLayout = new QHBoxLayout;
417  hLayout->setMargin(0);
418  topLayout->setMargin(0);
419  topLayout->addLayout(hLayout);
420 
421  mArguments.addWidgets(hLayout);
422  this->addColorWidget(topLayout);
423  topLayout->addStretch();
424 
425  this->dataChangedSlot();
426  return widget;
427 }
428 
430 {
431  return mData;
432 }
433 
435 {
436  return "distance";
437 }
438 
440 {
441  return mArguments.getAsString();
442 }
443 
444 void DistanceMetricWrapper::dataChangedSlot()
445 {
446 // mInternalUpdate = true;
447  mInternalUpdate = false;
448 }
449 
451 {
452  mArguments.update();
453 }
454 
455 
456 //---------------------------------------------------------
457 //---------------------------------------------------------
458 //---------------------------------------------------------
459 
461  MetricBase(viewService, patientModelService),
462  mData(data)
463 {
464  mArguments.setArguments(data->getArguments());
465  mInternalUpdate = false;
466  connect(mData.get(), SIGNAL(transformChanged()), this, SLOT(dataChangedSlot()));
467  connect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
468 }
469 
471 {
472  disconnect(mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()), this, SLOT(dataChangedSlot()));
473 }
474 
476 {
477  QWidget* widget = new QWidget;
478  QVBoxLayout* topLayout = new QVBoxLayout(widget);
479  QHBoxLayout* hLayout = new QHBoxLayout;
480  hLayout->setMargin(0);
481  topLayout->setMargin(0);
482  topLayout->addLayout(hLayout);
483 
484  mArguments.addWidgets(hLayout);
485 
486  mUseSimpleVisualization = this->createUseSimpleVisualizationSelector();
487  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mUseSimpleVisualization));
488 
489  this->addColorWidget(topLayout);
490  topLayout->addStretch();
491 
492  this->dataChangedSlot();
493  return widget;
494 }
495 
497 {
498  return mData;
499 }
501 {
502  return "angle";
503 }
504 
506 {
507  return mArguments.getAsString();
508 }
509 
510 void AngleMetricWrapper::dataChangedSlot()
511 {
512  mInternalUpdate = true;
513  mUseSimpleVisualization->setValue(mData->getUseSimpleVisualization());
514  mInternalUpdate = false;
515 }
516 
517 void AngleMetricWrapper::guiChanged()
518 {
519  if (mInternalUpdate)
520  return;
521  mData->setUseSimpleVisualization(mUseSimpleVisualization->getValue());
522 }
523 
524 BoolPropertyPtr AngleMetricWrapper::createUseSimpleVisualizationSelector() const
525 {
526  BoolPropertyPtr retval;
527  retval = BoolProperty::initialize("Simple Visualization", "",
528  "Simple Visualization",
529  mData->getUseSimpleVisualization());
530 
531  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
532  return retval;
533 }
534 
536 {
537  mArguments.update();
538 }
539 
540 //---------------------------------------------------------
541 //---------------------------------------------------------
542 //---------------------------------------------------------
543 
545  MetricBase(viewService, patientModelService),
546  mData(data)
547 {
548  mArguments.setArguments(data->getArguments());
549  mInternalUpdate = false;
550  connect(mData.get(), SIGNAL(propertiesChanged()), this, SLOT(dataChangedSlot()));
551 }
552 
554 {
555  QWidget* widget = new QWidget;
556  QVBoxLayout* topLayout = new QVBoxLayout(widget);
557  QHBoxLayout* hLayout = new QHBoxLayout;
558  hLayout->setMargin(0);
559  topLayout->setMargin(0);
560  topLayout->addLayout(hLayout);
561 
562  mArguments.addWidgets(hLayout);
563 
564  mRadius = this->createRadiusSelector();
565  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mRadius));
566  mThickness = this->createThicknessSelector();
567  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mThickness));
568  mFlat = this->createFlatSelector();
569  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mFlat));
570  mHeight = this->createHeightSelector();
571  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mHeight));
572 
573  this->addColorWidget(topLayout);
574  topLayout->addStretch();
575 
576  this->dataChangedSlot();
577  return widget;
578 }
579 
581 {
582  return mData;
583 }
585 {
586  return "donut";
587 }
588 
590 {
591  return mArguments.getAsString();
592 }
593 
595 {
596  mArguments.update();
597 
598  if (mInternalUpdate)
599  return;
600  mInternalUpdate = true;
601  mRadius->setValue(mData->getRadius());
602  mThickness->setValue(mData->getThickness());
603  mHeight->setValue(mData->getHeight());
604  mFlat->setValue(mData->getFlat());
605  mInternalUpdate = false;
606 }
607 
608 void DonutMetricWrapper::dataChangedSlot()
609 {
610 // if (mInternalUpdate)
611 // return;
612 // mInternalUpdate = true;
613 // mRadius->setValue(mData->getRadius());
614 // mThickness->setValue(mData->getThickness());
615 // mFlat->setValue(mData->getFlat());
616 // mInternalUpdate = false;
617 }
618 
619 void DonutMetricWrapper::guiChanged()
620 {
621  if (mInternalUpdate)
622  return;
623  mInternalUpdate = true;
624  mData->setRadius(mRadius->getValue());
625  mData->setThickness(mThickness->getValue());
626  mData->setHeight(mHeight->getValue());
627  mData->setFlat(mFlat->getValue());
628  mInternalUpdate = false;
629 }
630 
631 
632 DoublePropertyPtr DonutMetricWrapper::createRadiusSelector() const
633 {
634  DoublePropertyPtr retval;
635  retval = DoubleProperty::initialize("selectRadius",
636  "Radius",
637  "Donut Radius",
638  mData->getRadius(),
639  DoubleRange(0, 50, 1),
640  1,
641  QDomNode());
642 
643  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
644  return retval;
645 }
646 
647 DoublePropertyPtr DonutMetricWrapper::createThicknessSelector() const
648 {
649  DoublePropertyPtr retval;
650  retval = DoubleProperty::initialize("selectThickness",
651  "Thickness",
652  "Donut Thickness",
653  mData->getThickness(),
654  DoubleRange(0.05, 1, 0.05),
655  2,
656  QDomNode());
657 
658  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
659  return retval;
660 }
661 
662 DoublePropertyPtr DonutMetricWrapper::createHeightSelector() const
663 {
664  DoublePropertyPtr retval;
665  retval = DoubleProperty::initialize("selectHeight",
666  "Height",
667  "Disc height, NA to torus",
668  mData->getHeight(),
669  DoubleRange(0.0, 100, 1),
670  1,
671  QDomNode());
672 
673  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
674  return retval;
675 }
676 
677 BoolPropertyPtr DonutMetricWrapper::createFlatSelector() const
678 {
679  BoolPropertyPtr retval;
680  retval = BoolProperty::initialize("selectFlat",
681  "Flat",
682  "Flat disk or torus",
683  mData->getFlat(),
684  QDomNode());
685 
686  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
687  return retval;
688 }
689 
690 //---------------------------------------------------------
691 //---------------------------------------------------------
692 //---------------------------------------------------------
693 
695  MetricBase(viewService, patientModelService),
696  mData(data)
697 {
698  mArguments.setArguments(data->getArguments());
699  mInternalUpdate = false;
700  connect(mData.get(), SIGNAL(propertiesChanged()), this, SLOT(dataChangedSlot()));
701 }
702 
704 {
705  QWidget* widget = new QWidget;
706  QVBoxLayout* topLayout = new QVBoxLayout(widget);
707  QHBoxLayout* hLayout = new QHBoxLayout;
708  hLayout->setMargin(0);
709  topLayout->setMargin(0);
710  topLayout->addLayout(hLayout);
711 
712  mArguments.addWidgets(hLayout);
713 
714  mRadius = this->createRadiusSelector();
715  topLayout->addWidget(createDataWidget(mViewService, mPatientModelService, widget, mRadius));
716 
717  this->addColorWidget(topLayout);
718  topLayout->addStretch();
719 
720  this->dataChangedSlot();
721  return widget;
722 }
723 
725 {
726  return mData;
727 }
729 {
730  return "sphere";
731 }
732 
734 {
735  return mArguments.getAsString();
736 }
737 
738 void SphereMetricWrapper::dataChangedSlot()
739 {
740 
741 }
742 
744 {
745  mArguments.update();
746  mInternalUpdate = true;
747  mRadius->setValue(mData->getRadius());
748  mInternalUpdate = false;
749 }
750 
751 void SphereMetricWrapper::guiChanged()
752 {
753  if (mInternalUpdate)
754  return;
755  mData->setRadius(mRadius->getValue());
756 }
757 
758 DoublePropertyPtr SphereMetricWrapper::createRadiusSelector() const
759 {
760  DoublePropertyPtr retval;
761  retval = DoubleProperty::initialize("selectRadius",
762  "Radius",
763  "Sphere Radius",
764  mData->getRadius(),
765  DoubleRange(0, 50, 0.5),
766  1,
767  QDomNode());
768 
769  connect(retval.get(), SIGNAL(valueWasSet()), this, SLOT(guiChanged()));
770  return retval;
771 }
772 
773 
774 
775 }
virtual QString getArguments() const
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
void setArguments(MetricReferenceArgumentListPtr arguments)
virtual QString getArguments() const
Composite widget for string selection.
virtual DataMetricPtr getData() const
virtual DataMetricPtr getData() const
boost::shared_ptr< class DonutMetric > DonutMetricPtr
boost::shared_ptr< DataMetric > DataMetricPtr
Definition: cxDataMetric.h:95
void addColorWidget(QVBoxLayout *layout)
static SpacePropertyPtr initialize(const QString &uid, QString name, QString help, Space value=Space(), std::vector< Space > range=std::vector< Space >(), QDomNode root=QDomNode())
SphereMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, SphereMetricPtr data)
virtual QString getType() const
QString prettyFormat(Vector3D val, int decimals, int fieldWidth)
Definition: cxVector3D.cpp:119
boost::shared_ptr< class SpaceProperty > SpacePropertyPtr
PlaneMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, PlaneMetricPtr data)
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
boost::shared_ptr< class SphereMetric > SphereMetricPtr
virtual DataMetricPtr getData() const =0
virtual DataMetricPtr getData() const
virtual QString getArguments() const
boost::shared_ptr< class ViewService > ViewServicePtr
virtual QWidget * createWidget()
Composite widget for string selection.
boost::shared_ptr< class AngleMetric > AngleMetricPtr
Definition: cxAngleMetric.h:54
ViewServicePtr mViewService
virtual QString getArguments() const
QWidget * createDataWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget *parent, PropertyPtr data, QGridLayout *gridLayout, int row)
Create a widget capable of displaying the input data.
ColorPropertyPtr mColorSelector
virtual QString getArguments() const
boost::shared_ptr< class PlaneMetric > PlaneMetricPtr
Definition: cxPlaneMetric.h:55
boost::shared_ptr< class Data > DataPtr
PatientModelServicePtr mPatientModelService
virtual QString getType() const
virtual QWidget * createWidget()
static Vector3DWidget * createSmallHorizontal(QWidget *parent, Vector3DPropertyBasePtr data)
virtual QString getType() const
void reportWarning(QString msg)
Definition: cxLogger.cpp:91
static Vector3DPropertyPtr initialize(const QString &uid, QString name, QString help, Vector3D value, DoubleRange range, int decimals, QDomNode root=QDomNode())
virtual QString getType() const
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
virtual QWidget * createWidget()
boost::shared_ptr< class MetricReferenceArgumentList > MetricReferenceArgumentListPtr
boost::shared_ptr< class DistanceMetric > DistanceMetricPtr
virtual DataMetricPtr getData() const
cxLogicManager_EXPORT SpaceProviderPtr spaceProvider()
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
virtual QString getType() const
DonutMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, DonutMetricPtr data)
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
virtual QWidget * createWidget()
MetricBase(ViewServicePtr viewService, PatientModelServicePtr patientModelService)
cxLogicManager_EXPORT ViewServicePtr viewService()
boost::shared_ptr< class Vector3DProperty > Vector3DPropertyPtr
virtual DataMetricPtr getData() const
cxLogicManager_EXPORT PatientModelServicePtr patientService()
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
virtual QString getType() const
AngleMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, AngleMetricPtr data)
static ColorPropertyPtr initialize(const QString &uid, QString name, QString help, QColor value, QDomNode root=QDomNode())
virtual QString getArguments() const
boost::shared_ptr< class BoolProperty > BoolPropertyPtr
virtual QString getValue() const
virtual QWidget * createWidget()
DistanceMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, DistanceMetricPtr data)
PointMetricWrapper(ViewServicePtr viewService, PatientModelServicePtr patientModelService, PointMetricPtr data)
virtual DataMetricPtr getData() const
boost::shared_ptr< class PointMetric > PointMetricPtr