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;
155 std::vector<std::pair<mitk::Point2D, std::string>> GetPointsAsVector(
const mitk::BaseGeometry *baseGeometry)
const;
163 virtual std::string GetPointsAsCSVString(
const mitk::BaseGeometry *baseGeometry)
const;
176 void EmitSAMStatusMessageEvent(
const std::string &status);
182 void ConfirmCleanUp()
override;
188 template <
typename TPixel,
unsigned int VImageDimension>
202 std::string m_MitkTempDir;
203 std::string m_PythonPath;
204 std::string m_ModelType;
205 std::string m_CheckpointPath;
206 std::string m_Backend;
212 bool m_IsGenerateEmbeddings =
true;
213 bool m_IsReady =
false;
214 int m_PointSetCount = 0;
215 long m_TimeOutLimit = -1;