Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Recorder class for ToF images. More...
#include <mitkToFImageRecorder.h>
Public Types | |
enum | RecordMode { PerFrames, Infinite } |
Public Member Functions | |
ToFImageRecorder () | |
~ToFImageRecorder () | |
mitkClassMacroItkParent (ToFImageRecorder, itk::Object) | |
Pointer | Clone () const |
virtual std::string | GetDistanceImageFileName () |
virtual std::string | GetAmplitudeImageFileName () |
virtual std::string | GetIntensityImageFileName () |
virtual std::string | GetRGBImageFileName () |
virtual int | GetToFCaptureWidth () |
virtual int | GetToFCaptureHeight () |
virtual int | GetRGBCaptureWidth () |
virtual int | GetRGBCaptureHeight () |
virtual bool | GetDistanceImageSelected () |
virtual bool | GetAmplitudeImageSelected () |
virtual bool | GetIntensityImageSelected () |
virtual bool | GetRGBImageSelected () |
virtual int | GetNumOfFrames () |
virtual std::string | GetFileFormat () |
virtual void | SetDistanceImageFileName (std::string _arg) |
virtual void | SetAmplitudeImageFileName (std::string _arg) |
virtual void | SetIntensityImageFileName (std::string _arg) |
virtual void | SetRGBImageFileName (std::string _arg) |
virtual void | SetDistanceImageSelected (bool _arg) |
virtual void | SetAmplitudeImageSelected (bool _arg) |
virtual void | SetIntensityImageSelected (bool _arg) |
virtual void | SetRGBImageSelected (bool _arg) |
virtual void | SetNumOfFrames (int _arg) |
virtual void | SetFileFormat (std::string _arg) |
ToFImageRecorder::RecordMode | GetRecordMode () |
Returns the currently set RecordMode. More... | |
void | SetRecordMode (ToFImageRecorder::RecordMode recordMode) |
Set the RecordMode. More... | |
void | SetCameraDevice (ToFCameraDevice *aToFCameraDevice) |
Set the device used for acquiring ToF images. More... | |
ToFCameraDevice * | GetCameraDevice () |
Get the device used for acquiring ToF images. More... | |
ToFImageWriter::ToFImageType | GetToFImageType () |
Get the type of image to be recorded. More... | |
void | SetToFImageType (ToFImageWriter::ToFImageType toFImageType) |
Set the type of image to be recorded. More... | |
void | StartRecording () |
Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record process is controlled by the m_Abort flag. More... | |
void | StopRecording () |
Stops the recording by setting the m_Abort flag to false. More... | |
void | WaitForThreadBeingTerminated () |
Wait until thread is terinated. More... | |
Static Public Member Functions | |
static Pointer | New () |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_TYPE | RecordData (void *pInfoStruct) |
Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter. More... | |
Protected Attributes | |
ToFCameraDevice::Pointer | m_ToFCameraDevice |
ToFCameraDevice used for acquiring the images. More... | |
int | m_ToFCaptureWidth |
width (x-dimension) of the images to record. More... | |
int | m_ToFCaptureHeight |
height (y-dimension) of the images to record. More... | |
int | m_ToFPixelNumber |
number of pixels (widht*height) of the images to record More... | |
int | m_RGBCaptureWidth |
width (x-dimension) of the images to record. More... | |
int | m_RGBCaptureHeight |
height (y-dimension) of the images to record. More... | |
int | m_RGBPixelNumber |
number of pixels (widht*height) of the images to record More... | |
int | m_SourceDataSize |
size of the source data provided by the device More... | |
int | m_ImageSequence |
number of images currently acquired More... | |
float * | m_IntensityArray |
array holding the intensity data More... | |
float * | m_DistanceArray |
array holding the distance data More... | |
float * | m_AmplitudeArray |
array holding the amplitude data More... | |
unsigned char * | m_RGBArray |
array holding the RGB data if available (e.g. for Kinect) More... | |
char * | m_SourceDataArray |
array holding the source data More... | |
ToFImageWriter::Pointer | m_ToFImageWriter |
image writer writing the acquired images to a file More... | |
std::string | m_DistanceImageFileName |
file name for saving the distance image More... | |
std::string | m_AmplitudeImageFileName |
file name for saving the amplitude image More... | |
std::string | m_IntensityImageFileName |
file name for saving the intensity image More... | |
std::string | m_RGBImageFileName |
file name for saving the rgb image More... | |
int | m_NumOfFrames |
number of frames to be recorded by this recorder More... | |
ToFImageWriter::ToFImageType | m_ToFImageType |
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1) More... | |
ToFImageRecorder::RecordMode | m_RecordMode |
mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite) More... | |
std::string | m_FileFormat |
file format for saving images. If .csv is chosen, ToFImageCsvWriter is used More... | |
bool | m_DistanceImageSelected |
flag indicating if distance image should be recorded More... | |
bool | m_AmplitudeImageSelected |
flag indicating if amplitude image should be recorded More... | |
bool | m_IntensityImageSelected |
flag indicating if intensity image should be recorded More... | |
bool | m_RGBImageSelected |
flag indicating if rgb image should be recorded More... | |
itk::MultiThreader::Pointer | m_MultiThreader |
member for thread-handling (ITK-based) More... | |
int | m_ThreadID |
ID of the thread recording the data. More... | |
itk::FastMutexLock::Pointer | m_AbortMutex |
mutex for thread-safe data access of abort flag More... | |
bool | m_Abort |
flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combination with m_AbortMutex More... | |
Recorder class for ToF images.
This class represents a recorder for ToF data. A ToFCameraDevice is used to acquire the data. The acquired images are then added to a ToFImageWriter that performs the actual writing.
Recording can be performed either frame-based or continuously.
Definition at line 46 of file mitkToFImageRecorder.h.
Enumerator | |
---|---|
PerFrames | |
Infinite |
Definition at line 85 of file mitkToFImageRecorder.h.
mitk::ToFImageRecorder::ToFImageRecorder | ( | ) |
Definition at line 26 of file mitkToFImageRecorder.cpp.
References m_Abort, m_AbortMutex, m_AmplitudeArray, m_AmplitudeImageFileName, m_AmplitudeImageSelected, m_DistanceArray, m_DistanceImageFileName, m_DistanceImageSelected, m_FileFormat, m_ImageSequence, m_IntensityArray, m_IntensityImageFileName, m_IntensityImageSelected, m_MultiThreader, m_NumOfFrames, m_RecordMode, m_RGBArray, m_RGBCaptureHeight, m_RGBCaptureWidth, m_RGBImageFileName, m_RGBImageSelected, m_RGBPixelNumber, m_SourceDataArray, m_SourceDataSize, m_ThreadID, m_ToFCameraDevice, m_ToFCaptureHeight, m_ToFCaptureWidth, m_ToFImageType, m_ToFImageWriter, m_ToFPixelNumber, mitk::New(), PerFrames, and mitk::ToFImageWriter::ToFImageType3D.
mitk::ToFImageRecorder::~ToFImageRecorder | ( | ) |
Definition at line 61 of file mitkToFImageRecorder.cpp.
References m_AmplitudeArray, m_DistanceArray, m_IntensityArray, m_RGBArray, and m_SourceDataArray.
Pointer mitk::ToFImageRecorder::Clone | ( | ) | const |
|
virtual |
|
virtual |
ToFCameraDevice * mitk::ToFImageRecorder::GetCameraDevice | ( | ) |
Get the device used for acquiring ToF images.
Definition at line 243 of file mitkToFImageRecorder.cpp.
References m_ToFCameraDevice.
Referenced by RecordData().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
ToFImageRecorder::RecordMode mitk::ToFImageRecorder::GetRecordMode | ( | ) |
Returns the currently set RecordMode.
Definition at line 258 of file mitkToFImageRecorder.cpp.
References m_RecordMode.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
ToFImageWriter::ToFImageType mitk::ToFImageRecorder::GetToFImageType | ( | ) |
Get the type of image to be recorded.
Definition at line 248 of file mitkToFImageRecorder.cpp.
References m_ToFImageType.
mitk::ToFImageRecorder::mitkClassMacroItkParent | ( | ToFImageRecorder | , |
itk::Object | |||
) |
|
static |
|
staticprotected |
Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter.
Definition at line 158 of file mitkToFImageRecorder.cpp.
References GetCameraDevice(), Infinite, m_Abort, m_AbortMutex, m_AmplitudeArray, m_DistanceArray, m_ImageSequence, m_IntensityArray, m_NumOfFrames, m_RecordMode, m_RGBArray, m_SourceDataArray, m_ToFImageWriter, MITK_INFO, mitk::RealTimeClock::New(), and PerFrames.
Referenced by StartRecording().
|
virtual |
|
virtual |
void mitk::ToFImageRecorder::SetCameraDevice | ( | ToFCameraDevice * | aToFCameraDevice | ) |
Set the device used for acquiring ToF images.
aToFCameraDevice | ToF camera device used. |
Definition at line 238 of file mitkToFImageRecorder.cpp.
References m_ToFCameraDevice.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
void mitk::ToFImageRecorder::SetRecordMode | ( | ToFImageRecorder::RecordMode | recordMode | ) |
Set the RecordMode.
recordMode | PerFrames ("Record specified number of frames"), Infinite ("Record until abort is required") |
Definition at line 263 of file mitkToFImageRecorder.cpp.
References m_RecordMode.
|
virtual |
|
virtual |
void mitk::ToFImageRecorder::SetToFImageType | ( | ToFImageWriter::ToFImageType | toFImageType | ) |
Set the type of image to be recorded.
toFImageType | type of the ToF image: ToFImageType3D (0) or ToFImageType2DPlusT (1) |
Definition at line 253 of file mitkToFImageRecorder.cpp.
References m_ToFImageType.
void mitk::ToFImageRecorder::StartRecording | ( | ) |
Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record process is controlled by the m_Abort flag.
Definition at line 79 of file mitkToFImageRecorder.cpp.
References m_Abort, m_AbortMutex, m_AmplitudeArray, m_AmplitudeImageFileName, m_AmplitudeImageSelected, m_DistanceArray, m_DistanceImageFileName, m_DistanceImageSelected, m_FileFormat, m_IntensityArray, m_IntensityImageFileName, m_IntensityImageSelected, m_MultiThreader, m_RGBArray, m_RGBCaptureHeight, m_RGBCaptureWidth, m_RGBImageFileName, m_RGBImageSelected, m_RGBPixelNumber, m_SourceDataArray, m_SourceDataSize, m_ThreadID, m_ToFCameraDevice, m_ToFCaptureHeight, m_ToFCaptureWidth, m_ToFImageType, m_ToFImageWriter, m_ToFPixelNumber, mitk::ToFNrrdImageWriter::New(), mitk::ToFImageCsvWriter::New(), and RecordData().
void mitk::ToFImageRecorder::StopRecording | ( | ) |
Stops the recording by setting the m_Abort flag to false.
Definition at line 70 of file mitkToFImageRecorder.cpp.
References m_Abort, and m_AbortMutex.
void mitk::ToFImageRecorder::WaitForThreadBeingTerminated | ( | ) |
Wait until thread is terinated.
Definition at line 153 of file mitkToFImageRecorder.cpp.
References m_MultiThreader, and m_ThreadID.
|
protected |
flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combination with m_AbortMutex
Definition at line 174 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), StopRecording(), and ToFImageRecorder().
|
protected |
mutex for thread-safe data access of abort flag
Definition at line 173 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), StopRecording(), and ToFImageRecorder().
|
protected |
array holding the amplitude data
Definition at line 148 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), ToFImageRecorder(), and ~ToFImageRecorder().
|
protected |
file name for saving the amplitude image
Definition at line 156 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
flag indicating if amplitude image should be recorded
Definition at line 166 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
array holding the distance data
Definition at line 147 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), ToFImageRecorder(), and ~ToFImageRecorder().
|
protected |
file name for saving the distance image
Definition at line 155 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
flag indicating if distance image should be recorded
Definition at line 165 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
file format for saving images. If .csv is chosen, ToFImageCsvWriter is used
Definition at line 163 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
number of images currently acquired
Definition at line 145 of file mitkToFImageRecorder.h.
Referenced by RecordData(), and ToFImageRecorder().
|
protected |
array holding the intensity data
Definition at line 146 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), ToFImageRecorder(), and ~ToFImageRecorder().
|
protected |
file name for saving the intensity image
Definition at line 157 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
flag indicating if intensity image should be recorded
Definition at line 167 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
member for thread-handling (ITK-based)
Definition at line 171 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), ToFImageRecorder(), and WaitForThreadBeingTerminated().
|
protected |
number of frames to be recorded by this recorder
Definition at line 160 of file mitkToFImageRecorder.h.
Referenced by RecordData(), and ToFImageRecorder().
|
protected |
mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite)
Definition at line 162 of file mitkToFImageRecorder.h.
Referenced by GetRecordMode(), RecordData(), SetRecordMode(), and ToFImageRecorder().
|
protected |
array holding the RGB data if available (e.g. for Kinect)
Definition at line 149 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), ToFImageRecorder(), and ~ToFImageRecorder().
|
protected |
height (y-dimension) of the images to record.
Definition at line 142 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
width (x-dimension) of the images to record.
Definition at line 141 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
file name for saving the rgb image
Definition at line 158 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
flag indicating if rgb image should be recorded
Definition at line 168 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
number of pixels (widht*height) of the images to record
Definition at line 143 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
array holding the source data
Definition at line 150 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), ToFImageRecorder(), and ~ToFImageRecorder().
|
protected |
size of the source data provided by the device
Definition at line 144 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
ID of the thread recording the data.
Definition at line 172 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), ToFImageRecorder(), and WaitForThreadBeingTerminated().
|
protected |
ToFCameraDevice used for acquiring the images.
Definition at line 137 of file mitkToFImageRecorder.h.
Referenced by GetCameraDevice(), SetCameraDevice(), StartRecording(), and ToFImageRecorder().
|
protected |
height (y-dimension) of the images to record.
Definition at line 139 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
width (x-dimension) of the images to record.
Definition at line 138 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().
|
protected |
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
Definition at line 161 of file mitkToFImageRecorder.h.
Referenced by GetToFImageType(), SetToFImageType(), StartRecording(), and ToFImageRecorder().
|
protected |
image writer writing the acquired images to a file
Definition at line 153 of file mitkToFImageRecorder.h.
Referenced by RecordData(), StartRecording(), and ToFImageRecorder().
|
protected |
number of pixels (widht*height) of the images to record
Definition at line 140 of file mitkToFImageRecorder.h.
Referenced by StartRecording(), and ToFImageRecorder().