13 #ifndef mitkSegmentAnythingPythonService_h
14 #define mitkSegmentAnythingPythonService_h
54 std::string checkPointPath,
unsigned int gpuId, std::string backend);
62 itkSetMacro(MitkTempDir, std::string);
63 itkGetConstMacro(MitkTempDir, std::string);
70 static void onPythonProcessEvent(itk::Object*,
const itk::EventObject&,
void*);
79 static bool CheckStatus() ;
86 void StartAsyncProcess();
92 void StopAsyncProcess();
98 void TransferImageToProcess(
const Image *inputAtTimeStep, std::string &UId);
105 void TransferPointsToProcess(
const std::string &triggerCSV)
const;
122 void start_python_daemon()
const;
128 void WriteControlFile(
const std::string &statusString)
const;
134 void CreateTempDirs(
const std::string &dirPattern);
140 template <
typename TPixel,
unsigned int VImageDimension>
141 void ITKWriter(
const itk::Image<TPixel, VImageDimension> *image, std::string& outputFilename)
const;
144 std::string m_MitkTempDir;
145 std::string m_PythonPath;
146 std::string m_ModelType;
147 std::string m_CheckpointPath;
148 std::string m_InDir, m_OutDir;
149 std::string m_Backend;
150 std::string m_CurrentUId;
152 const std::string PARENT_TEMP_DIR_PATTERN =
"mitk-sam-XXXXXX";
153 const std::string TRIGGER_FILENAME =
"trigger.csv";
154 const std::string SAM_PYTHON_FILE_NAME =
"run_inference_daemon.py";
155 std::future<void> m_Future;
163 static const std::string
OFF;