13 #ifndef mitkSegmentAnythingTool_h
14 #define mitkSegmentAnythingTool_h
43 itkFactorylessNewMacro(
Self);
46 const char **GetXPM()
const override;
47 const char *GetName()
const override;
50 void Activated()
override;
51 void Deactivated()
override;
56 virtual void ClearPicks();
64 virtual bool HasPicks()
const;
66 itkSetMacro(MitkTempDir, std::string);
67 itkGetConstMacro(MitkTempDir, std::string);
69 itkSetMacro(PythonPath, std::string);
70 itkGetConstMacro(PythonPath, std::string);
72 itkSetMacro(ModelType, std::string);
73 itkGetConstMacro(ModelType, std::string);
75 itkSetMacro(CheckpointPath, std::string);
76 itkGetConstMacro(CheckpointPath, std::string);
78 itkSetMacro(Backend, std::string);
79 itkGetConstMacro(Backend, std::string);
81 itkSetMacro(GpuId,
int);
82 itkGetConstMacro(GpuId,
int);
84 itkSetMacro(TimeOutLimit,
long);
85 itkGetConstMacro(TimeOutLimit,
long);
87 itkSetMacro(IsReady,
bool);
88 itkGetConstMacro(IsReady,
bool);
89 itkBooleanMacro(IsReady);
96 void InitSAMPythonProcess();
103 bool IsPythonReady()
const;
111 void ConnectActionsAndFunctions()
override;
159 std::vector<std::pair<mitk::Point2D, std::string>> GetPointsAsVector(
const mitk::BaseGeometry *baseGeometry)
const;
167 virtual std::string GetPointsAsCSVString(
const mitk::BaseGeometry *baseGeometry)
const;
180 void EmitSAMStatusMessageEvent(
const std::string &status);
186 void ConfirmCleanUp()
override;
192 template <
typename TPixel,
unsigned int VImageDimension>
206 std::string m_MitkTempDir;
207 std::string m_PythonPath;
208 std::string m_ModelType;
209 std::string m_CheckpointPath;
210 std::string m_Backend;
216 bool m_IsGenerateEmbeddings =
true;
217 bool m_IsReady =
false;
218 int m_PointSetCount = 0;
219 long m_TimeOutLimit = -1;