Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
Medical Imaging Interaction Toolkit
mitkVnlVectorFixedCaster.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 #ifndef mitkVnlVectorFixedCaster_h
13 #define mitkVnlVectorFixedCaster_h
14 
15 #include <vnl/vnl_vector_fixed.h>
16 #include <mitkObservable.h>
17 #include <mitkAlgorithm.h>
18 
19 namespace mitk
20 {
25  template <class T, class R, unsigned int n>
27  virtual public Algorithm
28  {
29  public:
34  const vnl_vector_fixed<T, n>* _InputVector,
35  vnl_vector_fixed<R, n>* _OutputVector):
36  m_InputVector(_InputVector),
37  m_OutputVector(_OutputVector)
38  {
39  }
43  void Update() override
44  {
45  for( size_t i=0; i<m_InputVector->size(); ++i )
46  (*m_OutputVector)[i] = static_cast<R>( (*m_InputVector)[i] );
47 
48  }
49  private:
53  const vnl_vector_fixed<T, n>* m_InputVector;
57  vnl_vector_fixed<R, n>* m_OutputVector;
58  };
59 } // namespace mitk
60 
61 #endif // mitkVnlVectorFixedCaster_h
DataCollection - Class to facilitate loading/accessing structured data.
VnlVectorFixedCaster(const vnl_vector_fixed< T, n > *_InputVector, vnl_vector_fixed< R, n > *_OutputVector)