12 #ifndef mitkMonaiLabelTool_h
13 #define mitkMonaiLabelTool_h
18 #include <unordered_map>
20 #include <nlohmann/json.hpp>
40 std::unordered_map<std::string, int>
labels;
43 std::unordered_map<bool, std::string>
config;
47 return (this->name == rhs.
name && this->type == rhs.
type);
52 return (
"deepgrow" ==
type ||
"deepedit" ==
type);
91 return (this->model == rhs.
model && this->hostName == rhs.
hostName && this->port == rhs.
port &&
148 itkSetMacro(ModelName, std::string);
149 itkGetConstMacro(ModelName, std::string);
150 itkSetMacro(URL, std::string);
151 itkGetConstMacro(URL, std::string);
152 itkSetMacro(TempDir, std::string);
153 itkGetConstMacro(TempDir, std::string);
154 itkSetMacro(Timeout,
unsigned int);
155 itkGetConstMacro(Timeout,
unsigned int);
214 const PointSet::Pointer pointSet)
const;
225 int m_PointSetCount = 0;
233 std::unique_ptr<MonaiAppMetadata> m_InfoParameters;
239 std::pair<std::string, std::string> CreateTempDirs(
const std::string &filePattern)
const;
244 bool IsMonaiServerOn(
const std::string &hostName,
const int &port)
const;
256 void PostInferRequest(
const std::string &hostName,
const int &port,
const std::string &filePath,
const std::string &outFile,
259 std::string m_TempDir;
260 std::string m_ModelName;
263 unsigned int m_Timeout = 60;
264 const std::set<std::string> m_AUTO_SEG_TYPE_NAME = {
"segmentation"};
265 const std::set<std::string> m_SCRIBBLE_SEG_TYPE_NAME = {
"scribbles"};
266 const std::set<std::string> m_INTERACTIVE_SEG_TYPE_NAME = {
"deepgrow"};
267 const std::string m_TEMPLATE_FILENAME =
"XXXXXX_000_0000.nii.gz";
268 const std::string m_SERVER_503_ERROR_TEXT =
"A connection to MonaiLabel server cannot be established.";
#define MITKSEGMENTATION_EXPORT
BaseGeometry Describes the geometry of a data object.
Image class for storing images.
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Find image slices visible on a given plane.
Request class to pack model and other necessary server information from GUI.
bool operator==(const MonaiLabelRequest &rhs) const
Struct to hold featured models individual info.
bool IsInteractive() const
std::unordered_map< std::string, int > labels
bool operator==(const MonaiModelInfo &rhs) const
std::unordered_map< bool, std::string > config