Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkIndexedValueFunctorPolicy.cpp
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 
15 
17 {};
18 
20 {};
21 
23 {
24  unsigned int result = 0;
25 
26  if (m_Functor.IsNotNull())
27  {
28  result = m_Functor->GetNumberOfOutputs();
29  }
30 
31  return result;
32 }
33 
35 {
36  if (!functor)
37  {
38  itkGenericExceptionMacro(<< "Error. Functor is Null.");
39  }
40 
41  m_Functor = functor;
42 }
43 
44 
46 {
47  return !(*this == other);
48 }
49 
51 {
52  return (this->m_Functor == other.m_Functor);
53 }
54 
56 {
57  if (!m_Functor)
58  {
59  itkGenericExceptionMacro(<< "Error. Cannot process operator(). Functor is Null.");
60  }
61 
62  OutputPixelVectorType result = m_Functor->Compute(value, currentIndex);
63 
64  return result;
65 }
bool operator!=(const IndexedValueFunctorPolicy &other) const
FunctorType::InputPixelVectorType InputPixelVectorType
FunctorType::OutputPixelVectorType OutputPixelVectorType
OutputPixelVectorType operator()(const InputPixelVectorType &value, const IndexType &currentIndex) const
bool operator==(const IndexedValueFunctorPolicy &other) const
void SetFunctor(const FunctorType *functor)