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;
64 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(GpuId,
int);
79 itkGetConstMacro(GpuId,
int);
81 itkSetMacro(TimeOutLimit,
long);
82 itkGetConstMacro(TimeOutLimit,
long);
84 itkSetMacro(IsReady,
bool);
85 itkGetConstMacro(IsReady,
bool);
86 itkBooleanMacro(IsReady);
93 void InitSAMPythonProcess();
100 bool IsPythonReady()
const;
108 void ConnectActionsAndFunctions()
override;
153 std::vector<std::pair<mitk::Point2D, std::string>> GetPointsAsVector(
const mitk::BaseGeometry*);
174 void EmitSAMStatusMessageEvent(
const std::string&);
180 void ConfirmCleanUp()
override;
186 template <
typename TPixel,
unsigned int VImageDimension>
199 std::string m_MitkTempDir;
200 std::string m_PythonPath;
201 std::string m_ModelType;
202 std::string m_CheckpointPath;
208 bool m_IsGenerateEmbeddings =
true;
209 bool m_IsReady =
false;
210 int m_PointSetCount = 0;
211 long m_TimeOutLimit = -1;
212 std::unique_ptr<SegmentAnythingPythonService> m_PythonService;