13 #ifndef mitkSegmentAnythingPythonService_h
14 #define mitkSegmentAnythingPythonService_h
52 std::string checkPointPath,
unsigned int gpuId, std::string backend);
60 itkSetMacro(MitkTempDir, std::string);
61 itkGetConstMacro(MitkTempDir, std::string);
68 static void onPythonProcessEvent(itk::Object*,
const itk::EventObject&,
void*);
77 static bool CheckStatus() ;
84 void StartAsyncProcess();
90 void StopAsyncProcess();
96 void TransferImageToProcess(
const Image *inputAtTimeStep, std::string &UId);
103 void TransferPointsToProcess(
const std::string &triggerCSV)
const;
120 void start_python_daemon()
const;
126 void WriteControlFile(
const std::string &statusString)
const;
132 void CreateTempDirs(
const std::string &dirPattern);
138 template <
typename TPixel,
unsigned int VImageDimension>
139 void ITKWriter(
const itk::Image<TPixel, VImageDimension> *image, std::string& outputFilename)
const;
142 std::string m_MitkTempDir;
143 std::string m_PythonPath;
144 std::string m_ModelType;
145 std::string m_CheckpointPath;
146 std::string m_InDir, m_OutDir;
147 std::string m_Backend;
148 std::string m_CurrentUId;
150 const std::string PARENT_TEMP_DIR_PATTERN =
"mitk-sam-XXXXXX";
151 const std::string TRIGGER_FILENAME =
"trigger.csv";
152 const std::string SAM_PYTHON_FILE_NAME =
"run_inference_daemon.py";
153 std::future<void> m_Future;
161 static const std::string
OFF;