-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusRFToPostScan3DConverterSample.cpp
68 lines (64 loc) · 2.3 KB
/
usRFToPostScan3DConverterSample.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/****************************************************************************
*
* This file is part of the UsTk software.
* Copyright (C) 2014 by Inria. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License ("GPL") as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* See the file COPYING at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* This software was developed at:
* INRIA Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
* http://www.irisa.fr/lagadic
*
* If you have questions regarding the use of this file, please contact the
* authors at [email protected]
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* Authors:
* Marc Pouliquen
*
*****************************************************************************/
#include <visp3/ustk_core/usRFToPostScan3DConverter.h>
#include <visp3/ustk_core/usImage3D.h>
#include <visp3/ustk_core/usImageRF3D.h>
#include <visp3/ustk_core/usImagePostScan3D.h>
int main()
{
#if defined(USTK_HAVE_FFTW)
// 2D post-scan image settings
unsigned int width = 320;
unsigned int height = 240;
unsigned int frames = 10;
double transducerRadius = 0.045;
double scanLinePitch = 0.0012;
unsigned int scanLineNumber = 256;
bool isTransducerConvex = true;
double axialResolution = 0.002;
double framePitch = 0.002;
double motorRadius = 0.04;
usImage3D<short int> I(height, width,frames);
usImageRF3D<short int> rfImage; // to fill (image + settings)
rfImage.setTransducerRadius(transducerRadius);
rfImage.setScanLinePitch(scanLinePitch);
rfImage.setScanLineNumber(scanLineNumber);
rfImage.setTransducerConvexity(isTransducerConvex);
rfImage.setAxialResolution(axialResolution);
rfImage.setMotorRadius(motorRadius);
rfImage.setMotorType(usMotorSettings::TiltingMotor);
rfImage.setFramePitch(framePitch);
usImagePostScan3D<unsigned char> postscanImage; // output
usRFToPostScan3DConverter converter;
converter.convert(rfImage,postscanImage);
#endif
return 0;
}