MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkVnlVectorCaster.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12#ifndef mitkVnlVectorCaster_h
13#define mitkVnlVectorCaster_h
14
15#include <vnl/vnl_vector.h>
16#include <mitkObservable.h>
17#include <mitkAlgorithm.h>
18
19namespace mitk
20{
25 template <class T, class R>
27 virtual public Algorithm
28 {
29 public:
34 const vnl_vector<T>* _InputVector,
35 vnl_vector<R>* _OutputVector):
36 m_InputVector(_InputVector),
37 m_OutputVector(_OutputVector)
38 {
39 }
40
44 static void Update(
45 const vnl_vector<T>& _InputVector,
46 vnl_vector<R>& _OutputVector)
47 {
48 for( size_t i=0; i<_InputVector.size(); ++i )
49 _OutputVector[i] = static_cast<R>( _InputVector[i] );
50 }
51
55 void Update()
56 {
57 Update( *m_InputVector, *m_OutputVector );
58 }
59 private:
63 const vnl_vector<T>* m_InputVector;
67 vnl_vector<R>* m_OutputVector;
68 };
69} // namespace mitk
70
71#endif
VnlVectorCaster(const vnl_vector< T > *_InputVector, vnl_vector< R > *_OutputVector)
static void Update(const vnl_vector< T > &_InputVector, vnl_vector< R > &_OutputVector)
IGT Exceptions.