MeVisLab Toolbox Reference
CSOGenerator.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#pragma once
17
18#include "CSOBaseModule.h"
19#include "CSOGeneratorBase.h"
20
22
29{
30
31public:
32
34 CSOGenerator(std::string type="CSOGenerator", int numInImg=0, int numOutImg=0);
35
37 inline std::string getType() const { return _type; }
38
39protected:
40
41 /* FIELDS */
42
46
49
53
57
61
70
79
84
85
86 /* MEMBER VARIABLES */
87
88
89 /* METHODS */
90
91 // The indirection of the following three methods is not really necessary, we
92 // could call those methods implemented in CSOGeneratorBase directly where needed.
93
94 // The indirection is here because we do not want to change all calls in all
95 // other modules (which may be implemented by external colleagues).
96
97
102 CSO* _addCSO(CSOList* csoList, bool useUndoRedo=true) { return generatorAddCSO(csoList, useUndoRedo); }
104 CSO* _addCSONoEvent(CSOList* csoList, bool useUndoRedo = true) { return generatorAddCSONoEvent(csoList, useUndoRedo); }
106 CSOGroup* _getParentGroup(CSOList* csoList, bool useUndoRedo=false, bool generate=false) { return generatorGetParentGroup(csoList, useUndoRedo, generate); }
109
111 int getModuleCreatorId() const override { return static_cast<int>(_idFld->getIntValue()); }
113 std::string getModuleType() const override { return getType(); }
114
117 bool getShouldEmptyBeforeGeneration() const override { return _emptyGroupBeforeGenerationFld->getBoolValue(); }
119 int getAddCSOToGroupMode() const override { return _addCSOToGroupMode->getEnumValue(); }
121 std::string getAddCSOToGroupLabel() const override { return _addCSOToGroupWithLabelFld->getStringValue(); }
123 int getAddCSOToGroupId() const override { return static_cast<int>(_addCSOToGroupWithIdFld->getIntValue()); }
124
126 int getDefaultPathPointStyle() const override { return _pathPointStyleFld->getEnumValue(); }
128 float getDefaultPathPointWidth() const override { return _pathPointWidthFld->getFloatValue(); }
130 Vector3 getDefaultPathPointColor() const override { return _pathPointColorFld->getVector3Value(); }
132 float getDefaultPathPointAlpha() const override { return _pathPointAlphaFld->getFloatValue(); }
133
135 int getDefaultSeedPointStyle() const override { return _seedPointStyleFld->getEnumValue(); }
137 float getDefaultSeedPointSize() const override { return _seedPointSizeFld->getFloatValue(); }
139 Vector3 getDefaultSeedPointColor() const override { return _seedPointColorFld->getVector3Value(); }
141 float getDefaultSeedPointAlpha() const override { return _seedPointAlphaFld->getFloatValue(); }
142
144 int getDefaultVoxelWriteMode() const override { return _voxelWriteModeFld->getEnumValue(); }
146 float getDefaultVoxelWriteValue() const override { return _voxelWriteValueFld->getFloatValue(); }
147
149 ~CSOGenerator() override;
150
151private:
152
154};
155
157
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition MLCSOSystem.h:23
Field to encapsulate a boolean value.
Definition mlFields.h:58
bool getBoolValue() const
Returns the value of the field as a Boolean.
Base class for CSOModules.
std::string _type
The processor type as a string.
CSOGroup * generatorGetParentGroup(CSOList *csoList, bool useUndoRedo=false, bool generate=false)
Returns the parent group according to current group settings.
void generatorEmptyGroupOnDemand(CSOList *csoList)
Empties a group on demand of the given CSOList with the set label.
CSO * generatorAddCSONoEvent(CSOList *csoList, bool useUndoRedo=true, bool sendEvent=false)
See generatorAddCSO, but no group scope event is emitted. (So this method is faster!...
CSO * generatorAddCSO(CSOList *csoList, bool useUndoRedo=true)
Adds a new CSO to the CSOList.
The CSOGenerator is the base class for all modules that generate CSOs, be it automatically or interac...
IntField * _idFld
The id of this processor.
Vector3 getDefaultSeedPointColor() const override
Returns the set default seed point color for a new CSO.
StringField * _addCSOToGroupWithLabelFld
This label defines the group the generator should add its created CSOs to.
FloatField * _pathPointAlphaFld
The path point's alpha value. Default is 1.
BoolField * _emptyGroupBeforeGenerationFld
If checked and a group name is provided, the group is emptied before a new generation.
TypedEnumField< CSOAddToGroupModes > * _addCSOToGroupMode
Defines if the CSOs are added to a group and how the group is identified.
int getModuleCreatorId() const override
Returns the module's creator id.
FloatField * _seedPointAlphaFld
The marker's alpha value. Default is 1.
~CSOGenerator() override
Destructor.
int getDefaultVoxelWriteMode() const override
Returns the set default voxel write mode for a new CSO.
TypedEnumField< CSOSeedPointStyle > * _seedPointStyleFld
The marker's mode (none, rect, circle). Default is 'rect'.
Vector3 getDefaultPathPointColor() const override
Returns the set default path point color for a new CSO.
TypedEnumField< CSOPathPointsStyle > * _pathPointStyleFld
The path point's line style (none, solid, dashed, dotted). Default is 'solid'.
std::string getAddCSOToGroupLabel() const override
Returns the label string of a target group.
FloatField * _pathPointWidthFld
The path point's line width. Default is 1.
CSOGroup * _getParentGroup(CSOList *csoList, bool useUndoRedo=false, bool generate=false)
Returns the parent group according to current group settings.
CSOGenerator(std::string type="CSOGenerator", int numInImg=0, int numOutImg=0)
Constructor.
CSO * _addCSONoEvent(CSOList *csoList, bool useUndoRedo=true)
See _addCSO, but without group event. (This method is faster!).
CSO * _addCSO(CSOList *csoList, bool useUndoRedo=true)
Adds a new CSO to the CSOList.
float getDefaultPathPointAlpha() const override
Returns the set default path point alpha for a new CSO.
ColorField * _seedPointColorFld
The marker's color. Default is green.
int getDefaultSeedPointStyle() const override
Returns the set default seed point style for a new CSO.
bool getShouldEmptyBeforeGeneration() const override
Returns whether the module should empty a group before generating CSOs into it.
int getAddCSOToGroupMode() const override
Returns the group generation mode.
float getDefaultSeedPointSize() const override
Returns the set default seed point size for a new CSO.
FloatField * _seedPointSizeFld
The marker's size. Default is 3.
FloatField * _voxelWriteValueFld
The CSO's voxel write value. Default is 1024.
TypedEnumField< CSOVoxelWriteModes > * _voxelWriteModeFld
The CSO's voxel write mode (module, const, const plus id, id). Default is 'module'.
int getAddCSOToGroupId() const override
Returns the id of a target group.
int getDefaultPathPointStyle() const override
Returns the set default path point style for a new CSO.
float getDefaultSeedPointAlpha() const override
Returns the set default seed point alpha for a new CSO.
IntField * _addCSOToGroupWithIdFld
This id defines the group the generator should add its created CSOs to.
std::string getType() const
Returns the type of the CSOGenerator.
std::string getModuleType() const override
Returns the module's type string.
void _emptyGroupOnDemand(CSOList *csoList)
Empties a group on demand of the given CSOList with the set label.
float getDefaultPathPointWidth() const override
Returns the set default path point width for a new CSO.
float getDefaultVoxelWriteValue() const override
Returns the set default voxel write value for a new CSO.
ColorField * _pathPointColorFld
The path point's color. Default is yellow.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
Definition CSOGroup.h:38
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition CSOList.h:61
The CSO represents a contour segmentation object.
Definition CSO.h:44
Field to encapsulate a vector of 3 float values representing an (rgb) color with all properties of Ve...
Definition mlFields.h:1441
Field to encapsulate a float value.
Definition mlFields.h:415
float getFloatValue() const
Returns the value of the field.
Field to encapsulate an integer value.
Definition mlFields.h:126
MLint getIntValue() const
Returns the value of the field as an MLint.
Field to encapsulate a string value.
Definition mlFields.h:610
std::string getStringValue() const override
Returns the value of the field as a string value setStringValue must be able to reinterpret this retu...
TypedEnumField is used to encapsulate a C++ enum value and work with a real enum value instead of int...
Definition mlFields.h:384
EnumType getEnumValue() const
Gets the current enum value.
Definition mlFields.h:397
const Vector3 & getVector3Value() const
Returns the value of the field.
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.