10#ifndef __vtkMRMLMeasurement_h
11#define __vtkMRMLMeasurement_h
20#include <vtkCommand.h>
21#include <vtkDoubleArray.h>
23#include <vtkPolyData.h>
24#include <vtkSmartPointer.h>
81 InputDataModifiedEvent = vtkCommand::UserEvent + 555
85 void PrintSelf(ostream& os, vtkIndent indent)
override;
107 vtkGetMacro(Enabled,
bool);
113 vtkGetMacro(Name, std::string);
114 vtkSetMacro(Name, std::string);
123 void SetValue(
double value,
const char* quantityName =
nullptr);
126 vtkGetMacro(Value,
double);
134 void SetDisplayValue(
double value,
const char* units=
nullptr,
double displayCoefficient=0.0);
141 vtkGetMacro(ValueDefined,
bool);
144 vtkGetMacro(Units, std::string);
150 vtkGetMacro(DisplayCoefficient,
double);
151 vtkSetMacro(DisplayCoefficient,
double);
154 vtkGetMacro(Description, std::string);
155 vtkSetMacro(Description, std::string);
158 vtkGetMacro(PrintFormat, std::string);
178 vtkGetMacro(LastComputationResult,
int);
187 vtkGetObjectMacro(ControlPointValues, vtkDoubleArray);
213 bool ValueDefined{
false};
214 double DisplayCoefficient{1.0}; std::string Units;
Simple class for storing standard coded entries (coding scheme, value, meaning triplets)
Class for storing well-defined measurement results, using coded entries.
vtkSmartPointer< vtkCodedEntry > QuantityCode
virtual VTK_NEWINSTANCE vtkMRMLMeasurement * CreateInstance() const =0
vtkMRMLUnitNode * GetUnitNode(const char *quantityName)
Helper function to get unit node from the scene based on quantity name.
vtkSmartPointer< vtkDoubleArray > ControlPointValues
Per-control point measurements.
virtual vtkCodedEntry * GetQuantityCode()
vtkSmartPointer< vtkCodedEntry > MethodCode
vtkSmartPointer< vtkCodedEntry > DerivationCode
~vtkMRMLMeasurement() override
vtkSmartPointer< vtkPolyData > MeshValue
Surface mesh for displaying computed value.
void SetValue(double value, const char *quantityName=nullptr)
virtual void Copy(vtkMRMLMeasurement *source)
Copy one type into another (deep copy)
void SetControlPointValues(vtkDoubleArray *inputValues)
Set the per-control point measurement values.
void SetMeshValue(vtkPolyData *meshValue)
vtkMRMLNode * GetInputMRMLNode()
Get input MRML node used for calculating the measurement.
virtual vtkCodedEntry * GetMethodCode()
virtual vtkPolyData * GetMeshValue()
virtual void EnabledOff()
void SetInputMRMLNode(vtkMRMLNode *node)
Set input MRML node used for calculating the measurement.
virtual void Clear()
Reset state of object. Removes all content.
virtual vtkCodedEntry * GetUnitsCode()
void PrintSelf(ostream &os, vtkIndent indent) override
void SetUnitsCode(vtkCodedEntry *entry)
Copy content of coded entry.
void SetDisplayValue(double value, const char *units=nullptr, double displayCoefficient=0.0)
void SetMethodCode(vtkCodedEntry *entry)
Copy content of coded entry.
void SetDerivationCode(vtkCodedEntry *entry)
Copy content of coded entry.
virtual void SetPrintFormat(std::string format)
void operator=(const vtkMRMLMeasurement &)
vtkMRMLMeasurement(const vtkMRMLMeasurement &)
vtkWeakPointer< vtkMRMLNode > InputMRMLNode
MRML node used to calculate the measurement.
std::string GetValueWithUnitsAsPrintableString()
Get measurement value and units as a single human-readable string.
virtual void SetUnits(std::string units)
virtual void ClearValue(ComputationResult computationResult=NoChange)
vtkSmartPointer< vtkCodedEntry > UnitsCode
const char * GetLastComputationResultAsPrintableString()
Get last computation result as human-readable string.
virtual vtkCodedEntry * GetDerivationCode()
virtual void SetEnabled(bool enabled)
void SetQuantityCode(vtkCodedEntry *entry)
Copy content of coded entry.
Abstract Superclass for all specific types of MRML nodes.
Node that holds the information about a unit.