Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkMRMLMeasurement Class Referenceabstract

Class for storing well-defined measurement results, using coded entries. More...

#include <Libs/MRML/Core/vtkMRMLMeasurement.h>

Inheritance diagram for vtkMRMLMeasurement:
Inheritance graph
[legend]
Collaboration diagram for vtkMRMLMeasurement:
Collaboration graph
[legend]

Public Types

enum  ComputationResult { NoChange =0, OK, InsufficientInput, InternalError }
 
enum  Events { InputDataModifiedEvent = vtkCommand::UserEvent + 555 }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual void Clear ()
 Reset state of object. Removes all content. More...
 
virtual void ClearValue (ComputationResult computationResult=NoChange)
 
virtual void Compute ()=0
 
virtual void Copy (vtkMRMLMeasurement *source)
 Copy one type into another (deep copy) More...
 
virtual VTK_NEWINSTANCE vtkMRMLMeasurementCreateInstance () const =0
 Create a new instance of this measurement type. More...
 
virtual void EnabledOff ()
 
virtual void EnabledOn ()
 
virtual const char * GetClassName ()
 
virtual vtkDoubleArray * GetControlPointValues ()
 
virtual vtkCodedEntryGetDerivationCode ()
 
virtual std::string GetDescription ()
 Informal description of the measurement. More...
 
virtual double GetDisplayCoefficient ()
 
double GetDisplayValue ()
 
virtual bool GetEnabled ()
 Enabled. More...
 
vtkMRMLNodeGetInputMRMLNode ()
 Get input MRML node used for calculating the measurement. More...
 
virtual int GetLastComputationResult ()
 Get last computation result. More...
 
const char * GetLastComputationResultAsPrintableString ()
 Get last computation result as human-readable string. More...
 
virtual vtkPolyData * GetMeshValue ()
 
virtual vtkCodedEntryGetMethodCode ()
 
virtual std::string GetName ()
 Measurement name. More...
 
virtual std::string GetPrintFormat ()
 Formatting string for displaying measurement value and units. More...
 
virtual vtkCodedEntryGetQuantityCode ()
 
virtual std::string GetUnits ()
 Measurement unit. More...
 
virtual vtkCodedEntryGetUnitsCode ()
 
virtual double GetValue ()
 Get quantity value. More...
 
virtual bool GetValueDefined ()
 Value defined flag (whether a computed value has been set or not) More...
 
std::string GetValueWithUnitsAsPrintableString ()
 Get measurement value and units as a single human-readable string. More...
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetControlPointValues (vtkDoubleArray *inputValues)
 Set the per-control point measurement values. More...
 
void SetDerivationCode (vtkCodedEntry *entry)
 Copy content of coded entry. More...
 
virtual void SetDescription (std::string)
 
virtual void SetDisplayCoefficient (double)
 
void SetDisplayValue (double value, const char *units=nullptr, double displayCoefficient=0.0)
 
virtual void SetEnabled (bool enabled)
 
void SetInputMRMLNode (vtkMRMLNode *node)
 Set input MRML node used for calculating the measurement. More...
 
void SetMeshValue (vtkPolyData *meshValue)
 
void SetMethodCode (vtkCodedEntry *entry)
 Copy content of coded entry. More...
 
virtual void SetName (std::string)
 
virtual void SetPrintFormat (std::string format)
 
void SetQuantityCode (vtkCodedEntry *entry)
 Copy content of coded entry. More...
 
virtual void SetUnits (std::string units)
 
void SetUnitsCode (vtkCodedEntry *entry)
 Copy content of coded entry. More...
 
void SetValue (double value, const char *quantityName=nullptr)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLMeasurementSafeDownCast (vtkObject *o)
 

Protected Member Functions

vtkMRMLUnitNodeGetUnitNode (const char *quantityName)
 Helper function to get unit node from the scene based on quantity name. More...
 
void operator= (const vtkMRMLMeasurement &)
 
 vtkMRMLMeasurement ()
 
 vtkMRMLMeasurement (const vtkMRMLMeasurement &)
 
 ~vtkMRMLMeasurement () override
 

Protected Attributes

vtkSmartPointer< vtkDoubleArray > ControlPointValues
 Per-control point measurements. More...
 
vtkSmartPointer< vtkCodedEntryDerivationCode
 
std::string Description
 
double DisplayCoefficient {1.0}
 
bool Enabled {true}
 
vtkWeakPointer< vtkMRMLNodeInputMRMLNode
 MRML node used to calculate the measurement. More...
 
ComputationResult LastComputationResult {InsufficientInput}
 
vtkSmartPointer< vtkPolyData > MeshValue
 Surface mesh for displaying computed value. More...
 
