13 #include <itksys/SystemTools.hxx> 27 m_NumberOfRGBBytes(0),
31 m_RGBCaptureHeight(0),
32 m_ConnectionCheck(false),
34 m_ToFImageType(ToFImageType3D),
35 m_DistanceImage(nullptr),
36 m_AmplitudeImage(nullptr),
37 m_IntensityImage(nullptr),
39 m_DistanceInfile(nullptr),
40 m_AmplitudeInfile(nullptr),
41 m_IntensityInfile(nullptr),
43 m_IntensityArray(nullptr),
44 m_DistanceArray(nullptr),
45 m_AmplitudeArray(nullptr),
47 m_DistanceImageFileName(
""),
48 m_AmplitudeImageFileName(
""),
49 m_IntensityImageFileName(
""),
50 m_RGBImageFileName(
""),
51 m_PixelStartInFile(0),
63 void ToFCameraMITKPlayerController::CleanUp()
114 throw std::logic_error(
"No image data file names set");
123 MITK_ERROR <<
"ToF distance image data file empty";
131 MITK_WARN <<
"ToF amplitude image data file empty";
139 MITK_WARN <<
"ToF intensity image data file empty";
147 MITK_WARN <<
"ToF RGB image data file empty";
187 if (infoImage->GetDimension() == 2)
190 else if (infoImage->GetDimension() == 3)
193 else if (infoImage->GetDimension() == 4)
197 throw std::logic_error(
"Error opening ToF data file: Invalid dimension.");
236 catch(std::exception& e)
239 throw std::logic_error(
"Error opening ToF data file");
291 itksys::SystemTools::Delay(50);
294 void ToFCameraMITKPlayerController::AccessData(
int frame,
Image::Pointer image,
float* &data)
~ToFCameraMITKPlayerController() override
bool m_ConnectionCheck
flag showing whether the camera is connected (true) or not (false)
virtual void GetRgb(unsigned char *rgbArray)
gets the current RGB frame from the input if available
int m_RGBCaptureWidth
same for RGB image which can be different then depth etc.
virtual bool CloseCameraConnection()
closes the connection to the camera
Image::Pointer m_DistanceImage
std::string m_RGBImageFileName
file name of the rgb image to be played
int m_PixelNumber
holds the number of pixels contained in the image
virtual void UpdateCamera()
updates the current image frames from input
DataCollection - Class to facilitate loading/accessing structured data.
std::string m_AmplitudeImageFileName
file name of the amplitude image to be played
float * m_AmplitudeArray
member holding the current amplitude frame
int m_CaptureHeight
holds the height of the image
ToFImageType m_ToFImageType
type of the ToF image to be played: 3D Volume (ToFImageType3D), temporal 2D image stack (ToFImageType...
virtual void GetAmplitudes(float *amplitudeArray)
gets the current amplitude frame from the input These values can be used to determine the quality of ...
ToFCameraMITKPlayerController()
std::string m_InputFileName
Image::Pointer m_RGBImage
Image::Pointer m_AmplitudeImage
int m_NumberOfRGBBytes
same for RGB image
virtual void SetInputFileName(std::string inputFileName)
int m_CaptureWidth
holds the width of the image
Image::Pointer m_IntensityImage
std::string m_DistanceImageFileName
file name of the distance image to be played
mitk::Image::Pointer image
virtual void GetIntensities(float *intensityArray)
gets the current intensity frame from the input as a greyscale image
virtual void GetDistances(float *distanceArray)
gets the current distance frame from the inpug measuring the distance between the camera and the diff...
std::vector< bool > m_ImageStatus
float * m_DistanceArray
member holding the current distance frame
virtual bool OpenCameraConnection()
opens a connection to the ToF camera
std::string m_IntensityImageFileName
file name of the intensity image to be played
int m_RGBCaptureHeight
same for RGB image which can be different then depth etc.
ImageReadAccessor class to get locked read access for a particular image part.
int m_RGBPixelNumber
same for RGB image
float * m_IntensityArray
member holding the current intensity frame
int m_NumberOfBytes
holds the number of bytes contained in the image
unsigned char * m_RGBArray
member holding the current rgb frame