UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usElastography.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Authors:
29  * Pedro Patlan Rosales
30  * Marc Pouliquen
31  *
32  *****************************************************************************/
33 
34 #ifndef __usElastography_h_
35 #define __usElastography_h_
36 
41 #include <visp3/ustk_core/usConfig.h>
42 
43 #if defined(USTK_HAVE_FFTW)
44 
45 #include <visp3/core/vpImageTools.h>
46 
47 #include <visp3/ustk_core/usImageRF2D.h>
48 #include <visp3/ustk_elastography/usConvolution2d.h>
49 #include <visp3/ustk_elastography/usMotionEstimation.h>
50 #include <visp3/ustk_elastography/usSignalProcessing.h>
51 
64 class VISP_EXPORT usElastography
65 {
66 public:
67  enum MotionEstimator { OF, BMA_TAYLOR };
70  virtual ~usElastography();
71 
72  double getFPS(void) { return m_FPS; }
73  double getSamplingFrequency(void) { return m_samplingFrequency; }
74 
75  vpImage<unsigned char> run();
76 
77  void setDecimationFactor(unsigned int decimationFactor) { m_decimationFactor = decimationFactor; }
78  void setFPS(double fps);
79  void setSamplingFrequency(double samplingFrequency);
80  void setLSQpercentage(double per);
81  void setMotionEstimator(MotionEstimator t_mest) { m_mEstimatior = t_mest; }
82  void setPostCompression(const usImageRF2D<short> &Post);
83  void setPreCompression(const usImageRF2D<short> &Pre);
84  void setROI(int tx, int ty, int tw, int th);
85 
86  void updateRF(const usImageRF2D<short int> &image);
87  void updateROIPos(int tx, int ty);
88 
89 private:
90  usImageRF2D<short int> usImageRF_ROI(const usImageRF2D<short int> &M, uint r, uint c, uint nrows, uint ncols);
91 
92  vpImage<unsigned char> m_StrainMap;
93  usImageRF2D<short int> m_Precomp;
94  usImageRF2D<short int> m_Postcomp;
95 
96  double m_Lsqper;
97  bool m_isloadPre;
98  bool m_isloadPost;
99  double m_FPS;
100  double m_samplingFrequency;
101  double m_c;
102  double m_min_str;
103  double m_max_str;
104  double m_max_abs;
105  int m_h_m;
106  int m_w_m;
107 
108  int m_ix;
109  int m_iy;
110  int m_rw;
111  int m_rh;
112  bool m_setROI;
113  usImageRF2D<short int> m_PreROI;
114  usImageRF2D<short int> m_PostROI;
115 
116  std::vector<usConvolution2d *> cC;
117 
118  // Motion estimation
119  MotionEstimator m_mEstimatior;
120 
121 #if defined(USTK_HAVE_ARMADILLO) && (ARMA_VERSION_MAJOR > 6) && (ARMA_VERSION_MAJOR > 700)
122  usMotionEstimation m_ME;
123 #endif
124 
125  vpMatrix U;
126  vpMatrix V;
127 
128  unsigned int m_decimationFactor;
129 };
130 
131 #endif // FFTW
132 #endif // __usElastography_h_
Computation of a strain map using two sucessive RF images acquired at different compressions of the p...
double getSamplingFrequency(void)
double getFPS(void)
void setDecimationFactor(unsigned int decimationFactor)
void setMotionEstimator(MotionEstimator t_mest)