6#ifndef __vtkMRMLVolumePropertyNode_h
7#define __vtkMRMLVolumePropertyNode_h
10#include "vtkSlicerVolumeRenderingModuleMRMLExport.h"
16class vtkColorTransferFunction;
18class vtkPiecewiseFunction;
19class vtkVolumeProperty;
34 EffectiveRangeModified = 62300
40 void PrintSelf(ostream& os, vtkIndent indent)
override;
44 vtkGetObjectMacro(VolumeProperty, vtkVolumeProperty);
67 void SetColor(vtkColorTransferFunction* newColorFunction,
int component = 0);
71 vtkColorTransferFunction*
GetColor(
int component = 0);
94 vtkPiecewiseFunction* result);
101 vtkColorTransferFunction* result);
107 static inline void GetPiecewiseFunctionFromString(
const char *str,
108 vtkPiecewiseFunction* result);
115 static inline void GetColorTransferFunctionFromString(
const char *str,
116 vtkColorTransferFunction* result);
132 vtkGetVector2Macro(EffectiveRange,
double);
173 static int NodesFromString(
const std::string& dataString,
double* &data,
int nodeSize);
203 vtkVolumeProperty* VolumeProperty{
nullptr};
208 double EffectiveRange[2]{0.0,-1.0};
211 int DisabledModify{0};
221void vtkMRMLVolumePropertyNode
222::GetPiecewiseFunctionFromString(
const char *str,
223 vtkPiecewiseFunction* result)
226 std::string(str), result);
230void vtkMRMLVolumePropertyNode
231::GetColorTransferFunctionFromString(
const char *str,
232 vtkColorTransferFunction* result)
235 std::string (str), result);
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...
bool GetModifiedSinceRead() override
~vtkMRMLVolumePropertyNode() override
void SetRGBTransferFunctionAsString(std::string)
void SetGradientOpacity(vtkPiecewiseFunction *newGradientOpacity, int component=0)
static double HigherAndUnique(double value, double &previousValue)
static double NextHigher(double value)
vtkMRMLCopyContentMacro(vtkMRMLVolumePropertyNode)
vtkIntArray * ObservedEvents
Events observed on the transfer functions.
vtkMRMLStorageNode * CreateDefaultStorageNode() override
Create default storage node or nullptr if does not have one.
double GetSpecularPower()
vtkColorTransferFunction * GetColor(int component=0)
void SetInterpolationType(int)
void SetScalarOpacityAsString(std::string)
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Reimplemented for internal reasons.
static std::string GetPiecewiseFunctionString(vtkPiecewiseFunction *function)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
int GetInterpolationType()
static void GetPiecewiseFunctionFromString(const std::string &str, vtkPiecewiseFunction *result)
vtkMRMLVolumePropertyNode()
static int DataFromString(const std::string &dataString, double *&data)
static std::string GetColorTransferFunctionString(vtkColorTransferFunction *function)
std::string GetRGBTransferFunctionAsString()
void SetGradientOpacityAsString(std::string)
void SetEffectiveRange(double range[2])
void SetEffectiveRange(double min, double max)
Set effective range.
static vtkMRMLVolumePropertyNode * New()
Create a new vtkMRMLVolumePropertyNode.
static int NodesFromString(const std::string &dataString, double *&data, int nodeSize)
void CopyParameterSet(vtkMRMLNode *node)
std::string GetScalarOpacityAsString()
void SetScalarOpacity(vtkPiecewiseFunction *newScalarOpacity, int component=0)
void SetColor(vtkColorTransferFunction *newColorFunction, int component=0)
std::string GetGradientOpacityAsString()
vtkPiecewiseFunction * GetGradientOpacity(int component=0)
bool CalculateEffectiveRange()
void ReadXMLAttributes(const char **atts) override
Set node attributes.
vtkPiecewiseFunction * GetScalarOpacity(int component=0)
void SetSpecularPower(double)
void PrintSelf(ostream &os, vtkIndent indent) override
static std::string DataToString(double *data, int size)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
static void GetColorTransferFunctionFromString(const std::string &str, vtkColorTransferFunction *result)