MeVisLab Toolbox Reference
CSOVoxelSetList.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 
16 
17 #pragma once
18 
19 #include "MLCSOIncludes.h"
20 
21 
22 ML_START_NAMESPACE
23 
24 
25 class CSOVoxelSet;
26 class CSOVoxelSetGroup;
27 class CSOList;
28 
30 
32 {
33 
34 public:
35 
38 
40  ~CSOVoxelSetList() override;
41 
43  void destroy();
44 
48  void setupInternalStructureAsCSOList(CSOList* csoList, PagedImage* image=nullptr);
49 
53 
55  int numCSOVoxelSet() const { return static_cast<int>(_csoVoxelSets.size()); }
57  CSOVoxelSet* csoVoxelSetAt(size_t index) const { return _csoVoxelSets[index]; }
62 
64  void addOrReplaceCSOVoxelSetWithId(int id, const CSOVoxelSet& other);
65 
68 
70  int numCSOVoxelSetGroup() const { return static_cast<int>(_csoVoxelSetGroups.size()); }
72  CSOVoxelSetGroup* csoVoxelSetGroupAt(size_t index) const { return _csoVoxelSetGroups[index]; }
78  int getMaxTimepointIndex() const;
85  bool isInsideImage(const Vector3& position);
88  const SubImageBox& getImageBox() const { return _imageBox; }
90  void setSubImageBox(const SubImageBox& subImageBox) { _imageBox = subImageBox; }
92  Matrix4 getVoxelToWorldMatrix() const { return _voxelToWorldMatrix; }
94  void setVoxelToWorldMatrix(const Matrix4& voxelToWorldMatrix) { _voxelToWorldMatrix = voxelToWorldMatrix; }
97  void addStateToTree(TreeNode* parent) const override;
98  // Sets current version number
101  void readStateFromTree(TreeNode* parent) override;
102 
103 
104 protected:
105 
106  // nothing so far
107 
108 private:
109 
110  /* MEMBER VARIABLES */
111 
113  std::vector<CSOVoxelSet*> _csoVoxelSets;
115  std::vector<CSOVoxelSetGroup*> _csoVoxelSetGroups;
116 
117  SubImageBox _imageBox;
118 
119  Matrix4 _voxelToWorldMatrix;
120 
121  /* METHODS */
122 
123  void _loadVersion(TreeNode* parent, int version);
124 
126 };
127 
129 
130 ML_END_NAMESPACE
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition: MLCSOSystem.h:23
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition: mlBase.h:62
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
const SubImageBox & getImageBox() const
Returns the image box (which is empty if no valid PagedImage was available).
CSOVoxelSetList()
Standard constructor.
CSOVoxelSetGroup * csoVoxelSetGroupWithId(int id)
Returns the pointer to a CSOVoxelSetGroup with a given id. NULL if it does not exist.
void addOrReplaceCSOVoxelSetWithId(int id, const CSOVoxelSet &other)
Adds or replaces an existing CSOVoxelSet in this list.
void setVoxelToWorldMatrix(const Matrix4 &voxelToWorldMatrix)
Sets the voxelToWorldMatrix.
int numCSOVoxelSetGroup() const
Returns the number of CSOVoxelSetGroups.
void setSubImageBox(const SubImageBox &subImageBox)
Sets the SubImageBox.
void setupInternalStructureAsCSOList(CSOList *csoList, PagedImage *image=nullptr)
Establishes the internal structure as the given CSOList.
void removeCSOVoxelSetWithId(int id)
Removes a CSOVoxelSet.
CSOVoxelSet * csoVoxelSetAt(size_t index) const
Returns the pointer to a CSOVoxelSet at a given index.
void setupInternalStructureAsImage(const PagedImage *image)
Establishes the internal structure fitting to the given image.
int getMaxTimepointIndex() const
Computes and returns the maximum timepoint index.
int numCSOVoxelSet() const
Returns the number of CSOVoxelSets.
bool isInsideImage(const Vector3 &position)
Returns whether a given position is inside the association image.
void destroy()
Deletes internal structures.
~CSOVoxelSetList() override
Standard destructor.
MLdouble getMinVoxelValue() const
Computes and returns the minimum voxel value.
CSOVoxelSetGroup * csoVoxelSetGroupAt(size_t index) const
Returns the pointer to a CSOVoxelSetGroup at a given index.
CSOVoxelSet * addCSOVoxelSet()
Adds and returns a new CSOVoxelSet.
MLdouble getMaxVoxelValue() const
Computes and returns the maximum voxel value.
CSOVoxelSetGroup * addCSOVoxelSetGroup()
Adds and returns a new CSOVoxelSetGroup.
CSOVoxelSet * csoVoxelSetWithId(int id)
Returns the pointer to a CSOVoxelSet with a given id. NULL if it does not exist.
void readStateFromTree(TreeNode *parent) override
Implements import functionality (as used by the LoadBase module):
void addStateToTree(TreeNode *parent) const override
Matrix4 getVoxelToWorldMatrix() const
Returns the image matrix if a valid PagedImage was set. Otherwise returns the identity matrix.
The CSOVoxelSet represents a contour segmentation object in discrete voxel coordinates.
Definition: CSOVoxelSet.h:50
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
The class TreeNode is the abstract base class for the import/export of ML objects.
Definition: mlTreeNode.h:170
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
double MLdouble
Definition: mlTypeDefs.h:223