Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLIOOptionsDescription Class Reference

#include <Libs/MRML/Logic/vtkMRMLIOOptionsDescription.h>

Inheritance diagram for vtkMRMLIOOptionsDescription:
Collaboration diagram for vtkMRMLIOOptionsDescription:

Public Types

typedef vtkObject Superclass
 

Public Member Functions

void AddBoolOption (const std::string &property, const std::string &label, const std::string &toolTip, bool defaultValue)
 Add an option. If an option already exists for the property then it is replaced.
 
void AddDoubleOption (const std::string &property, const std::string &label, const std::string &toolTip, double defaultValue, double minimum, double maximum, int decimals)
 
void AddEnumChoice (const std::string &property, const vtkVariant &value, const std::string &label)
 
void AddEnumOption (const std::string &property, const std::string &label, const std::string &toolTip, const vtkVariant &defaultValue)
 Add an option that can have one of the values added by AddEnumChoice().
 
void AddIntOption (const std::string &property, const std::string &label, const std::string &toolTip, int defaultValue, int minimum, int maximum)
 
void AddNodeOption (const std::string &property, const std::string &label, const std::string &toolTip, const std::string &defaultNodeID, const std::vector< std::string > &nodeClasses, bool noneEnabled)
 Add an option for selecting a MRML node. The value is the node ID.
 
void AddStringListOption (const std::string &property, const std::string &label, const std::string &toolTip, const std::vector< std::string > &defaultValue, const std::string &separator=";")
 
void AddStringOption (const std::string &property, const std::string &label, const std::string &toolTip, const std::string &defaultValue)
 
bool GetBoolOptionValue (const std::string &property, bool defaultValue=false)
 Effective value of a boolean option. Returns defaultValue if the option is not found.
 
virtual const char * GetClassName ()
 
vtkMRMLIOProperties * GetDefaults ()
 
std::string GetFileName ()
 Get the file name from the properties. If multiple file names are specified then the first one is returned.
 
std::vector< std::string > GetFileNames ()
 Get all file names from the properties.
 
std::string GetNthOptionChoiceLabel (int index, int choiceIndex)
 
vtkVariant GetNthOptionChoiceValue (int index, int choiceIndex)
 
int GetNthOptionDecimals (int index)
 Number of decimals of a double option. Returns -1 if not specified.
 
bool GetNthOptionEnabled (int index)
 
bool GetNthOptionHasRange (int index)
 Returns true if the option has a range (int and double options).
 
std::string GetNthOptionLabel (int index)
 
double GetNthOptionMaximum (int index)
 
double GetNthOptionMinimum (int index)
 
std::vector< std::string > GetNthOptionNodeClasses (int index)
 Node classes, whether "None" can be selected, and whether hidden nodes are shown (node options).
 
bool GetNthOptionNoneEnabled (int index)
 
int GetNthOptionNumberOfChoices (int index)
 Choices of an enum option.
 
std::string GetNthOptionProperty (int index)
 
std::string GetNthOptionSeparator (int index)
 Separator of items of a string list option.
 
bool GetNthOptionShowHidden (int index)
 
std::vector< std::string > GetNthOptionStringListValue (int index)
 Effective value of a string list option.
 
std::string GetNthOptionToolTip (int index)
 
std::string GetNthOptionType (int index)
 Option type: "bool", "int", "double", "string", "stringList", "enum", or "node".
 
vtkVariant GetNthOptionValue (int index)
 
bool GetNthOptionVisible (int index)
 
std::string GetNthOptionWidget (int index)
 Hint for choosing a specific widget (for example "colorTable"). Empty if not specified.
 
int GetNumberOfOptions ()
 Number of options.
 
int GetOptionIndex (const std::string &property)
 Get index of the option that sets the specified property. Returns -1 if not found.
 
vtkVariant GetOptionValue (const std::string &property)
 
void GetOptionValues (vtkMRMLIOProperties *values)
 Get the effective values of all options. Options that have empty string or string list values are not included.
 
vtkMRMLIOProperties * GetProperties ()
 
bool HasOption (const std::string &property)
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void RemoveAllOptions ()
 Remove all options.
 
void SetDefaults (vtkMRMLIOProperties *defaults)
 Default values specified by the application (for example, from user settings).
 
void SetOptionEnabled (const std::string &property, bool enabled)
 Set additional attributes of an option.
 
void SetOptionShowHidden (const std::string &property, bool showHidden)
 Show nodes that are hidden from editors in node selectors.
 
void SetOptionVisible (const std::string &property, bool visible)
 
void SetOptionWidget (const std::string &property, const std::string &widget)
 Hint for choosing a specific widget (for example "colorTable").
 
void SetProperties (vtkMRMLIOProperties *properties)
 Context and current values of options (for example, edited by the user). These values take precedence over defaults.
 
std::string ToJSON ()
 Get the description of all options as JSON.
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLIOOptionsDescription * New ()
 
