UsTK : Ultrasound ToolKit  version 2.0.1 under development (2025-02-01)
tutorial-elastography-2D-basic.cpp
1 
3 #include <iostream>
4 #include <visp3/ustk_core/usConfig.h>
5 
6 #if defined(USTK_HAVE_FFTW)
7 
8 #include <visp3/ustk_elastography/usElastography.h>
9 
10 #include <visp3/io/vpImageIo.h>
11 #include <visp3/ustk_core/usImageIo.h>
12 
13 int main()
14 {
15 
16  // prepare image;
17  usImageRF2D<short int> preComp;
18  usImageRF2D<short int> postComp;
19 
20  std::string image1 = us::getDataSetPath() + std::string("/RFElasto/image00012.mhd");
21  std::string image2 = us::getDataSetPath() + std::string("/RFElasto/image00015.mhd");
22 
23  usImageIo::read(preComp, image1.c_str());
24  usImageIo::read(postComp, image2.c_str());
25 
26  usElastography elastography(preComp, postComp);
27  elastography.setDecimationFactor(1);
28  elastography.setROI(40, 2500, 50, 500);
29 
30  // computate elasto
31  vpImage<unsigned char> strainImage;
32  strainImage = elastography.run();
33 
34  vpImageIo::write(strainImage, "outputElasto.png");
35 
36  return 0;
37 }
38 
39 #else
40 int main()
41 {
42  std::cout << "You should intall FFTW to run this tutorial" << std::endl;
43  return 0;
44 }
45 
46 #endif
Computation of a strain map using two sucessive RF images acquired at different compressions of the p...
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
Definition: usImageIo.cpp:153
VISP_EXPORT std::string getDataSetPath()
Definition: us.cpp:54