Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
Markov
otbMRFEnergyPotts.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: ORFEO Toolbox
4
Language: C++
5
Date: $Date$
6
Version: $Revision$
7
8
9
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10
See OTBCopyright.txt for details.
11
12
13
This software is distributed WITHOUT ANY WARRANTY; without even
14
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
PURPOSE. See the above copyright notices for more information.
16
17
=========================================================================*/
18
19
#ifndef __otbMRFEnergyPotts_h
20
#define __otbMRFEnergyPotts_h
21
22
#include "
otbMRFEnergy.h
"
23
24
namespace
otb
25
{
44
template
<
class
TInput1,
class
TInput2>
45
class
ITK_EXPORT
MRFEnergyPotts
:
public
MRFEnergy
<TInput1, TInput2>
46
{
47
public
:
48
typedef
MRFEnergyPotts
Self
;
49
typedef
MRFEnergy<TInput1, TInput2>
Superclass
;
50
typedef
itk::SmartPointer<Self>
Pointer
;
51
typedef
itk::SmartPointer<const Self>
ConstPointer
;
52
53
typedef
TInput1
InputImageType
;
54
typedef
TInput2
LabelledImageType
;
55
typedef
typename
InputImageType::PixelType
InputImagePixelType
;
56
typedef
typename
LabelledImageType::PixelType
LabelledImagePixelType
;
57
58
typedef
itk::Array<double>
ParametersType
;
59
60
itkTypeMacro(
MRFEnergyPotts
,
MRFEnergy
);
61
62
itkNewMacro(
Self
);
63
64
double
GetSingleValue(
const
InputImagePixelType
& value1,
const
LabelledImagePixelType
& value2)
65
{
66
if
(value1 != value2)
67
{
68
return
this->m_Parameters[0];
69
}
70
else
71
{
72
return
-this->m_Parameters[0];
73
}
74
}
75
76
protected
:
77
// The constructor and destructor.
78
MRFEnergyPotts
()
79
{
80
this->m_NumberOfParameters = 1;
81
this->m_Parameters.SetSize(this->m_NumberOfParameters);
82
this->m_Parameters[0] = 1.0;
83
};
84
virtual
~MRFEnergyPotts
() {}
85
86
};
87
}
88
89
#endif
Generated at Sun Feb 3 2013 00:38:19 for
Orfeo Toolbox
with
doxygen 1.8.1.1