static vtkMRMLIOOptionsDescription * SafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkMRMLIOOptionsDescription ()
 
 ~vtkMRMLIOOptionsDescription () override
 

Detailed Description

Description of the options of a file reader or writer (properties that the user can set, such as "labelmap"), which user interfaces use to display widgets for setting the options. Readers and writers add options in vtkMRMLFileIOHandler::GetOptionsDescription() using the Add...Option() methods. User interfaces read the options using the GetNthOption...() methods, or as JSON (ToJSON()).

See https://slicer.readthedocs.io/en/latest/developer_guide/mrml_overview.html#reader-and-writer-options

Definition at line 38 of file vtkMRMLIOOptionsDescription.h.

Member Typedef Documentation

◆ Superclass

Definition at line 42 of file vtkMRMLIOOptionsDescription.h.

Constructor & Destructor Documentation

◆ vtkMRMLIOOptionsDescription()

vtkMRMLIOOptionsDescription::vtkMRMLIOOptionsDescription ( )
protected

◆ ~vtkMRMLIOOptionsDescription()

vtkMRMLIOOptionsDescription::~vtkMRMLIOOptionsDescription ( )
overrideprotected

Member Function Documentation

◆ AddBoolOption()

void vtkMRMLIOOptionsDescription::AddBoolOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
bool defaultValue )

Add an option. If an option already exists for the property then it is replaced.

◆ AddDoubleOption()

void vtkMRMLIOOptionsDescription::AddDoubleOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
double defaultValue,
double minimum,
double maximum,
int decimals )

◆ AddEnumChoice()

void vtkMRMLIOOptionsDescription::AddEnumChoice ( const std::string & property,
const vtkVariant & value,
const std::string & label )

◆ AddEnumOption()

void vtkMRMLIOOptionsDescription::AddEnumOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
const vtkVariant & defaultValue )

Add an option that can have one of the values added by AddEnumChoice().

◆ AddIntOption()

void vtkMRMLIOOptionsDescription::AddIntOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
int defaultValue,
int minimum,
int maximum )

◆ AddNodeOption()

void vtkMRMLIOOptionsDescription::AddNodeOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
const std::string & defaultNodeID,
const std::vector< std::string > & nodeClasses,
bool noneEnabled )

Add an option for selecting a MRML node. The value is the node ID.

◆ AddStringListOption()

void vtkMRMLIOOptionsDescription::AddStringListOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
const std::vector< std::string > & defaultValue,
const std::string & separator = ";" )

◆ AddStringOption()

void vtkMRMLIOOptionsDescription::AddStringOption ( const std::string & property,
const std::string & label,
const std::string & toolTip,
const std::string & defaultValue )

◆ GetBoolOptionValue()

bool vtkMRMLIOOptionsDescription::GetBoolOptionValue ( const std::string & property,
bool defaultValue = false )

Effective value of a boolean option. Returns defaultValue if the option is not found.

◆ GetClassName()

virtual const char * vtkMRMLIOOptionsDescription::GetClassName ( )
virtual

◆ GetDefaults()

vtkMRMLIOProperties * vtkMRMLIOOptionsDescription::GetDefaults ( )

◆ GetFileName()

std::string vtkMRMLIOOptionsDescription::GetFileName ( )

Get the file name from the properties. If multiple file names are specified then the first one is returned.

◆ GetFileNames()

std::vector< std::string > vtkMRMLIOOptionsDescription::GetFileNames ( )

Get all file names from the properties.

◆ GetNthOptionChoiceLabel()

std::string vtkMRMLIOOptionsDescription::GetNthOptionChoiceLabel ( int index,
int choiceIndex )

◆ GetNthOptionChoiceValue()

vtkVariant vtkMRMLIOOptionsDescription::GetNthOptionChoiceValue ( int index,
int choiceIndex )

◆ GetNthOptionDecimals()

int vtkMRMLIOOptionsDescription::GetNthOptionDecimals ( int index)

Number of decimals of a double option. Returns -1 if not specified.

◆ GetNthOptionEnabled()

bool vtkMRMLIOOptionsDescription::GetNthOptionEnabled ( int index)

◆ GetNthOptionHasRange()

bool vtkMRMLIOOptionsDescription::GetNthOptionHasRange ( int index)

Returns true if the option has a range (int and double options).

◆ GetNthOptionLabel()

std::string vtkMRMLIOOptionsDescription::GetNthOptionLabel ( int index)

◆ GetNthOptionMaximum()

double vtkMRMLIOOptionsDescription::GetNthOptionMaximum ( int index)

◆ GetNthOptionMinimum()

double vtkMRMLIOOptionsDescription::GetNthOptionMinimum ( int index)

◆ GetNthOptionNodeClasses()

std::vector< std::string > vtkMRMLIOOptionsDescription::GetNthOptionNodeClasses ( int index)

