Studio/ShapeWorksMONAI/MonaiLabelJob.h
Namespaces
| Name |
|---|
| shapeworks User usage reporting (telemetry) |
| monailabel |
Classes
| Name | |
|---|---|
| class | monailabel::MonaiLabelJob |
Source code
```cpp
pragma once
include
include
include
include
include
include
include
include
include
include
include
namespace py = pybind11;
namespace shapeworks { class ShapeWorksStudioApp; class Session; class Job; } // namespace shapeworks
namespace monailabel {
using shapeworks::Job; using shapeworks::ProjectHandle; using shapeworks::Session; using shapeworks::ShapeWorksStudioApp;
pragma GCC diagnostic push
pragma GCC diagnostic ignored "-Wattributes"
class MonaiLabelJob : public Job { Q_OBJECT;
public: const static std::string MONAI_RESULT_EXTENSION; const static std::string MONAI_RESULT_DTYPE;
MonaiLabelJob(QSharedPointer
py::dict getInfo();
std::string getModelName(std::string modelType);
std::vector
// MONAI Client callers py::dict nextSample(std::string strategy, py::dict params); py::tuple infer(std::string model, std::string image_in, py::dict params, std::string label_in, std::string file, std::string session_id); py::dict saveLabel(std::string image_in, std::string label_in, py::dict params); py::dict uploadImage(std::string image_in, std::string image_id);
void updateShapes();
void runSegmentationModel(); void run() override; QString name() override; void python_message(std::string str); void setCurrentSampleNumber(int n);
public Q_SLOTS: void onUploadSampleClicked(); // Triggered when upload Sample button is clicked void onRunSegmentationClicked(); // Triggered when Run Segmentation is clicked void onSubmitLabelClicked(); // Triggered when Submit Label is clicked
Q_SIGNALS: void triggerUpdateView(); void triggerClientInitialized(bool success); void triggerUploadSampleCompleted(); void triggerSegmentationCompleted(); void triggerSubmitLabelCompleted();
private:
std::string tmp_dir_;
std::string server_url_;
std::string client_id_;
// TODO: implement remote server session
// std::string username_;
// std::string password_;
// std::string auth_token_;
std::string strategy_;
std::string model_type_ = "";
std::string model_name_ = "";
std::unordered_map
// QT states bool waitingForUpload; bool waitingForSegmentation; bool waitingForLabelSubmission;
// Current subjects
int sample_number_;
std::string currentSampleId_;
std::string currentSegmentationPath_;
std::vector
QSharedPointer
bool error_occurred_ = false; };
pragma GCC diagnostic pop
} // namespace monailabel ```
Updated on 2026-03-31 at 16:02:11 +0000