18 #include <itkMultiThreader.h>
19 #include <itksys/SystemTools.hxx>
20 #pragma GCC visibility push(default)
21 #include <itkEventObject.h>
22 #pragma GCC visibility pop
83 throw std::invalid_argument(
"ToFCameraDevice is NULL.");
97 throw std::logic_error(
"No file format specified!");
160 struct itk::MultiThreader::ThreadInfoStruct * pInfo = (
struct itk::MultiThreader::ThreadInfoStruct*)pInfoStruct;
163 return ITK_THREAD_RETURN_VALUE;
165 if (pInfo->UserData == NULL)
167 return ITK_THREAD_RETURN_VALUE;
170 if (toFImageRecorder!=NULL)
180 t1 = realTimeClock->GetCurrentStamp();
181 bool overflow =
false;
182 bool printStatus =
false;
183 int requiredImageSequence = 0;
184 int numOfFramesRecorded = 0;
188 abort = toFImageRecorder->
m_Abort;
208 numOfFramesRecorded++;
209 if (numOfFramesRecorded % n == 0)
215 t2 = realTimeClock->GetCurrentStamp() - t1;
217 t1 = realTimeClock->GetCurrentStamp();
222 abort = toFImageRecorder->
m_Abort;
231 toFImageRecorder->InvokeEvent(itk::AbortEvent());
235 return ITK_THREAD_RETURN_VALUE;
void StartRecording()
Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record pr...
itk::SmartPointer< Self > Pointer
ToFImageRecorder::RecordMode m_RecordMode
mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite) ...
int m_ImageSequence
number of images currently acquired
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
itk::FastMutexLock::Pointer m_AbortMutex
mutex for thread-safe data access of abort flag
ToFImageWriter::ToFImageType m_ToFImageType
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
bool m_Abort
flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combin...
int m_ToFCaptureHeight
height (y-dimension) of the images to record.
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType)
Set the type of image to be recorded.
ToFCameraDevice::Pointer m_ToFCameraDevice
ToFCameraDevice used for acquiring the images.
Virtual interface and base class for all Time-of-Flight devices.
void StopRecording()
Stops the recording by setting the m_Abort flag to false.
DataCollection - Class to facilitate loading/accessing structured data.
std::string m_FileFormat
file format for saving images. If .csv is chosen, ToFImageCsvWriter is used
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
int m_RGBCaptureHeight
height (y-dimension) of the images to record.
int m_NumOfFrames
number of frames to be recorded by this recorder
int m_RGBPixelNumber
number of pixels (widht*height) of the images to record
std::string m_DistanceImageFileName
file name for saving the distance image
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
ToFCameraDevice * GetCameraDevice()
Get the device used for acquiring ToF images.
ToFImageWriter::ToFImageType GetToFImageType()
Get the type of image to be recorded.
Recorder class for ToF images.
void WaitForThreadBeingTerminated()
Wait until thread is terinated.
int m_SourceDataSize
size of the source data provided by the device
void SetCameraDevice(ToFCameraDevice *aToFCameraDevice)
Set the device used for acquiring ToF images.
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
float * m_DistanceArray
array holding the distance data
static ITK_THREAD_RETURN_TYPE RecordData(void *pInfoStruct)
Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter...
std::string m_RGBImageFileName
file name for saving the rgb image
ToFImageRecorder::RecordMode GetRecordMode()
Returns the currently set RecordMode.
int m_RGBCaptureWidth
width (x-dimension) of the images to record.
float * m_IntensityArray
array holding the intensity data
itk::MultiThreader::Pointer m_MultiThreader
member for thread-handling (ITK-based)
ToFImageWriter::Pointer m_ToFImageWriter
image writer writing the acquired images to a file
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
bool m_RGBImageSelected
flag indicating if rgb image should be recorded
void SetRecordMode(ToFImageRecorder::RecordMode recordMode)
Set the RecordMode.
unsigned char * m_RGBArray
array holding the RGB data if available (e.g. for Kinect)
static Pointer New(void)
instanciates a new, operating-system dependant, instance of mitk::RealTimeClock.
std::string m_IntensityImageFileName
file name for saving the intensity image
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
char * m_SourceDataArray
array holding the source data
int m_ThreadID
ID of the thread recording the data.
float * m_AmplitudeArray
array holding the amplitude data
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.