Node classes, whether "None" can be selected, and whether hidden nodes are shown (node options).

◆ GetNthOptionNoneEnabled()

bool vtkMRMLIOOptionsDescription::GetNthOptionNoneEnabled ( int index)

◆ GetNthOptionNumberOfChoices()

int vtkMRMLIOOptionsDescription::GetNthOptionNumberOfChoices ( int index)

Choices of an enum option.

◆ GetNthOptionProperty()

std::string vtkMRMLIOOptionsDescription::GetNthOptionProperty ( int index)

Get attributes of the option at the specified index (0 <= index < GetNumberOfOptions()). User interfaces use these methods to display widgets for the options. If the index is out of range then an error is logged and an empty value is returned.

◆ GetNthOptionSeparator()

std::string vtkMRMLIOOptionsDescription::GetNthOptionSeparator ( int index)

Separator of items of a string list option.

◆ GetNthOptionShowHidden()

bool vtkMRMLIOOptionsDescription::GetNthOptionShowHidden ( int index)

◆ GetNthOptionStringListValue()

std::vector< std::string > vtkMRMLIOOptionsDescription::GetNthOptionStringListValue ( int index)

Effective value of a string list option.

◆ GetNthOptionToolTip()

std::string vtkMRMLIOOptionsDescription::GetNthOptionToolTip ( int index)

◆ GetNthOptionType()

std::string vtkMRMLIOOptionsDescription::GetNthOptionType ( int index)

Option type: "bool", "int", "double", "string", "stringList", "enum", or "node".

◆ GetNthOptionValue()

vtkVariant vtkMRMLIOOptionsDescription::GetNthOptionValue ( int index)

Effective value of the option (from properties, defaults, or the default specified for the option). Boolean values are returned as integer (0 or 1), enum values keep the type of the choice values. For string list options, use GetNthOptionStringListValue() instead.

◆ GetNthOptionVisible()

bool vtkMRMLIOOptionsDescription::GetNthOptionVisible ( int index)

◆ GetNthOptionWidget()

std::string vtkMRMLIOOptionsDescription::GetNthOptionWidget ( int index)

Hint for choosing a specific widget (for example "colorTable"). Empty if not specified.

◆ GetNumberOfOptions()

int vtkMRMLIOOptionsDescription::GetNumberOfOptions ( )

Number of options.

◆ GetOptionIndex()

int vtkMRMLIOOptionsDescription::GetOptionIndex ( const std::string & property)

Get index of the option that sets the specified property. Returns -1 if not found.

◆ GetOptionValue()

vtkVariant vtkMRMLIOOptionsDescription::GetOptionValue ( const std::string & property)

Effective value of an option (from properties, defaults, or the default specified for the option). Returns invalid variant if the option is not found. For string list options, items are joined using the separator.

◆ GetOptionValues()

void vtkMRMLIOOptionsDescription::GetOptionValues ( vtkMRMLIOProperties * values)

Get the effective values of all options. Options that have empty string or string list values are not included.

◆ GetProperties()

vtkMRMLIOProperties * vtkMRMLIOOptionsDescription::GetProperties ( )

◆ HasOption()

bool vtkMRMLIOOptionsDescription::HasOption ( const std::string & property)

◆ IsA()

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

◆ IsTypeOf()

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

◆ New()

static vtkMRMLIOOptionsDescription * vtkMRMLIOOptionsDescription::New ( )
static

◆ PrintSelf()

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

◆ RemoveAllOptions()

void vtkMRMLIOOptionsDescription::RemoveAllOptions ( )

Remove all options.

◆ SafeDownCast()

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

◆ SetDefaults()

void vtkMRMLIOOptionsDescription::SetDefaults ( vtkMRMLIOProperties * defaults)

Default values specified by the application (for example, from user settings).

◆ SetOptionEnabled()

void vtkMRMLIOOptionsDescription::SetOptionEnabled ( const std::string & property,
bool enabled )

Set additional attributes of an option.

◆ SetOptionShowHidden()

void vtkMRMLIOOptionsDescription::SetOptionShowHidden ( const std::string & property,
bool showHidden )

Show nodes that are hidden from editors in node selectors.

◆ SetOptionVisible()

void vtkMRMLIOOptionsDescription::SetOptionVisible ( const std::string & property,
bool visible )

◆ SetOptionWidget()

void vtkMRMLIOOptionsDescription::SetOptionWidget ( const std::string & property,
const std::string & widget )

Hint for choosing a specific widget (for example "colorTable").

◆ SetProperties()

void vtkMRMLIOOptionsDescription::SetProperties ( vtkMRMLIOProperties * properties)

Context and current values of options (for example, edited by the user). These values take precedence over defaults.

◆ ToJSON()

std::string vtkMRMLIOOptionsDescription::ToJSON ( )

Get the description of all options as JSON.


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