UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-11-21)
tutorial-ultrasonix-qt-grabbing-RF3D.cpp
#include <iostream>
#include <visp3/ustk_core/usConfig.h>
#if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && \
defined(USTK_HAVE_FFTW)
#include <QApplication>
#include <QtCore/QThread>
#include <visp3/ustk_core/usImageIo.h>
#include <visp3/ustk_core/usRFToPreScan3DConverter.h>
#include <visp3/ustk_grabber/usNetworkGrabberRF3D.h>
int main(int argc, char **argv)
{
// QT application
QApplication app(argc, argv);
qtGrabber->connectToServer();
// qtGrabber->setVerbose(true);
// setting acquisition parameters
header.probeId = 15; // 4DC7 id = 15
header.slotId = 0; // top slot id = 0
header.imagingMode = 12; // B-mode = 0, RF = 12
// prepare image;
// prepare converter
bool captureRunning = true;
// sending acquisition parameters
qtGrabber->initAcquisition(header);
qtGrabber->setFramesPerVolume(25);
qtGrabber->setMotorActivation(true);
qtGrabber->runAcquisition();
std::cout << "waiting ultrasound initialisation..." << std::endl;
// our local grabbing loop
do {
grabbedVolume = qtGrabber->acquire();
std::cout << "MAIN THREAD received volume No : " << grabbedVolume->getVolumeCount() << std::endl;
// convert RF to pre-scan to save the image
converter.convert(*grabbedVolume, preScanImage);
QString filename = QString("volume") + QString::number(grabbedVolume->getVolumeCount()) + QString(".mhd");
usImageIo::write(preScanImage, filename.toStdString());
} while (captureRunning);
qtGrabber->stopAcquisition();
return 0;
}
#else
int main()
{
std::cout << "You should intall Qt5 (with wigdets and network modules), FFTW and GDI or X11 to run this tutorial"
<< std::endl;
return 0;
}
#endif
@ US_ANGLE_PITCH_3
8 motor steps per frame = 1.4634 degrees
static void write(const usImageRF2D< short > &rfImage, const std::string &headerFileName, const std::string &imageExtension2D)
Definition: usImageIo.cpp:104
Specific class to grab RF volumes from the ultrasound station on the network.
usVolumeGrabbedInfo< usImageRF3D< short int > > * acquire()
void setFramesPerVolume(int framesPerVolume)
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
void setStepsPerFrame(usAcquisitionParameters::usMotorStep stepsPerFrame)
void setMotorActivation(bool activateMotor)
3D conversion from RF signal to pre-scan image
void convert(const usImageRF3D< short int > &rfImage, usImagePreScan3D< unsigned char > &preScanImage)
Class to store additionnal informations arriving on the network with ultrasound volumes grabbed,...
quint32 getVolumeCount() const