BioGTK  6.0.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
All Classes Namespaces Functions
BioGTK.AutoSAM Class Reference

Public Member Functions

 AutoSAM (int points_per_side=4, int points_per_batch=64, float pred_iou_thresh=0.5f, float stability_score_thresh=0.5f, float stability_score_offset=1.0f, float box_nms_thresh=0.7f, int crop_n_layers=0, float crop_nms_thresh=0.7f, float crop_overlap_ratio=(float) 512/1500, int crop_n_points_downscale_factor=1, List< double[,]> point_grids=null, int min_mask_region_area=0, string output_mode="binary_mask")
 
MaskData Generate (BioImage im, int buffer)
 

Public Attributes

int points_per_side = 4
 
float pred_iou_thresh = 0.88f
 
float stability_score_thresh = 0.95f
 
SAM mSAM
 
MicroSAM microSAM
 
float[] mImgEmbedding
 
bool isMicro = false
 

Detailed Description

Definition at line 17 of file AutoSAM.cs.

Constructor & Destructor Documentation

◆ AutoSAM()

BioGTK.AutoSAM.AutoSAM ( int points_per_side = 4,
int points_per_batch = 64,
float pred_iou_thresh = 0::5f,
float stability_score_thresh = 0::5f,
float stability_score_offset = 1::0f,
float box_nms_thresh = 0::7f,
int crop_n_layers = 0,
float crop_nms_thresh = 0::7f,
float crop_overlap_ratio = (float)512 / 1500,
int crop_n_points_downscale_factor = 1,
List< double[,]> point_grids = null,
int min_mask_region_area = 0,
string output_mode = "binary_mask" )

Definition at line 38 of file AutoSAM.cs.

51 {
52 this.points_per_side = points_per_side;
53 this.points_per_batch = points_per_batch;
54 this.pred_iou_thresh = pred_iou_thresh;
55 this.stability_score_thresh = stability_score_thresh;
56 this.stability_score_offset = stability_score_offset;
57 this.box_nms_thresh = box_nms_thresh;
58 this.crop_n_layers = crop_n_layers;
59 this.crop_nms_thresh = crop_nms_thresh;
60 this.crop_overlap_ratio = crop_overlap_ratio;
61 this.crop_n_points_downscale_factor = crop_n_points_downscale_factor;
62 this.point_grids = point_grids;
63 this.min_mask_region_area = min_mask_region_area;
64 this.output_mode = output_mode;
65
66 if (SAM.theSingleton == null)
67 {
68 mSAM = MicroSAM.Instance();
69 this.isMicro = true;
70 }
71 else
72 mSAM = SAM.Instance();
73 if (points_per_side != 0)
74 {
75 this.point_grids = build_all_layer_point_grids(
76 points_per_side,
77 crop_n_layers,
78 crop_n_points_downscale_factor);
79 }
80 }
static new MicroSAM Instance()
Definition MicroSAM.cs:36
static SAM Instance()
Definition SAM.cs:33

Member Function Documentation

◆ Generate()

MaskData BioGTK.AutoSAM.Generate ( BioImage im,
int buffer )

Definition at line 200 of file AutoSAM.cs.

201 {
202 this.mImage = im;
203 mImgEmbedding = ((List<float[]>)im.Tag)[buffer];
204 if (points_per_side != 0)
205 {
206 this.point_grids = build_all_layer_point_grids(
207 points_per_side,
208 crop_n_layers,
209 crop_n_points_downscale_factor);
210 }
211 MaskData masks = this._generate_masks(this.mImage);
212 return masks;
213 }
A structure for storing masks and their related data in batched format. Implements basic filtering an...
Definition MaskData.cs:14

Member Data Documentation

◆ isMicro

bool BioGTK.AutoSAM.isMicro = false

Definition at line 36 of file AutoSAM.cs.

◆ microSAM

MicroSAM BioGTK.AutoSAM.microSAM

Definition at line 34 of file AutoSAM.cs.

◆ mImgEmbedding

float [] BioGTK.AutoSAM.mImgEmbedding

Definition at line 35 of file AutoSAM.cs.

◆ mSAM

SAM BioGTK.AutoSAM.mSAM

Definition at line 33 of file AutoSAM.cs.

◆ points_per_side

int BioGTK.AutoSAM.points_per_side = 4

Definition at line 19 of file AutoSAM.cs.

◆ pred_iou_thresh

float BioGTK.AutoSAM.pred_iou_thresh = 0.88f

Definition at line 21 of file AutoSAM.cs.

◆ stability_score_thresh

float BioGTK.AutoSAM.stability_score_thresh = 0.95f

Definition at line 22 of file AutoSAM.cs.


The documentation for this class was generated from the following file: