1 #include <visp3/ustk_core/usConfig.h>
5 #include <visp3/core/vpTime.h>
6 #include <visp3/ustk_core/usImageIo.h>
7 #include <visp3/ustk_core/usRFToPostScan2DConverter.h>
9 int main(
int argc,
char **argv)
13 for (
int i = 0; i < argc; i++) {
14 if (std::string(argv[i]) ==
"--input")
15 filename = std::string(argv[i + 1]);
16 else if (std::string(argv[i]) ==
"--help") {
17 std::cout <<
"\nUsage: " << argv[0] <<
" [--input <RF2D.rf> | <RF2D.mhd>] [--help]\n" << std::endl;
23 if (filename.empty()) {
25 if (!env_ipath.empty())
26 filename = env_ipath +
"/RFElasto/image00010.mhd";
28 std::cout <<
"You should set USTK_DATASET_PATH environment var to access to ustk dataset" << std::endl;
40 std::cout <<
"end reading" << std::endl;
45 double startTime = vpTime::measureTimeMs();
46 std::cout <<
"init converter..." << std::endl;
48 double endInitTime = vpTime::measureTimeMs();
49 std::cout <<
"init time (sec) = " << (endInitTime - startTime) / 1000.0 << std::endl;
51 std::cout <<
"converting..." << std::endl;
52 converter.
convert(rfImage, prescanImage);
54 std::cout << prescanImage;
56 double endConvertTime = vpTime::measureTimeMs();
57 std::cout <<
"convert time (sec) = " << (endConvertTime - endInitTime) / 1000.0 << std::endl;
59 std::cout <<
"writing pre-scan..." << std::endl;
60 std::string outFileName =
"prescan.xml";
70 std::cout <<
"You should install FFTW library to run this tutorial" << std::endl;
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
static void write(const usImageRF2D< short > &rfImage, const std::string &headerFileName, const std::string &imageExtension2D)
2D conversion from RF signal to pre-scan image
void convert(const usImageRF2D< short int > &rfImage, usImagePreScan2D< unsigned char > &preScanImage)
VISP_EXPORT std::string getDataSetPath()