MeVisLab Toolbox Reference
mlComputeClusters.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2014, 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
#ifndef ML_COMPUTE_CLUSTERS_H
14
#define ML_COMPUTE_CLUSTERS_H
15
16
#include "
MLClusterAlgorithmSystem.h
"
17
18
#include "
mlClusterAlgorithm.h
"
19
#include "
mlIdenticalIntensitiesClusterAlgorithm.h
"
20
#include "
mlSimilarIntensitiesClusterAlgorithm.h
"
21
#include "
mlSimilarVectorDirectionsClusterAlgorithm.h
"
22
23
#include <
mlModuleIncludes.h
>
24
25
26
ML_START_NAMESPACE
27
28
class
Clusters;
29
class
ComputeClusters;
30
32
class
TypedComputeClusters
33
{
34
public
:
35
36
TypedComputeClusters
(
ComputeClusters
*
computer
,
Clusters
* clusters);
37
38
MLErrorCode
getErrorCode
()
const
{
return
_errorCode; }
39
40
template
<
class
DataType>
void
process
()
41
{
42
if
(_parameters.contentImage)
43
{
44
switch
(_parameters.clusterMode)
45
{
46
case
CLUSTER_MODE_VectorDirections
:
47
{
48
SimilarVectorDirectionsClusterAlgorithm
algorithm
(_parameters, _clusters);
49
_errorCode =
algorithm
.runClustering();
50
}
51
break
;
52
case
CLUSTER_MODE_IdenticalIntensities
:
53
{
54
IdenticalIntensitiesClusterAlgorithm<DataType>
algorithm
(_parameters, _clusters);
55
_errorCode =
algorithm
.runClustering();
56
}
57
break
;
58
case
CLUSTER_MODE_SimilarIntensities
:
59
{
60
SimilarIntensitiesClusterAlgorithm<DataType>
algorithm
(_parameters, _clusters);
61
_errorCode =
algorithm
.runClustering();
62
}
63
break
;
64
case
CLUSTER_MODE_COUNT
:
65
default
:
66
mlError
(
"ComputeClusters::computeClusters"
,
ML_BAD_PARAMETER
);
67
_errorCode =
ML_BAD_PARAMETER
;
68
}
69
}
70
}
71
72
private
:
73
Clusters
* _clusters;
74
ComputeClusterParameters
_parameters;
75
MLErrorCode
_errorCode;
76
};
77
80
class
MLCLUSTERALGORITHM_EXPORT
ComputeClusters
81
{
82
public
:
83
85
ComputeClusters
();
86
87
void
setClusterMode
(
CLUSTER_MODE_TYPE
clusterMode) { _parameters.clusterMode = clusterMode; }
88
void
setSimilarityToleranceIntensities
(
MLdouble
similarityTolerance
) { _parameters.similarityToleranceIntensities =
similarityTolerance
; }
89
void
setSimilarityToleranceVectors
(
MLdouble
similarityTolerance
) { _parameters.similarityToleranceVectors =
similarityTolerance
; }
90
void
setUseBackgroundValue
(
bool
useBackgroundValue) { _parameters.useBackgroundValue = useBackgroundValue; }
91
void
setBackgroundValue
(
MLdouble
backgroundValue) { _parameters.backgroundValue = backgroundValue; }
92
void
setNeighborhoodRelation
(
NBH_TYPE
neighborhoodRelation) { _parameters.neighborhoodRelation = neighborhoodRelation; }
93
void
setContentImage
(
PagedImage
* contentImage) { _parameters.contentImage = contentImage; }
94
void
setMaskImage
(
PagedImage
* maskImage) { _parameters.maskImage = maskImage; }
95
void
setUseImageValueAsUserData
(
bool
useImageValueAsUserData) { _parameters.useImageValueAsUserData = useImageValueAsUserData; }
96
void
setProgressCB
(
MLRequestProgressCB
* cb,
void
* userData) { _parameters.progressCB = cb; _parameters.progressCBUserData = userData; }
97
98
void
ensureClusterModeForImageDataType
();
99
101
MLErrorCode
computeClusters
(
Clusters
* clusters);
103
104
private
:
105
106
ComputeClusterParameters
_parameters;
107
108
friend
class
TypedComputeClusters
;
109
};
110
111
ML_END_NAMESPACE
112
113
#endif
// __mlComputeClusters_H
MLClusterAlgorithmSystem.h
MLCLUSTERALGORITHM_EXPORT
#define MLCLUSTERALGORITHM_EXPORT
Definition
MLClusterAlgorithmSystem.h:24
CLUSTER_MODE_TYPE
CLUSTER_MODE_TYPE
Definition
MLClusterAlgorithmSystem.h:33
CLUSTER_MODE_IdenticalIntensities
@ CLUSTER_MODE_IdenticalIntensities
Definition
MLClusterAlgorithmSystem.h:34
CLUSTER_MODE_VectorDirections
@ CLUSTER_MODE_VectorDirections
Definition
MLClusterAlgorithmSystem.h:36
CLUSTER_MODE_SimilarIntensities
@ CLUSTER_MODE_SimilarIntensities
Definition
MLClusterAlgorithmSystem.h:35
CLUSTER_MODE_COUNT
@ CLUSTER_MODE_COUNT
Definition
MLClusterAlgorithmSystem.h:38
NBH_TYPE
NBH_TYPE
Definition
MLClusterAlgorithmSystem.h:43
ml::Clusters
Structure computes and holds all cluster information. For internal use.
Definition
mlClusters.h:29
ml::ComputeClusters
Computes the clusters.
Definition
mlComputeClusters.h:81
ml::ComputeClusters::setUseBackgroundValue
void setUseBackgroundValue(bool useBackgroundValue)
Definition
mlComputeClusters.h:90
ml::ComputeClusters::setSimilarityToleranceIntensities
void setSimilarityToleranceIntensities(MLdouble similarityTolerance)
Definition
mlComputeClusters.h:88
ml::ComputeClusters::setClusterMode
void setClusterMode(CLUSTER_MODE_TYPE clusterMode)
Definition
mlComputeClusters.h:87
ml::ComputeClusters::setNeighborhoodRelation
void setNeighborhoodRelation(NBH_TYPE neighborhoodRelation)
Definition
mlComputeClusters.h:92
ml::ComputeClusters::setMaskImage
void setMaskImage(PagedImage *maskImage)
Definition
mlComputeClusters.h:94
ml::ComputeClusters::setProgressCB
void setProgressCB(MLRequestProgressCB *cb, void *userData)
Definition
mlComputeClusters.h:96
ml::ComputeClusters::setSimilarityToleranceVectors
void setSimilarityToleranceVectors(MLdouble similarityTolerance)
Definition
mlComputeClusters.h:89
ml::ComputeClusters::ComputeClusters
ComputeClusters()
ml::ComputeClusters::setBackgroundValue
void setBackgroundValue(MLdouble backgroundValue)
Definition
mlComputeClusters.h:91
ml::ComputeClusters::setContentImage
void setContentImage(PagedImage *contentImage)
Definition
mlComputeClusters.h:93
ml::ComputeClusters::computeClusters
MLErrorCode computeClusters(Clusters *clusters)
Computes the actual clusters and fills the given structure on base of the set parameters.
ml::ComputeClusters::ensureClusterModeForImageDataType
void ensureClusterModeForImageDataType()
ml::ComputeClusters::setUseImageValueAsUserData
void setUseImageValueAsUserData(bool useImageValueAsUserData)
Definition
mlComputeClusters.h:95
ml::IdenticalIntensitiesClusterAlgorithm
Implementation of a clustering algorithm checking for identical image intensity values.
Definition
mlIdenticalIntensitiesClusterAlgorithm.h:31
ml::PagedImage
Class which represents an image, which manages properties of an image and image data which is located...
Definition
mlPagedImage.h:66
ml::SimilarIntensitiesClusterAlgorithm
Implementation of a SimilarIntensities clustering algorithm.
Definition
mlSimilarIntensitiesClusterAlgorithm.h:31
ml::SimilarVectorDirectionsClusterAlgorithm
Implementation of a clustering algorithm for vector data types.
Definition
mlSimilarVectorDirectionsClusterAlgorithm.h:31
ml::TypedComputeClusters
Definition
mlComputeClusters.h:33
ml::TypedComputeClusters::process
void process()
Definition
mlComputeClusters.h:40
ml::TypedComputeClusters::TypedComputeClusters
TypedComputeClusters(ComputeClusters *computer, Clusters *clusters)
ml::TypedComputeClusters::getErrorCode
MLErrorCode getErrorCode() const
Definition
mlComputeClusters.h:38
ML_BAD_PARAMETER
#define ML_BAD_PARAMETER
A bad/invalid parameter (or even an inappropriate image) has been passed to a module or an algorithm;...
Definition
mlTypeDefs.h:823
MLErrorCode
MLint32 MLErrorCode
Type of an ML Error code.
Definition
mlTypeDefs.h:716
mlError
#define mlError(FUNCTION,...)
Logs an error for FUNCTION with optional MLErrorCode.
Definition
mlLogging.h:52
mlClusterAlgorithm.h
mlIdenticalIntensitiesClusterAlgorithm.h
mlModuleIncludes.h
mlrange_cast
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Definition
mlRangeCasts.h:332
mlSimilarIntensitiesClusterAlgorithm.h
mlSimilarVectorDirectionsClusterAlgorithm.h
MLRequestProgressCB
void MLRequestProgressCB(void *usrData, double progress)
Definition
mlTypeDefs.h:1202
MLdouble
double MLdouble
Definition
mlTypeDefs.h:217
ml::ComputeClusterParameters
Structure to hold parameters for cluster computation.
Definition
mlClusterAlgorithm.h:31
MeVisLab
Standard
Sources
Shared
MLClusterAlgorithm
mlComputeClusters.h
Generated by
1.10.0