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 
20 ML_START_NAMESPACE
21 
22 class CSO;
23 class CSOGroup;
24 class CSOList;
25 class CSOPredicate;
26 
28 {
29 public:
30 
34  CSOValidator(const std::vector<const CSO*> &csos);
35  CSOValidator(const CSOList &csoList);
36  CSOValidator(const CSOGroup &csoGroup);
37 
41  bool areAllCSOsClosed(CSOIdVector &violatingCSOIDs);
42 
46  bool areAllCSOsOpen(CSOIdVector &violatingCSOIDs);
47 
52 
56  bool areAllCSOsInPlane(CSOIdVector &violatingCSOIDs);
57 
62  bool areAllCSOsInSamePlane(CSOIdVector &violatingCSOIDs);
63 
68  bool areAllCSOsParallel(double epsilon);
69  bool areAllCSOsParallel(double epsilon, CSOIdVector &violatingCSOIDs);
70 
78  bool areAllCSOsParallelToPlane(const Vector3 &planeNormal, double epsilon);
79  bool areAllCSOsParallelToPlane(const Vector3 &planeNormal, double epsilon, CSOIdVector &violatingCSOIDs);
80 
84  bool areAllCSOsSatisfyingPredicate(const CSOPredicate &pred, CSOIdVector &violatingCSOIDs);
85 
87  bool hasAtMostCSOs(size_t maxNumCSOs);
88 
90  bool hasAtLeastCSOs(size_t minNumCSOs);
91 
94  bool hasAtMostCSOGroups(size_t maxNumGroups);
95 
98  bool hasAtLeastCSOGroups(size_t minNumGroups);
99 
100 private:
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 
111 ML_END_NAMESPACE
std::vector< unsigned int > CSOIdVector
Defines a vector to hold CSO and CSOGroup ids.
Definition: MLCSOIncludes.h:63
#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