Medical Imaging Interaction Toolkit
2024.12.99-d991a09f
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Groups
Namespace List
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Variables
e
f
i
l
m
n
p
r
s
t
Typedefs
a
b
c
d
f
g
i
l
m
n
o
p
q
r
s
t
v
x
Enumerations
Enumerator
a
b
c
d
e
g
h
i
k
l
n
o
p
r
s
t
v
w
z
Class List
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
c
m
o
r
s
t
Related Functions
File List
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
m
o
p
q
r
s
t
u
v
x
Functions
_
e
h
m
o
q
s
u
Variables
Typedefs
Enumerations
Enumerator
Macros
_
a
b
c
d
e
f
g
i
m
o
p
q
r
s
u
v
x
Examples
Download
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
mitkEqual.h
Go to the documentation of this file.
1
/*============================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center (DKFZ)
6
All rights reserved.
7
8
Use of this source code is governed by a 3-clause BSD license that can be
9
found in the LICENSE file.
10
11
============================================================================*/
12
13
#ifndef mitkEqual_h
14
#define mitkEqual_h
15
16
#include <cmath>
17
#include <iomanip>
18
19
#include "
mitkLog.h
"
20
#include "
mitkNumericConstants.h
"
21
22
namespace
mitk
23
{
31
template
<
typename
DifferenceType>
32
inline
bool
DifferenceBiggerOrEqualEps
(DifferenceType diff,
mitk::ScalarType
epsilon =
mitk::eps
)
33
{
34
return
std::fabs(diff) >= epsilon;
35
}
36
47
template
<
typename
ElementToOutput1,
typename
ElementToOutput2>
48
inline
void
ConditionalOutputOfDifference
(
49
ElementToOutput1 elem1, ElementToOutput2 elem2,
mitk::ScalarType
eps
,
bool
verbose,
bool
isEqual)
50
{
51
if
(verbose && !isEqual)
52
{
53
MITK_INFO
<<
typeid
(ElementToOutput1).name() <<
" and "
<<
typeid
(ElementToOutput2).name()
54
<<
" not equal. Lefthandside "
<< std::setprecision(12) << elem1 <<
" - Righthandside "
<< elem2
55
<<
" - epsilon "
<<
eps
;
56
}
57
}
58
68
inline
bool
Equal
(
ScalarType
scalar1,
ScalarType
scalar2,
ScalarType
eps
=
mitk::eps
,
bool
verbose =
false
)
69
{
70
bool
isEqual(!
DifferenceBiggerOrEqualEps
(scalar1 - scalar2,
eps
));
71
72
ConditionalOutputOfDifference
(scalar1, scalar2,
eps
, verbose, isEqual);
73
74
return
isEqual;
75
}
76
}
77
78
#endif
mitk::eps
const MITKCORE_EXPORT ScalarType eps
MITK_INFO
#define MITK_INFO
Definition:
mitkLog.h:209
mitk::Equal
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
mitk
Find image slices visible on a given plane.
Definition:
RenderingTests.dox:1
mitkLog.h
mitkNumericConstants.h
mitk::DifferenceBiggerOrEqualEps
bool DifferenceBiggerOrEqualEps(DifferenceType diff, mitk::ScalarType epsilon=mitk::eps)
Definition:
mitkEqual.h:32
mitk::ConditionalOutputOfDifference
void ConditionalOutputOfDifference(ElementToOutput1 elem1, ElementToOutput2 elem2, mitk::ScalarType eps, bool verbose, bool isEqual)
Definition:
mitkEqual.h:48
mitk::ScalarType
double ScalarType
Definition:
mitkNumericConstants.h:20
src
MITK
Modules
Core
include
mitkEqual.h
Generated on Sat Mar 22 2025 02:15:01 for Medical Imaging Interaction Toolkit by
1.8.17