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
#include "selxItkImageSourceFixed.h"
namespace selx
{
ItkImageSourceFixedComponent::ItkImageSourceFixedComponent()
{
this->m_Source = nullptr;
}
ItkImageSourceFixedComponent::~ItkImageSourceFixedComponent()
{
}
ItkImageSourceFixedComponent::ItkImageSourceFixedType::Pointer ItkImageSourceFixedComponent::GetItkImageSourceFixed()
{
if (this->m_Source == nullptr)
{
itkExceptionMacro("SourceComponent needs to be initialized by ConnectToOverlordSource()");
}
return this->m_Source;
}
bool ItkImageSourceFixedComponent::ConnectToOverlordSource(itk::Object::Pointer object)
{
this->m_Source = dynamic_cast<ItkImageSourceFixedType*>(object.GetPointer());
return (this->m_Source == nullptr);
}
bool ItkImageSourceFixedComponent::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;
}
}
}
return meetsCriteria;
}
} //end namespace selx