vtkSmartPointer< vtkCodedEntryMethodCode
 
std::string Name
 
std::string PrintFormat
 
vtkSmartPointer< vtkCodedEntryQuantityCode
 
std::string Units
 
vtkSmartPointer< vtkCodedEntryUnitsCode
 
double Value {0.0}
 
bool ValueDefined {false}
 

Detailed Description

Class for storing well-defined measurement results, using coded entries.

This stores all important information about a measurement using standard coded entries. Measurement method, derivation, quantity value, units, etc, can be specified. This is a commonly used concept in DICOM structured reports.

The measurement stores value, displayed value, and unit consistently with unit nodes.

DisplayValue is defined in the unit specified in Unit property of the measurement. Value is defined in the base unit specified in the unit node in the scene. DisplayCoefficient specifies scaling between Value and DisplayValue:

DisplayValue = Value * DisplayCoefficient.

Example:

In medical image computing, mm is commonly used as a length unit, but volume is most often specified in cc (cm3). To allow performing all computations without unit conversions (e.g., compute volume = width * height * depth) it is useful to specify volume unit as cm3 with volume display coefficient of 0.001:

Measurements can then computed and stored like this:

// box size in mm: width * height * depth diameterMeasurement->SetValue(sqrt(width*width+height*height+depth*depth), "length"); volumeMeasurement->SetValue(width*height*depth, "volume");

See also
vtkCodedEntry

Definition at line 61 of file vtkMRMLMeasurement.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkMRMLMeasurement::Superclass

Definition at line 84 of file vtkMRMLMeasurement.h.

Member Enumeration Documentation

◆ ComputationResult

Measurement computation status

See also
LastComputationResult, GetLastComputationResult(), GetLastComputationResultAsString()
Enumerator
NoChange 

can be used to indicate to keep the current value

OK 

success

InsufficientInput 
InternalError 

Definition at line 67 of file vtkMRMLMeasurement.h.

◆ Events

Enumerator
InputDataModifiedEvent 

The node stores both inputs (e.g., input node, enabled, unit, etc.) and computed measurement. InputDataModifiedEvent is only invoked when input parameters are changed. In contrast, ModifiedEvent event is called if either an input or output parameter is changed.

Definition at line 75 of file vtkMRMLMeasurement.h.

Constructor & Destructor Documentation

◆ vtkMRMLMeasurement() [1/2]

vtkMRMLMeasurement::vtkMRMLMeasurement ( )
protected

◆ ~vtkMRMLMeasurement()

vtkMRMLMeasurement::~vtkMRMLMeasurement ( )
overrideprotected

◆ vtkMRMLMeasurement() [2/2]

vtkMRMLMeasurement::vtkMRMLMeasurement ( const vtkMRMLMeasurement )
protected

Member Function Documentation

◆ Clear()

virtual void vtkMRMLMeasurement::Clear ( )
virtual

Reset state of object. Removes all content.

◆ ClearValue()

virtual void vtkMRMLMeasurement::ClearValue ( ComputationResult  computationResult = NoChange)
virtual

Clear measured value Note: per-control-point values are not cleared

◆ Compute()

virtual void vtkMRMLMeasurement::Compute ( )
pure virtual

Perform calculation on InputMRMLNode and store the result internally. The subclasses need to implement this function

Implemented in vtkMRMLStaticMeasurement, vtkMRMLMeasurementAngle, vtkMRMLMeasurementArea, vtkMRMLMeasurementLength, and vtkMRMLMeasurementVolume.

◆ Copy()

virtual void vtkMRMLMeasurement::Copy ( vtkMRMLMeasurement source)
virtual

Copy one type into another (deep copy)

◆ CreateInstance()

virtual VTK_NEWINSTANCE vtkMRMLMeasurement* vtkMRMLMeasurement::CreateInstance ( ) const
pure virtual

Create a new instance of this measurement type.

Implemented in vtkMRMLStaticMeasurement, vtkMRMLMeasurementAngle, vtkMRMLMeasurementArea, vtkMRMLMeasurementLength, and vtkMRMLMeasurementVolume.

◆ EnabledOff()

virtual void vtkMRMLMeasurement::EnabledOff ( )
virtual

◆ EnabledOn()

virtual void vtkMRMLMeasurement::EnabledOn ( )
virtual

◆ GetClassName()

virtual const char* vtkMRMLMeasurement::GetClassName ( )
virtual

◆ GetControlPointValues()

virtual vtkDoubleArray* vtkMRMLMeasurement::GetControlPointValues ( )
virtual

◆ GetDerivationCode()

virtual vtkCodedEntry* vtkMRMLMeasurement::GetDerivationCode ( )
virtual

