Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef mitkVnlVectorFixedCaster_h
17 #define mitkVnlVectorFixedCaster_h
18 
19 #include <vnl/vnl_vector_fixed.h>
20 #include <mitkObservable.h>
21 #include <mitkAlgorithm.h>
22 
23 namespace mitk
24 {
29  template <class T, class R, unsigned int n>
31  virtual public Algorithm
32  {
33  public:
38  const vnl_vector_fixed<T, n>* _InputVector,
39  vnl_vector_fixed<R, n>* _OutputVector):
40  m_InputVector(_InputVector),
41  m_OutputVector(_OutputVector)
42  {
43  }
47  void Update() override
48  {
49  for( size_t i=0; i<m_InputVector->size(); ++i )
50  (*m_OutputVector)[i] = static_cast<R>( (*m_InputVector)[i] );
51 
52  }
53  private:
57  const vnl_vector_fixed<T, n>* m_InputVector;
61  vnl_vector_fixed<R, n>* m_OutputVector;
62  };
63 } // namespace mitk
64 
65 #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)