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/usRFToPostScan3DConverter.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 <RF3D.mhd>] [--help]\n" << std::endl;
23 if (filename.empty()) {
25 if (!env_ipath.empty())
26 filename = env_ipath +
"/RFElasto3D/preCompressed/image00000.mhd";
28 std::cout <<
"You should set USTK_DATASET_PATH environment var to access to ustk dataset" << std::endl;
39 std::cout <<
"end reading" << std::endl;
44 double startTime = vpTime::measureTimeMs();
45 std::cout <<
"init converter..." << std::endl;
47 double endInitTime = vpTime::measureTimeMs();
48 std::cout <<
"init time (sec) = " << (endInitTime - startTime) / 1000.0 << std::endl;
50 std::cout <<
"converting..." << std::endl;
51 converter.
convert(rfImage, prescanImage);
53 std::cout << prescanImage;
55 double endConvertTime = vpTime::measureTimeMs();
56 std::cout <<
"convert time (sec) = " << (endConvertTime - endInitTime) / 1000.0 << std::endl;
58 std::cout <<
"writing pre-scan : pre-scan.mhd in current folder" << std::endl;
59 std::string outFileName =
"prescan.mhd";
69 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)
3D conversion from RF signal to pre-scan image
void convert(const usImageRF3D< short int > &rfImage, usImagePreScan3D< unsigned char > &preScanImage)
VISP_EXPORT std::string getDataSetPath()