MeVisLab Toolbox Reference
CSOValidator.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2015, 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 "MLCSOIncludes.h"
19
21
22class CSO;
23class CSOGroup;
24class CSOList;
25class CSOPredicate;
26
28{
29public:
30
34 CSOValidator(const std::vector<const CSO*> &csos);
35 CSOValidator(const CSOList &csoList);
37
42
47
52
57
63
68 bool areAllCSOsParallel(double epsilon);
70
78 bool areAllCSOsParallelToPlane(const Vector3 &planeNormal, double epsilon);
80
85
88
91
95
99
100private:
101 const CSO* _getFirstCSO();
102 std::vector<const CSO*> _getAllCSOs();
103 std::vector<const CSO*> _getAllCSOsFromCSOGroup();
104 std::vector<const CSO*> _getAllCSOsFromCSOList();
105
106 const std::vector<const CSO*> *_csos;
107 const CSOGroup *_csoGroup;
108 const CSOList *_csoList;
109};
110
std::vector< unsigned int > CSOIdVector
Defines a vector to hold CSO and CSOGroup ids.
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition MLCSOSystem.h:23
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
bool areAllCSOsOpen()
Returns whether all CSOs are open, if a std::vector<unsigned int> is passed, the IDs of closed CSOs w...
bool hasAtLeastCSOGroups(size_t minNumGroups)
Returns whether passed CSO collection has at least 'minNumGroups' CSOGroup if passed CSO collection i...
bool areAllCSOsParallelToPlane(const Vector3 &planeNormal, double epsilon)
Returns whether all CSOs are parallel to the plane given by a normal vector, if a std::vector<unsigne...
bool areAllCSOsSatisfyingPredicate(const CSOPredicate &pred)
Returns whether all CSOs satisfy given predicate, if a std::vector<unsigned int> is passed,...
bool areAllCSOsInPlane(CSOIdVector &violatingCSOIDs)
bool hasAtMostCSOGroups(size_t maxNumGroups)
Returns whether passed CSO collection has at most 'maxNumGroups' CSOGroups if passed CSO collection i...
bool areAllCSOsNotSelfIntersecting(CSOIdVector &violatingCSOIDs)
CSOValidator(const CSOList &csoList)
bool areAllCSOsClosed(CSOIdVector &violatingCSOIDs)
bool areAllCSOsParallel(double epsilon)
Returns whether all CSOs are parallel to the plane on which the first CSO in the passed CSO collectio...
bool areAllCSOsInPlane()
Returns whether all CSOs are in-plane, if a std::vector<unsigned int> is passed, the IDs of not in-pl...
bool areAllCSOsClosed()
Returns whether all CSOs are closed, if a std::vector<unsigned int> is passed, the IDs of open CSOs w...
bool areAllCSOsParallel(double epsilon, CSOIdVector &violatingCSOIDs)
CSOValidator(const CSOGroup &csoGroup)
bool areAllCSOsParallelToPlane(const Vector3 &planeNormal, double epsilon, CSOIdVector &violatingCSOIDs)
bool areAllCSOsInSamePlane(CSOIdVector &violatingCSOIDs)
CSOValidator(const std::vector< const CSO * > &csos)
Constructors taking a CSO collection to be validated: a std::vector, a CSOList or a CSOGroup.
bool hasAtLeastCSOs(size_t minNumCSOs)
Returns whether passed CSO collection has at least 'minNumCSOs' CSOs.
bool hasAtMostCSOs(size_t maxNumCSOs)
Returns whether passed CSO collection has at most 'maxNumCSOs' CSOs.
bool areAllCSOsNotSelfIntersecting()
Returns whether all CSOs are not self intersecting, if a std::vector<unsigned int> is passed,...
bool areAllCSOsInSamePlane()
Returns whether all CSOs are in the same plane as the first CSO in the passed CSO collection,...
bool areAllCSOsSatisfyingPredicate(const CSOPredicate &pred, CSOIdVector &violatingCSOIDs)
bool areAllCSOsOpen(CSOIdVector &violatingCSOIDs)
The CSO represents a contour segmentation object.
Definition CSO.h:44
Target mlrange_cast(Source arg)
Generic version of checked ML casts.