MeVisLab Toolbox Reference
ml::RTObjectSaveBackgroundTask Class Reference

#include <mlRTObjectSave.h>

Inheritance diagram for ml::RTObjectSaveBackgroundTask:
ml::ModuleBackgroundTask ml::ImagingBackgroundTask ml::MessagingBackgroundTask ml::BackgroundTask

Public Member Functions

 RTObjectSaveBackgroundTask (Module *module, FloatField *progressField, StringField *statusField)
 
virtual ~RTObjectSaveBackgroundTask ()
 
void setDicomTree (DCMTree::TreePtr dicomTree)
 
void setFilename (const std::string &filename)
 
bool hasSuccessfullySaved () const
 
virtual void run () override
 Method that needs to be reimplemented. This is called from the worker thread.
 
- Public Member Functions inherited from ml::ModuleBackgroundTask
 ModuleBackgroundTask (Module *module, FloatField *progressField=nullptr, StringField *statusField=nullptr)
 
 ~ModuleBackgroundTask () override
 
void setProgressField (FloatField *field)
 Sets the progress field.
 
void setStatusField (StringField *field)
 Sets the status field.
 
bool hasProgressField ()
 Returns whether this task has a progress field.
 
bool hasStatusField ()
 Returns whether this task has a status field.
 
void setStatusString (const std::string &status) override
 Updates the status string while processing.
 
void setProgress (float progress) override
 Updates the progress while processing.
 
AsyncTileRequest requestTile (int inputImageIndex, const SubImageBox &box, MLDataType type, const ScaleShiftData &shift=ScaleShiftData(), int getTileFlags=ImagingBackgroundTask::UseMemoryManager)
 Asynchronously request the tile.
 
AsyncTileRequest requestTileWithExternalBuffer (int inputImageIndex, const SubImageBox &box, MLDataType type, const ScaleShiftData &shift, ManagedSubImage *externalBuffer, int getTileFlags=ImagingBackgroundTask::ExternalBuffer)
 Asynchronously request the tile.
 
ProcessAllPagesRequest requestProcessAllPages (ProcessAllPagesHandler *handler, const SubImageBox &box=SubImageBox())
 Asynchronously request a processing of pages using the given handler.
 
ProcessAllPagesRequest requestProcessAllPages (const SubImageBox &box=SubImageBox())
 Asynchronously request a processing of pages and running Module::processAllPages(-1).
 
virtual bool shouldCancelOnInputImageChange (int) const
 Returns whether the task should be canceled when the given input image has changed.
 
ImageVector getInputImageExtent (int index=0) const
 Returns the extent of the input image at index.
 
ImageVector getInputImagePageExtent (int index=0) const
 Returns the page extent of the input image at index.
 
MLDataType getInputImageDataType (int index=0) const
 Returns the data type of the input image at index.
 
double getInputImageMinVoxelValue (int index=0) const
 Returns the minimum voxel value of the input image at index.
 
double getInputImageMaxVoxelValue (int index=0) const
 Returns the maximum voxel value of the input image at index.
 
const MedicalImagePropertiesgetInputImageProperties (int index=0) const
 Returns the image properties of the input image at index.
 
bool hasValidInputImage (int index=0) const
 Returns whether the input image at index is valid and thus its properties can be requested.
 
int getNumInputImages () const
 Returns the number of input images.
 
- Public Member Functions inherited from ml::ImagingBackgroundTask
 ImagingBackgroundTask (void *owner)
 
 ~ImagingBackgroundTask () override
 
- Public Member Functions inherited from ml::MessagingBackgroundTask
 MessagingBackgroundTask (void *ownerArg)
 
template<typename Object , typename Method >
void callMethodOnGUI (const DistantObject< Object > &target, Method method)
 
template<typename Object , typename Method , typename Arg1 >
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1)
 
template<typename Object , typename Method , typename Arg1 , typename Arg2 >
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2)
 
template<typename Object , typename Method , typename Arg1 , typename Arg2 , typename Arg3 >
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
 
template<typename Object , typename Method , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 >
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
 
template<typename Object , typename Method , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 >
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
 
- Public Member Functions inherited from ml::BackgroundTask
 BackgroundTask (void *owner)
 Creates a new task with given owner.
 
virtual ~BackgroundTask ()
 
bool isSynchronous () const
 Checks whether the task is synchronous, which means it is not executed in a different thread.
 
void setSynchronous (bool flag)
 Sets whether the task is handled synchronously. Call this only in the setup of the task, not while it is already running.
 
void setSynchronousCancelField (NotifyField *field)
 Sets a cancel field that is used in synchronous mode to check whether cancel was pressed.
 
