Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "selxItkImageSourceMoving.h"
namespace selx
{
template<int Dimensionality, class TPixel>
ItkImageSourceMovingComponent< Dimensionality, TPixel>::ItkImageSourceMovingComponent()
{
this->m_Source = nullptr;
}
template<int Dimensionality, class TPixel>
ItkImageSourceMovingComponent< Dimensionality, TPixel>::~ItkImageSourceMovingComponent()
{
}
template<int Dimensionality, class TPixel>
typename ItkImageSourceMovingComponent< Dimensionality, TPixel>::ItkImageSourceMovingType::Pointer ItkImageSourceMovingComponent< Dimensionality, TPixel>::GetItkImageSourceMoving()
{
if (this->m_Source == nullptr)
{
itkExceptionMacro("SourceComponent needs to be initialized by ConnectToOverlordSource()");
}
return this->m_Source;
}
template<int Dimensionality, class TPixel>
bool ItkImageSourceMovingComponent< Dimensionality, TPixel>::ConnectToOverlordSource(itk::Object::Pointer object)
{
this->m_Source = dynamic_cast<ItkImageSourceMovingType*>(object.GetPointer());
return (this->m_Source == nullptr);
}
template<int Dimensionality, class TPixel>
bool ItkImageSourceMovingComponent< Dimensionality, TPixel>::MeetsCriterion(const CriterionType &criterion)
{
bool hasUndefinedCriteria(false);
bool meetsCriteria(false);
if (criterion.first == "ComponentProperty")
{
meetsCriteria = true;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
{
if (criterionValue != "SomeProperty") // e.g. "GradientDescent", "SupportsSparseSamples
{
meetsCriteria = false;
}
}
}
else if (criterion.first == "Dimensionality") //Supports this?
{
meetsCriteria = true;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
{
if (std::stoi(criterionValue) != Self::Dimensionality)
{
meetsCriteria = false;
}
}
}
else if (criterion.first == "PixelType") //Supports this?
{
meetsCriteria = true;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
{
if (criterionValue != Self::GetPixelTypeNameString())
{
meetsCriteria = false;
}
}
}
return meetsCriteria;
}
} //end namespace selx