17 #include <itksys/SystemTools.hxx>
31 m_NumberOfRGBBytes(0),
35 m_RGBCaptureHeight(0),
36 m_ConnectionCheck(false),
38 m_ToFImageType(ToFImageType3D),
43 m_DistanceInfile(NULL),
44 m_AmplitudeInfile(NULL),
45 m_IntensityInfile(NULL),
47 m_IntensityArray(NULL),
48 m_DistanceArray(NULL),
49 m_AmplitudeArray(NULL),
51 m_DistanceImageFileName(
""),
52 m_AmplitudeImageFileName(
""),
53 m_IntensityImageFileName(
""),
54 m_RGBImageFileName(
""),
55 m_PixelStartInFile(0),
67 void ToFCameraMITKPlayerController::CleanUp()
118 throw std::logic_error(
"No image data file names set");
127 MITK_ERROR <<
"ToF distance image data file empty";
135 MITK_WARN <<
"ToF amplitude image data file empty";
143 MITK_WARN <<
"ToF intensity image data file empty";
151 MITK_WARN <<
"ToF RGB image data file empty";
191 if (infoImage->GetDimension() == 2)
194 else if (infoImage->GetDimension() == 3)
197 else if (infoImage->GetDimension() == 4)
201 throw std::logic_error(
"Error opening ToF data file: Invalid dimension.");
240 catch(std::exception& e)
243 throw std::logic_error(
"Error opening ToF data file");
295 itksys::SystemTools::Delay(50);
298 void ToFCameraMITKPlayerController::AccessData(
int frame,
Image::Pointer image,
float* &data)
307 ImageReadAccessor imgAcc(image, image->GetVolumeData(frame));
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
~ToFCameraMITKPlayerController()
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
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
static mitk::Image::Pointer LoadImage(const std::string &path)
LoadImage Convenience method to load an arbitrary mitkImage.
int m_NumberOfBytes
holds the number of bytes contained in the image
unsigned char * m_RGBArray
member holding the current rgb frame