#include <iostream>
#include <visp3/ustk_core/usConfig.h>
#if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)) && defined(USTK_HAVE_FFTW)
#include <QApplication>
#include <QtCore/QThread>
#include <visp3/ustk_grabber/usNetworkGrabberRF3D.h>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
std::string preCompressedDirectory, postCompressedDirectory;
if (qApp->arguments().contains(QString("--preCompressed"))) {
preCompressedDirectory =
qApp->arguments().at(qApp->arguments().indexOf(QString("--preCompressed")) + 1).toStdString();
} else {
std::cout << "You need to specify the directory to record the pre-compressed volumes with --preCompressed option\n";
throw vpException(vpException::fatalError, "No output directory specified for pre-compressed volumes !");
}
if (qApp->arguments().contains(QString("--postCompressed"))) {
postCompressedDirectory =
qApp->arguments().at(qApp->arguments().indexOf(QString("--postCompressed")) + 1).toStdString();
} else {
std::cout
<< "You need to specify the directory to record the post-compressed volumes with --postCompressed option\n";
throw vpException(vpException::fatalError, "No output directory specified for post-compressed volumes !");
}
std::cout << "Start pre-compressed volumes acquisition" << std::endl;
double t0 = vpTime::measureTimeMs();
do {
grabbedFrame = qtGrabber->
acquire();
std::cout <<
"MAIN THREAD received volume No : " << grabbedFrame->
getVolumeCount() << std::endl;
}
else {
vpTime::wait(10);
}
} while (vpTime::measureTimeMs() - t0 < 10000);
std::cout << "NOW MOVE THE PROBE DOWN TO ACQUIRE POST-COMPRESSED FRAMES (5sec before next acquisition)" << std::endl;
vpTime::wait(5000);
delete qtGrabber;
std::cout << "Start post-compressed volumes acquisition" << std::endl;
t0 = vpTime::measureTimeMs();
do {
grabbedFrame = qtGrabber->
acquire();
std::cout <<
"MAIN THREAD received volume No : " << grabbedFrame->
getVolumeCount() << std::endl;
}
else {
vpTime::wait(10);
t0 = vpTime::measureTimeMs();
}
} while (vpTime::measureTimeMs() - t0 < 10000);
return 0;
}
#else
int main()
{
std::cout << "You should intall FFTW and Qt to run this tutorial" << std::endl;
return 0;
}
#endif
@ US_ANGLE_PITCH_3
8 motor steps per frame = 1.4634 degrees
Specific class to grab RF volumes from the ultrasound station on the network.
void activateRecording(std::string path)
usVolumeGrabbedInfo< usImageRF3D< short int > > * acquire()
bool isFirstFrameAvailable()
void setFramesPerVolume(int framesPerVolume)
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
bool sendAcquisitionParameters()
void disconnectFromServer()
void setStepsPerFrame(usAcquisitionParameters::usMotorStep stepsPerFrame)
void setMotorActivation(bool activateMotor)
Class to store additionnal informations arriving on the network with ultrasound volumes grabbed,...
quint32 getVolumeCount() const