1 #include <visp3/ustk_core/usConfig.h>
3 #ifdef USTK_HAVE_VTK_QT
5 #include <visp3/ustk_core/us.h>
6 #include <visp3/ustk_core/usImageIo.h>
7 #include <visp3/ustk_core/usImagePostScan3D.h>
8 #include <visp3/ustk_gui/us2DSceneWidget.h>
9 #include <visp3/ustk_gui/usVTKConverter.h>
10 #include <vtkMetaImageReader.h>
12 int main(
int argc,
char **argv)
14 std::string mhd_filename;
16 for (
int i = 0; i < argc; i++) {
17 if (std::string(argv[i]) ==
"--input")
18 mhd_filename = std::string(argv[i + 1]);
19 else if (std::string(argv[i]) ==
"--help") {
20 std::cout <<
"\nUsage: " << argv[0] <<
" [--input <preScan3D.xml>] [--help]\n" << std::endl;
26 if (mhd_filename.empty()) {
28 if (!env_ipath.empty())
29 mhd_filename = env_ipath +
"/post-scan/3D_mhd/volume.mhd";
31 std::cout <<
"You should set USTK_DATASET_PATH environment var to access to ustk dataset" << std::endl;
36 QApplication app(argc, argv);
42 vtkSmartPointer<vtkImageData> vtkImage = vtkSmartPointer<vtkImageData>::New();
46 vtkImage->GetDimensions(dims);
48 vtkImage->GetSpacing(spacing);
51 vpHomogeneousMatrix mat;
53 mat.buildFrom(0, 0, 0, 0, 0, 0);
55 vtkMatrix4x4 *vtkMat = vtkMatrix4x4::New();
66 scene->
drawLine(0, 0, 0, 0.1, 0.0, 0.0);
74 int main() { std::cout <<
"Install vtk with qt4 or qt5 support to run this tutorial." << std::endl; }
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
static void convert(const usImagePostScan3D< unsigned char > &postScanImage, vtkSmartPointer< vtkImageData > &vtkPostScanImage, vtkSmartPointer< vtkImageImport > importer=NULL)
VISP_EXPORT std::string getDataSetPath()