Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkCvMatFromVnlVector.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 mitkCvMatFromVnlVector_h
17 #define mitkCvMatFromVnlVector_h
18 
19 #include <mitkEndoMacros.h>
20 #include <vnl/vnl_vector.h>
21 #include <mitkCvMatFromVnlMatrix.h>
22 
23 namespace mitk
24 {
32  template <class T>
34  virtual public Algorithm
35  {
36  public:
41  const vnl_vector<T>* _VnlVector,
42  cv::Mat* _CvMat):
43  m_CvMatFromVnlMatrix(&m_VnlMatrix, _CvMat),
44  m_VnlVector(_VnlVector)
45  {
46  }
47 
51  void Update() override
52  {
53  m_VnlMatrix.set_size( m_VnlVector->size(), 1 );
54  m_VnlMatrix.set_column(0, *m_VnlVector);
55  m_CvMatFromVnlMatrix.Update();
56  }
57  private:
61  vnl_matrix<T> m_VnlMatrix;
65  mitk::CvMatFromVnlMatrix<T> m_CvMatFromVnlMatrix;
69  const vnl_vector<T>* m_VnlVector;
70  };
71 } // namespace mitk
72 
73 #endif // mitkCvMatFromVnlVector_h
DataCollection - Class to facilitate loading/accessing structured data.
CvMatFromVnlVector(const vnl_vector< T > *_VnlVector, cv::Mat *_CvMat)