Status status () const
 Returns the status of the task.
 
void cancel ()
 Cancels the task (i.e., it sets status to canceled).
 
bool isCanceled () const
 Checks whether the task was canceled.
 
bool shouldStop ()
 Returns whether the task should stop its work because it has been canceled.
 
void resume ()
 Resumes the task after it was suspended.
 
void suspend ()
 Suspends the task.
 
std::string statusString () const
 Returns current status string.
 
float progress () const
 Returns current progress This is thread-safe.
 
void setOwnerWasDeleted ()
 Tells the task that its owner was deleted and cancels the thread.
 
bool hasOwner () const
 Returns whether the owner was deleted.
 
void * owner () const
 Returns the owner of the task Call this from GUI thread only!
 
void waitAndExecuteNextMessage ()
 Executes the next message.
 
bool executeNextMessage ()
 Executes the next message.
 
void sendMessageToGUI (BackgroundTaskMessage *message)
 Sends the message to the GUI.
 
void logMessage (const std::string &message)
 Logs a message.
 
bool isVerbose () const
 Checks whether task uses verbose logging.
 
void setVerbose (bool flag)
 Sets whether task uses verbose logging.
 
double runningTime () const
 Returns the running time in seconds of the task.
 
double idleTime () const
 Returns the idle time in seconds of the task (e.g., the time it waited for getTile to complete).
 
void getStatusInformation (BackgroundTaskStatusInformation &info)
 Returns the complete status information.
 
MLuint32 taskId () const
 Returns the unique id of this task. The id of a task never changes.
 
void setTaskFinishedCB (BackgroundTaskFinishedCB *callback, void *userdata)
 Set this directly after the initialization of the task from the GUI thread.
 
void addObserver (Observer *observer)
 Adds the given observer.
 
void removeObserver (Observer *observer)
 Removes the given observer.
 

Additional Inherited Members

- Public Types inherited from ml::ImagingBackgroundTask
enum  TileRequestFlags {
  UseMemoryManager = TileRequest::UseMemoryManager , UseMLAlloc = TileRequest::UseMLAlloc , NoAllocation = TileRequest::NoAllocation , ExternalBuffer = TileRequest::ExternalBuffer ,
  AllocationPolicyMask = 0xf , RequestReadOnlyPage = 16 , ReceiveProgressMessages = 32
}
 Defines flags that can be passed with requestTile(). More...
 
- Public Types inherited from ml::BackgroundTask
enum  Status {
  NotInTaskManager , Queued , Running , Finished ,
  Canceled , Suspended
}
 Defines current status of the task. More...
 
- Protected Member Functions inherited from ml::ImagingBackgroundTask
BackgroundRequestId generateBackgroundRequestId ()
 Generates next generateBackgroundRequestId().
 
- Protected Member Functions inherited from ml::BackgroundTask
void sendStatusChangedToObservers ()
 Sends the status change to all observers.
 
void sendStatusStringChangedToObservers ()
 Sends the status string change to all observers.
 
void sendLogMessageToObservers (const std::string &msg)
 Sends the status string change to all observers.
 
void addIdleTime (double timeInSecs)
 Adds given timeInSecs as spent idle time.
 

Detailed Description

Definition at line 27 of file mlRTObjectSave.h.

Constructor & Destructor Documentation

◆ RTObjectSaveBackgroundTask()

ml::RTObjectSaveBackgroundTask::RTObjectSaveBackgroundTask ( Module module,
FloatField progressField,
StringField statusField 
)

◆ ~RTObjectSaveBackgroundTask()

virtual ml::RTObjectSaveBackgroundTask::~RTObjectSaveBackgroundTask ( )
inlinevirtual

Definition at line 33 of file mlRTObjectSave.h.

Member Function Documentation

◆ hasSuccessfullySaved()

bool ml::RTObjectSaveBackgroundTask::hasSuccessfullySaved ( ) const
inline

Definition at line 52 of file mlRTObjectSave.h.

◆ run()

virtual void ml::RTObjectSaveBackgroundTask::run ( )
overridevirtual

Method that needs to be reimplemented. This is called from the worker thread.

Implements ml::BackgroundTask.

◆ setDicomTree()

void ml::RTObjectSaveBackgroundTask::setDicomTree ( DCMTree::TreePtr  dicomTree)
inline

Definition at line 38 of file mlRTObjectSave.h.

References ml::BackgroundTask::isSynchronous().

◆ setFilename()

void ml::RTObjectSaveBackgroundTask::setFilename ( const std::string &  filename)
inline

Definition at line 50 of file mlRTObjectSave.h.


The documentation for this class was generated from the following file: