mirror of
https://gitlab.ethz.ch/gfattori/glocalize.git
synced 2026-05-03 13:44:26 +02:00
adding service worker structure for dicomscan skullremoval and volumepreparation
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include "VolumePrepWorker.h"
|
||||
#include "VolumePrepService.h"
|
||||
|
||||
#include <vtkImageData.h>
|
||||
|
||||
VolumePrepWorker::VolumePrepWorker(QObject* parent) : QObject(parent) {}
|
||||
|
||||
void VolumePrepWorker::run(vtkImageData* input)
|
||||
{
|
||||
m_abort.store(false);
|
||||
emit progress(0.0);
|
||||
|
||||
if (m_abort.load()) { emit aborted(); return; }
|
||||
|
||||
VolumePrepService svc;
|
||||
vtkImageData* out = svc.prepare(input);
|
||||
|
||||
if (m_abort.load()) {
|
||||
if (out) out->Delete();
|
||||
emit aborted();
|
||||
return;
|
||||
}
|
||||
|
||||
emit progress(100.0);
|
||||
emit finished(out);
|
||||
}
|
||||
|
||||
void VolumePrepWorker::abort()
|
||||
{
|
||||
m_abort.store(true);
|
||||
}
|
||||
Reference in New Issue
Block a user