◆ GetDescription()

virtual std::string vtkMRMLMeasurement::GetDescription ( )
virtual

Informal description of the measurement.

◆ GetDisplayCoefficient()

virtual double vtkMRMLMeasurement::GetDisplayCoefficient ( )
virtual

This multiplier will be applied to the value to compute display value: It is useful when the unit in the measurement differs from the base unit (e.g., application's length unit is mm but volume is displayed as cm3 instead of mm3).

◆ GetDisplayValue()

double vtkMRMLMeasurement::GetDisplayValue ( )

Get display value. It is computed using this formula: DisplayValue = Value * DisplayCoefficient.

◆ GetEnabled()

virtual bool vtkMRMLMeasurement::GetEnabled ( )
virtual

Enabled.

◆ GetInputMRMLNode()

vtkMRMLNode* vtkMRMLMeasurement::GetInputMRMLNode ( )

Get input MRML node used for calculating the measurement.

See also
Execute

◆ GetLastComputationResult()

virtual int vtkMRMLMeasurement::GetLastComputationResult ( )
virtual

Get last computation result.

◆ GetLastComputationResultAsPrintableString()

const char* vtkMRMLMeasurement::GetLastComputationResultAsPrintableString ( )

Get last computation result as human-readable string.

◆ GetMeshValue()

virtual vtkPolyData* vtkMRMLMeasurement::GetMeshValue ( )
virtual

◆ GetMethodCode()

virtual vtkCodedEntry* vtkMRMLMeasurement::GetMethodCode ( )
virtual

◆ GetName()

virtual std::string vtkMRMLMeasurement::GetName ( )
virtual

Measurement name.

◆ GetPrintFormat()

virtual std::string vtkMRMLMeasurement::GetPrintFormat ( )
virtual

Formatting string for displaying measurement value and units.

◆ GetQuantityCode()

virtual vtkCodedEntry* vtkMRMLMeasurement::GetQuantityCode ( )
virtual

◆ GetUnitNode()

vtkMRMLUnitNode* vtkMRMLMeasurement::GetUnitNode ( const char *  quantityName)
protected

Helper function to get unit node from the scene based on quantity name.

◆ GetUnits()

virtual std::string vtkMRMLMeasurement::GetUnits ( )
virtual

Measurement unit.

◆ GetUnitsCode()

virtual vtkCodedEntry* vtkMRMLMeasurement::GetUnitsCode ( )
virtual

◆ GetValue()

virtual double vtkMRMLMeasurement::GetValue ( )
virtual

Get quantity value.

◆ GetValueDefined()

virtual bool vtkMRMLMeasurement::GetValueDefined ( )
virtual

Value defined flag (whether a computed value has been set or not)

◆ GetValueWithUnitsAsPrintableString()

std::string vtkMRMLMeasurement::GetValueWithUnitsAsPrintableString ( )

Get measurement value and units as a single human-readable string.

◆ IsA()

virtual int vtkMRMLMeasurement::IsA ( const char *  type)
virtual

◆ IsTypeOf()

static int vtkMRMLMeasurement::IsTypeOf ( const char *  type)
static

◆ operator=()

void vtkMRMLMeasurement::operator= ( const vtkMRMLMeasurement )
protected

◆ PrintSelf()

void vtkMRMLMeasurement::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ SafeDownCast()

static vtkMRMLMeasurement* vtkMRMLMeasurement::SafeDownCast ( vtkObject *  o)
static

◆ SetControlPointValues()

void vtkMRMLMeasurement::SetControlPointValues ( vtkDoubleArray *  inputValues)

Set the per-control point measurement values.

◆ SetDerivationCode()

void vtkMRMLMeasurement::SetDerivationCode ( vtkCodedEntry entry)

Copy content of coded entry.

◆ SetDescription()

virtual void vtkMRMLMeasurement::SetDescription ( std::string  )
virtual

◆ SetDisplayCoefficient()

virtual void vtkMRMLMeasurement::SetDisplayCoefficient ( double  )
virtual

◆ SetDisplayValue()

void vtkMRMLMeasurement::SetDisplayValue ( double  value,
const char *  units = nullptr,
double  displayCoefficient = 0.0 
)

Set display value and units with a single modified event. This method is useful if there is no unit node corresponding to this quantity in the scene. If a unit node is available for the measurement's quantity then it is important to set the correct displayCoefficient value for the chosen units. If units and/or displayCoefficient is not specified then the current Units and/or DisplayCoefficient values are used. The stored value is computed as displayValue / DisplayCoefficient.

◆ SetEnabled()

virtual void vtkMRMLMeasurement::SetEnabled ( bool  enabled)
virtual

◆ SetInputMRMLNode()

void vtkMRMLMeasurement::SetInputMRMLNode ( vtkMRMLNode node)

Set input MRML node used for calculating the measurement.

See also
Execute

◆ SetMeshValue()

void vtkMRMLMeasurement::SetMeshValue ( vtkPolyData *  meshValue)

Set mesh that can be used to visualize to computed value. For example, mesh for a calculated area value is the mesh that was generated to compute the surface area.

◆ SetMethodCode()

void vtkMRMLMeasurement::SetMethodCode ( vtkCodedEntry entry)

Copy content of coded entry.

◆ SetName()

virtual void vtkMRMLMeasurement::SetName ( std::string  )
virtual

◆ SetPrintFormat()

virtual void vtkMRMLMeasurement::SetPrintFormat ( std::string  format)
virtual

◆ SetQuantityCode()

void vtkMRMLMeasurement::SetQuantityCode ( vtkCodedEntry entry)

Copy content of coded entry.

◆ SetUnits()

virtual void vtkMRMLMeasurement::SetUnits ( std::string  units)
virtual

◆ SetUnitsCode()

void vtkMRMLMeasurement::SetUnitsCode ( vtkCodedEntry entry)

Copy content of coded entry.

◆ SetValue()

void vtkMRMLMeasurement::SetValue ( double  value,
const char *  quantityName = nullptr 
)

Set value and units with a single modified event. If a value is set for a quantity that has a corresponding unit node in the scene then the value must be consistent with that definition. If quantityName is specified then Units, DisplayCoefficient, PrintFormat properties is updated from the corresponding unit node's Suffix, DisplayCoefficient, and DisplayStringFormat If QuantityName is specified then a valid InputMRMLNode must be set, too, because the scene is accessed via the InputMRMLNode.

Member Data Documentation

◆ ControlPointValues

vtkSmartPointer<vtkDoubleArray> vtkMRMLMeasurement::ControlPointValues
protected

Per-control point measurements.

Definition at line 223 of file vtkMRMLMeasurement.h.

◆ DerivationCode

vtkSmartPointer<vtkCodedEntry> vtkMRMLMeasurement::DerivationCode
protected

Definition at line 217 of file vtkMRMLMeasurement.h.

◆ Description

std::string vtkMRMLMeasurement::Description
protected

Definition at line 214 of file vtkMRMLMeasurement.h.

◆ DisplayCoefficient

double vtkMRMLMeasurement::DisplayCoefficient {1.0}
protected

Definition at line 213 of file vtkMRMLMeasurement.h.

◆ Enabled

bool vtkMRMLMeasurement::Enabled {true}
protected

Definition at line 209 of file vtkMRMLMeasurement.h.

◆ InputMRMLNode

vtkWeakPointer<vtkMRMLNode> vtkMRMLMeasurement::InputMRMLNode
protected

MRML node used to calculate the measurement.

See also
Execute

Definition at line 227 of file vtkMRMLMeasurement.h.

◆ LastComputationResult

ComputationResult vtkMRMLMeasurement::LastComputationResult {InsufficientInput}
protected

Definition at line 220 of file vtkMRMLMeasurement.h.

◆ MeshValue

vtkSmartPointer<vtkPolyData> vtkMRMLMeasurement::MeshValue
protected

Surface mesh for displaying computed value.

Definition at line 225 of file vtkMRMLMeasurement.h.

◆ MethodCode

vtkSmartPointer<vtkCodedEntry> vtkMRMLMeasurement::MethodCode
protected

Definition at line 219 of file vtkMRMLMeasurement.h.

◆ Name

std::string vtkMRMLMeasurement::Name
protected

Definition at line 210 of file vtkMRMLMeasurement.h.

◆ PrintFormat

std::string vtkMRMLMeasurement::PrintFormat
protected

Definition at line 215 of file vtkMRMLMeasurement.h.

◆ QuantityCode

vtkSmartPointer<vtkCodedEntry> vtkMRMLMeasurement::QuantityCode
protected

Definition at line 216 of file vtkMRMLMeasurement.h.

◆ Units

std::string vtkMRMLMeasurement::Units
protected

Definition at line 213 of file vtkMRMLMeasurement.h.

◆ UnitsCode

vtkSmartPointer<vtkCodedEntry> vtkMRMLMeasurement::UnitsCode
protected

Definition at line 218 of file vtkMRMLMeasurement.h.

◆ Value

double vtkMRMLMeasurement::Value {0.0}
protected

Definition at line 211 of file vtkMRMLMeasurement.h.

◆ ValueDefined

bool vtkMRMLMeasurement::ValueDefined {false}
protected

Definition at line 212 of file vtkMRMLMeasurement.h.


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