18 #include "PlusConfigure.h" 19 #include "vtkCallbackCommand.h" 20 #include "vtkImageData.h" 23 #include "vtkIGSIOTrackedFrameList.h" 24 #include "vtkXMLUtilities.h" 25 #include "vtksys/CommandLineArguments.hxx" 30 int main(
int argc,
char* argv[])
32 bool printHelp(
false);
33 std::string inputConfigFileName;
34 std::string inputPhilipsIp;
36 vtksys::CommandLineArguments args;
37 args.Initialize(argc, argv);
39 int verboseLevel = vtkPlusLogger::LOG_LEVEL_UNDEFINED;
41 args.AddArgument(
"--help", vtksys::CommandLineArguments::NO_ARGUMENT, &printHelp,
"Print this help.");
42 args.AddArgument(
"--config-file", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &inputConfigFileName,
"Config file containing the device configuration.");
43 args.AddArgument(
"--philips-ip", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &inputPhilipsIp,
"IP address of the Philips scanner (overrides the IP address parameter defined in the config file).");
44 args.AddArgument(
"--verbose", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &verboseLevel,
"Verbose level 1=error only, 2=warning, 3=info, 4=debug, 5=trace)");
48 std::cerr <<
"Problem parsing arguments" << std::endl;
49 std::cout <<
"\n\nvtkPlusPhilips3DProbeVideoSourceTest1 help:" << args.GetHelp() << std::endl;
57 std::cout <<
"\n\nvtkPlusPhilips3DProbeVideoSourceTest1 help:" << args.GetHelp() << std::endl;
62 LOG_DEBUG(
"Reading config file...");
63 vtkSmartPointer<vtkXMLDataElement> configRootElement = vtkSmartPointer<vtkXMLDataElement>::New();
66 LOG_ERROR(
"Unable to read configuration from file " << inputConfigFileName.c_str());
70 vtkSmartPointer<vtkPlusPhilips3DProbeVideoSource> philipsDevice = vtkSmartPointer<vtkPlusPhilips3DProbeVideoSource>::New();
71 philipsDevice->SetDeviceId(
"VideoDevice");
72 philipsDevice->ReadConfiguration(configRootElement);
74 if (!inputPhilipsIp.empty())
76 philipsDevice->SetIPAddress(inputPhilipsIp.c_str());
81 LOG_ERROR(
"Unable to connect to Philips ie33 machine at " << philipsDevice->GetIPAddress() <<
":" << philipsDevice->GetPort() );
85 philipsDevice->StartRecording();
88 LOG_DEBUG(
"Rendering disabled. Wait for just a few seconds to acquire data before exiting");
95 vtkSmartPointer<vtkIGSIOTrackedFrameList> frameList = vtkSmartPointer<vtkIGSIOTrackedFrameList>::New();
98 double oldTimestamp(0.0);
99 channel->GetOldestTimestamp(oldTimestamp);
100 channel->GetTrackedFrameList(oldTimestamp, frameList, 30);
102 philipsDevice->StopRecording();
103 philipsDevice->Disconnect();
int main(int argc, char *argv[])
static vtkIGSIOLogger * Instance()
Contains an optional timestamped circular buffer containing the video images and a number of timestam...
static PlusStatus ReadDeviceSetConfigurationFromFile(vtkXMLDataElement *config, const char *filename)