Slicer
5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Class for storing well-defined measurement results, using coded entries. More...
#include <Libs/MRML/Core/vtkMRMLMeasurement.h>
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 vtkMRMLMeasurement * | CreateInstance () 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 vtkCodedEntry * | GetDerivationCode () |
virtual std::string | GetDescription () |
Informal description of the measurement. More... | |
virtual double | GetDisplayCoefficient () |
double | GetDisplayValue () |
virtual bool | GetEnabled () |
Enabled. More... | |
vtkMRMLNode * | GetInputMRMLNode () |
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 vtkCodedEntry * | GetMethodCode () |
virtual std::string | GetName () |
Measurement name. More... | |
virtual std::string | GetPrintFormat () |
Formatting string for displaying measurement value and units. More... | |
virtual vtkCodedEntry * | GetQuantityCode () |
virtual std::string | GetUnits () |
Measurement unit. More... | |
virtual vtkCodedEntry * | GetUnitsCode () |
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 vtkMRMLMeasurement * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkMRMLUnitNode * | GetUnitNode (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< vtkCodedEntry > | DerivationCode |
std::string | Description |
double | DisplayCoefficient {1.0} |
bool | Enabled {true} |
vtkWeakPointer< vtkMRMLNode > | InputMRMLNode |
MRML node used to calculate the measurement. More... | |
ComputationResult | LastComputationResult {InsufficientInput} |
vtkSmartPointer< vtkPolyData > | MeshValue |
Surface mesh for displaying computed value. More... | |
vtkSmartPointer< vtkCodedEntry > | MethodCode |
std::string | Name |
std::string | PrintFormat |
vtkSmartPointer< vtkCodedEntry > | QuantityCode |
std::string | Units |
vtkSmartPointer< vtkCodedEntry > | UnitsCode |
double | Value {0.0} |
bool | ValueDefined {false} |
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");
Definition at line 61 of file vtkMRMLMeasurement.h.
typedef vtkObject vtkMRMLMeasurement::Superclass |
Definition at line 84 of file vtkMRMLMeasurement.h.
Measurement computation status
Enumerator | |
---|---|
NoChange | can be used to indicate to keep the current value |
OK | success |
InsufficientInput | |
InternalError |
Definition at line 67 of file vtkMRMLMeasurement.h.
Definition at line 75 of file vtkMRMLMeasurement.h.
|
protected |
|
overrideprotected |
|
protected |
|
virtual |
Reset state of object. Removes all content.
|
virtual |
Clear measured value Note: per-control-point values are not cleared
|
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.
|
virtual |
Copy one type into another (deep copy)
|
pure virtual |
Create a new instance of this measurement type.
Implemented in vtkMRMLStaticMeasurement, vtkMRMLMeasurementAngle, vtkMRMLMeasurementArea, vtkMRMLMeasurementLength, and vtkMRMLMeasurementVolume.
|
virtual |
|
virtual |
|
virtual |
Reimplemented in vtkMRMLStaticMeasurement, vtkMRMLMeasurementAngle, vtkMRMLMeasurementArea, vtkMRMLMeasurementLength, and vtkMRMLMeasurementVolume.
|
virtual |
|
virtual |
|
virtual |
Informal description of the measurement.
|
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).
double vtkMRMLMeasurement::GetDisplayValue | ( | ) |
Get display value. It is computed using this formula: DisplayValue = Value * DisplayCoefficient.
|
virtual |
Enabled.
vtkMRMLNode* vtkMRMLMeasurement::GetInputMRMLNode | ( | ) |
Get input MRML node used for calculating the measurement.
|
virtual |
Get last computation result.
const char* vtkMRMLMeasurement::GetLastComputationResultAsPrintableString | ( | ) |
Get last computation result as human-readable string.
|
virtual |
|
virtual |
|
virtual |
Measurement name.
|
virtual |
Formatting string for displaying measurement value and units.
|
virtual |
|
protected |
Helper function to get unit node from the scene based on quantity name.
|
virtual |
Measurement unit.
|
virtual |
|
virtual |
Get quantity value.
|
virtual |
Value defined flag (whether a computed value has been set or not)
std::string vtkMRMLMeasurement::GetValueWithUnitsAsPrintableString | ( | ) |
Get measurement value and units as a single human-readable string.
|
virtual |
Reimplemented in vtkMRMLStaticMeasurement, vtkMRMLMeasurementAngle, vtkMRMLMeasurementArea, vtkMRMLMeasurementLength, and vtkMRMLMeasurementVolume.
|
static |
|
protected |
|
override |
|
static |
void vtkMRMLMeasurement::SetControlPointValues | ( | vtkDoubleArray * | inputValues | ) |
Set the per-control point measurement values.
void vtkMRMLMeasurement::SetDerivationCode | ( | vtkCodedEntry * | entry | ) |
Copy content of coded entry.
|
virtual |
|
virtual |
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.
|
virtual |
void vtkMRMLMeasurement::SetInputMRMLNode | ( | vtkMRMLNode * | node | ) |
Set input MRML node used for calculating the measurement.
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.
void vtkMRMLMeasurement::SetMethodCode | ( | vtkCodedEntry * | entry | ) |
Copy content of coded entry.
|
virtual |
|
virtual |
void vtkMRMLMeasurement::SetQuantityCode | ( | vtkCodedEntry * | entry | ) |
Copy content of coded entry.
|
virtual |
void vtkMRMLMeasurement::SetUnitsCode | ( | vtkCodedEntry * | entry | ) |
Copy content of coded entry.
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.
|
protected |
Per-control point measurements.
Definition at line 223 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 217 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 214 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 213 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 209 of file vtkMRMLMeasurement.h.
|
protected |
MRML node used to calculate the measurement.
Definition at line 227 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 220 of file vtkMRMLMeasurement.h.
|
protected |
Surface mesh for displaying computed value.
Definition at line 225 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 219 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 210 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 215 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 216 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 213 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 218 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 211 of file vtkMRMLMeasurement.h.
|
protected |
Definition at line 212 of file vtkMRMLMeasurement.h.