BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
BioGTK.ROI Class Reference
Inheritance diagram for BioGTK.ROI:

Classes

class  Mask
 Represents a Mask layer. More...
 

Public Types

enum  Type {
  Rectangle , Point , Line , Polygon ,
  Polyline , Freeform , Ellipse , Label ,
  Mask
}
 
enum  CoordinateSystem { pixel , micron }
 

Public Member Functions

ROI Copy ()
 
ROI Copy (ZCT cord)
 
RectangleD GetSelectBound (double scaleX, double scaleY)
 
 ROI ()
 
RectangleD[] GetSelectBoxes (double s)
 
void UpdatePoint (PointD p, int i)
 
PointD GetPoint (int i)
 
PointD[] GetPoints ()
 
PointF[] GetPointsF ()
 
void AddPoint (PointD p)
 
void AddPoints (PointD[] p)
 
void AddPoints (int[] xp, int[] yp)
 
void AddPoints (float[] xp, float[] yp)
 
void RemovePoints (int[] indexs)
 
void ClearPoints ()
 
int GetPointCount ()
 
PointD[] stringToPoints (string s)
 
string PointsToString (BioImage b)
 
void UpdateBoundingBox ()
 
void Dispose ()
 
override string ToString ()
 

Static Public Member Functions

static ROI CreatePoint (ZCT coord, double x, double y)
 
static ROI CreateLine (ZCT coord, PointD x1, PointD x2)
 
static ROI CreateRectangle (ZCT coord, double x, double y, double w, double h)
 
static ROI CreateEllipse (ZCT coord, double x, double y, double w, double h)
 
static ROI CreatePolygon (ZCT coord, PointD[] pts)
 
static ROI CreateFreeform (ZCT coord, PointD[] pts)
 
static ROI CreateMask (ZCT coord, float[] mask, int width, int height, PointD loc, double physicalX, double physicalY)
 
static ROI CreateMask (ZCT coord, byte[] mask, int width, int height, PointD loc, double physicalX, double physicalY)
 

Public Attributes

Type type
 
List< int > selectedPoints = new List<int>()
 
RectangleD BoundingBox
 
float fontSize = 12
 
Cairo.FontSlant slant
 
Cairo.FontWeight weight
 
string family = "Times New Roman"
 
ZCT coord
 
Color strokeColor
 
Color fillColor
 
bool isFilled = false
 
string id = ""
 
string roiID = ""
 
string roiName = ""
 
string properties = ""
 
int serie = 0
 
double strokeWidth = 1
 
int shapeIndex = 0
 
bool closed = false
 
bool subPixel = false
 

Static Public Attributes

static float selectBoxSize = 8f
 

Properties

PointD Point [get, set]
 
RectangleD Rect [get, set]
 
double X [get, set]
 
double Y [get, set]
 
double W [get, set]
 
double H [get, set]
 
int Resolution [get, set]
 
List< PointD > PointsD [get]
 
PointD[] PointsImage [get]
 
bool Selected [get, set]
 
Mask roiMask [get, set]
 
string Text [get, set]
 

Member Enumeration Documentation

◆ CoordinateSystem

Enumerator
pixel 
micron 

◆ Type

Enumerator
Rectangle 
Point 
Line 
Polygon 
Polyline 
Freeform 
Ellipse 
Label 
Mask 
394 {
395 Rectangle,
396 Point,
397 Line,
398 Polygon,
399 Polyline,
400 Freeform,
401 Ellipse,
402 Label,
403 Mask
404 }
PointD Point
Definition Bio.cs:407

Constructor & Destructor Documentation

◆ ROI()

BioGTK.ROI.ROI ( )
inline
833 {
834 coord = new ZCT(0, 0, 0);
835 strokeColor = Color.Yellow;
836 BoundingBox = new RectangleD(0, 0, 1, 1);
837 }
AForge.Color Color
Definition Bio.cs:22
RectangleD BoundingBox
Definition Bio.cs:539
ZCT coord
Definition Bio.cs:544
Color strokeColor
Definition Bio.cs:545

Member Function Documentation

◆ AddPoint()

void BioGTK.ROI.AddPoint ( PointD  p)
inline

‍Adds a point to the list of points and updates the bounding box

Parameters
PointD
1018 {
1019 Points.Add(p);
1021 }
void UpdateBoundingBox()
Definition Bio.cs:1125

◆ AddPoints() [1/3]

void BioGTK.ROI.AddPoints ( float[]  xp,
float[]  yp 
)
inline

‍Adds a range of float points to the Points collection and updates the bounding box

Parameters
pThe points to add to the polygon
1045 {
1046 for (int i = 0; i < xp.Length; i++)
1047 {
1048 Points.Add(new PointD(xp[i], yp[i]));
1049 }
1051 }

◆ AddPoints() [2/3]

void BioGTK.ROI.AddPoints ( int[]  xp,
int[]  yp 
)
inline

‍Adds a range of integer points to the Points collection and updates the bounding box

Parameters
pThe points to add to the polygon
1034 {
1035 for (int i = 0; i < xp.Length; i++)
1036 {
1037 Points.Add(new PointD(xp[i], yp[i]));
1038 }
1040 }

◆ AddPoints() [3/3]

void BioGTK.ROI.AddPoints ( PointD[]  p)
inline

‍Adds a range of points to the Points collection and updates the bounding box

Parameters
pThe points to add to the polygon
1026 {
1027 Points.AddRange(p);
1029 }

◆ ClearPoints()

void BioGTK.ROI.ClearPoints ( )
inline
1073 {
1074 Points.Clear();
1075 }

◆ Copy() [1/2]

ROI BioGTK.ROI.Copy ( )
inline
753 {
754 ROI copy = new ROI();
755 copy.id = id;
756 copy.roiID = roiID;
757 copy.roiName = roiName;
758 copy.text = text;
759 copy.strokeWidth = strokeWidth;
760 copy.strokeColor = strokeColor;
761 copy.fillColor = fillColor;
762 copy.Points = Points;
763 copy.Selected = Selected;
764 copy.shapeIndex = shapeIndex;
765 copy.closed = closed;
766 copy.family = family;
767 copy.fontSize = fontSize;
768 copy.slant = slant;
769 copy.selectBoxs = selectBoxs;
770 copy.BoundingBox = BoundingBox;
771 copy.isFilled = isFilled;
772 copy.coord = coord;
773 copy.selectedPoints = selectedPoints;
774
775 return copy;
776 }
string id
Definition Bio.cs:548
float fontSize
Definition Bio.cs:540
int shapeIndex
Definition Bio.cs:556
Cairo.FontSlant slant
Definition Bio.cs:541
string family
Definition Bio.cs:543
ROI()
Definition Bio.cs:832
Color fillColor
Definition Bio.cs:546
bool closed
Definition Bio.cs:557
string roiID
Definition Bio.cs:549
bool Selected
Definition Bio.cs:560
string roiName
Definition Bio.cs:550
List< int > selectedPoints
Definition Bio.cs:538
bool isFilled
Definition Bio.cs:547
double strokeWidth
Definition Bio.cs:555

◆ Copy() [2/2]

ROI BioGTK.ROI.Copy ( ZCT  cord)
inline
778 {
779 ROI copy = new ROI();
780 copy.type = type;
781 copy.id = id;
782 copy.roiID = roiID;
783 copy.roiName = roiName;
784 copy.text = text;
785 copy.strokeWidth = strokeWidth;
786 copy.strokeColor = strokeColor;
787 copy.fillColor = fillColor;
788 copy.Points.AddRange(Points);
789 copy.Selected = Selected;
790 copy.shapeIndex = shapeIndex;
791 copy.closed = closed;
792 copy.family = family;
793 copy.fontSize = fontSize;
794 copy.slant = slant;
795 copy.selectBoxs.AddRange(selectBoxs);
796 copy.BoundingBox = BoundingBox;
797 copy.isFilled = isFilled;
798 copy.coord = cord;
799 copy.selectedPoints = selectedPoints;
800 return copy;
801 }
Type type
Definition Bio.cs:520

◆ CreateEllipse()

static ROI BioGTK.ROI.CreateEllipse ( ZCT  coord,
double  x,
double  y,
double  w,
double  h 
)
inlinestatic

Create an ellipse ROI at the specified ZCT coordinate with the specified width and height

Parameters
ZCTThe ZCT coordinates of the image you want to create the ROI on.
xx-coordinate of the top-left corner of the rectangle
yThe y-coordinate of the upper-left corner of the rectangle to create.
wwidth
hheight
Returns
A new ROI object.
917 {
918 ROI an = new ROI();
919 an.coord = coord;
920 an.type = Type.Ellipse;
921 an.Rect = new RectangleD(x, y, w, h);
922 Recorder.AddLine("ROI.CreateEllipse(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new RectangleD(" + x + "," + y + "," + w + "," + h + ");");
923 return an;
924 }
Type
Definition Bio.cs:394

◆ CreateFreeform()

static ROI BioGTK.ROI.CreateFreeform ( ZCT  coord,
PointD[]  pts 
)
inlinestatic

‍Create a new ROI object of type Freeform, with the specified ZCT coordinate and points

Parameters
ZCTA class that contains the Z, C, and T coordinates of the ROI.
ptsan array of PointD objects, which are just a pair of doubles (x,y)
Returns
A new ROI object.
947 {
948 ROI an = new ROI();
949 an.coord = coord;
950 an.type = Type.Freeform;
951 an.AddPoints(pts);
952 an.closed = true;
953 return an;
954 }

◆ CreateLine()

static ROI BioGTK.ROI.CreateLine ( ZCT  coord,
PointD  x1,
PointD  x2 
)
inlinestatic

Create a new ROI object, set its type to Line, add two points to it, and return it

Parameters
ZCTZ is the Z-axis, C is the color channel, and T is the time frame.
PointDX,Y
PointDX,Y
Returns
A new ROI object.
880 {
881 ROI an = new ROI();
882 an.coord = coord;
883 an.type = Type.Line;
884 an.AddPoint(x1);
885 an.AddPoint(x2);
886 Recorder.AddLine("ROI.CreateLine(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new PointD(" + x1.X + "," + x1.Y + "), new PointD(" + x2.X + "," + x2.Y + "));");
887 return an;
888 }

◆ CreateMask() [1/2]

static ROI BioGTK.ROI.CreateMask ( ZCT  coord,
byte[]  mask,
int  width,
int  height,
PointD  loc,
double  physicalX,
double  physicalY 
)
inlinestatic
965 {
966 ROI an = new ROI();
967 an.coord = coord;
968 an.type = Type.Mask;
969 an.roiMask = new Mask(mask, width, height, physicalX, physicalY);
970 an.AddPoint(loc);
971 return an;
972 }

◆ CreateMask() [2/2]

static ROI BioGTK.ROI.CreateMask ( ZCT  coord,
float[]  mask,
int  width,
int  height,
PointD  loc,
double  physicalX,
double  physicalY 
)
inlinestatic
956 {
957 ROI an = new ROI();
958 an.coord = coord;
959 an.type = Type.Mask;
960 an.roiMask = new Mask(mask, width, height,physicalX,physicalY);
961 an.AddPoint(loc);
962 return an;
963 }

◆ CreatePoint()

static ROI BioGTK.ROI.CreatePoint ( ZCT  coord,
double  x,
double  y 
)
inlinestatic

Create a new ROI object, add a point to it, and return it

Parameters
ZCTa class that contains the Z, C, and T coordinates of the image.
xx coordinate of the point
yThe y coordinate of the point
Returns
A new ROI object
863 {
864 ROI an = new ROI();
865 an.coord = coord;
866 an.AddPoint(new PointD(x, y));
867 an.type = Type.Point;
868 Recorder.AddLine("ROI.CreatePoint(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), " + x + "," + y + ");");
869 return an;
870 }

◆ CreatePolygon()

static ROI BioGTK.ROI.CreatePolygon ( ZCT  coord,
PointD[]  pts 
)
inlinestatic

‍Create a new ROI object of type Polygon, with the given coordinate system and points

Parameters
ZCTThe ZCT coordinate of the ROI.
ptsan array of PointD objects, which are just a pair of doubles (x,y)
Returns
A ROI object
932 {
933 ROI an = new ROI();
934 an.coord = coord;
935 an.type = Type.Polygon;
936 an.AddPoints(pts);
937 an.closed = true;
938 return an;
939 }

◆ CreateRectangle()

static ROI BioGTK.ROI.CreateRectangle ( ZCT  coord,
double  x,
double  y,
double  w,
double  h 
)
inlinestatic

Create a new ROI object with a rectangle shape, and add a line to the recorder

Parameters
ZCTThe ZCT coordinates of the image you want to create the ROI on.
xx coordinate of the top left corner of the rectangle
yy-coordinate of the top-left corner of the rectangle
wwidth
hheight
Returns
A new ROI object.
899 {
900 ROI an = new ROI();
901 an.coord = coord;
902 an.type = Type.Rectangle;
903 an.Rect = new RectangleD(x, y, w, h);
904 Recorder.AddLine("ROI.CreateRectangle(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new RectangleD(" + x + "," + y + "," + w + "," + h + ");");
905 return an;
906 }

◆ Dispose()

void BioGTK.ROI.Dispose ( )
inline
1180 {
1181 if(roiMask!=null)
1182 {
1183 roiMask.Dispose();
1184 }
1185 }
void Dispose()
Definition Bio.cs:734
Mask roiMask
Definition Bio.cs:570

◆ GetPoint()

PointD BioGTK.ROI.GetPoint ( int  i)
inline

This function returns the point at the specified index

Parameters
iThe index of the point to get.
Returns
The point at index i in the Points array.
991 {
992 return Points[i];
993 }

◆ GetPointCount()

int BioGTK.ROI.GetPointCount ( )
inline

This function returns the number of points in the polygon

Returns
The number of points in the list.
1080 {
1081 return Points.Count;
1082 }

◆ GetPoints()

PointD[] BioGTK.ROI.GetPoints ( )
inline

It returns an array of PointD objects

Returns
An array of PointD objects.
998 {
999 return Points.ToArray();
1000 }

◆ GetPointsF()

PointF[] BioGTK.ROI.GetPointsF ( )
inline

It converts a list of points to an array of points

Returns
A PointF array.
1005 {
1006 PointF[] pfs = new PointF[Points.Count];
1007 for (int i = 0; i < Points.Count; i++)
1008 {
1009 pfs[i].X = (float)Points[i].X;
1010 pfs[i].Y = (float)Points[i].Y;
1011 }
1012 return pfs;
1013 }
AForge.PointF PointF
Definition ImageView.cs:11
double X
Definition Bio.cs:457
double Y
Definition Bio.cs:469

◆ GetSelectBound()

RectangleD BioGTK.ROI.GetSelectBound ( double  scaleX,
double  scaleY 
)
inline

‍This function returns a rectangle that is the bounding box of the object, but with a

border of half the scale

Parameters
scalethe scale of the image
Returns
A rectangle with the following properties:
824 {
825 if (type == Type.Mask)
826 return BoundingBox;
827 double fx = scaleX / 2;
828 double fy = scaleY / 2;
829 return new RectangleD(BoundingBox.X - fx, BoundingBox.Y - fy, BoundingBox.W + scaleX, BoundingBox.H + scaleY);
830 }
double W
Definition Bio.cs:316
double X
Definition Bio.cs:314
double Y
Definition Bio.cs:315
double H
Definition Bio.cs:317

◆ GetSelectBoxes()

RectangleD[] BioGTK.ROI.GetSelectBoxes ( double  s)
inline

It returns an array of RectangleF objects that are used to draw the selection boxes around the points of the polygon

Parameters
sthe size of the select box
Returns
A list of RectangleF objects.
846 {
847 double f = s / 2;
848 selectBoxs.Clear();
849 for (int i = 0; i < Points.Count; i++)
850 {
851 selectBoxs.Add(new RectangleD((float)(Points[i].X - f), (float)(Points[i].Y - f), (float)s, (float)s));
852 }
853 return selectBoxs.ToArray();
854 }

◆ PointsToString()

string BioGTK.ROI.PointsToString ( BioImage  b)
inline

This function takes a BioImage object and returns a string of the points in the image space

Parameters
BioImageThe image that the ROI is on
Returns
The points of the polygon in the image space.
1111 {
1112 string pts = "";
1113 PointD[] ps = b.ToImageSpace(Points);
1114 for (int j = 0; j < ps.Length; j++)
1115 {
1116 if (j == ps.Length - 1)
1117 pts += ps[j].X.ToString(CultureInfo.InvariantCulture) + "," + ps[j].Y.ToString(CultureInfo.InvariantCulture);
1118 else
1119 pts += ps[j].X.ToString(CultureInfo.InvariantCulture) + "," + ps[j].Y.ToString(CultureInfo.InvariantCulture) + " ";
1120 }
1121 return pts;
1122 }

◆ RemovePoints()

void BioGTK.ROI.RemovePoints ( int[]  indexs)
inline

It removes points from a list of points based on an array of indexes

Parameters
indexsan array of integers that represent the indexes of the points to be removed
1056 {
1057 List<PointD> inds = new List<PointD>();
1058 for (int i = 0; i < Points.Count; i++)
1059 {
1060 bool found = false;
1061 for (int ind = 0; ind < indexs.Length; ind++)
1062 {
1063 if (indexs[ind] == i)
1064 found = true;
1065 }
1066 if (!found)
1067 inds.Add(Points[i]);
1068 }
1069 Points = inds;
1071 }

◆ stringToPoints()

PointD[] BioGTK.ROI.stringToPoints ( string  s)
inline

It takes a string of points and returns an array of points

Parameters
sThe string to convert to points.
Returns
A list of points.
1089 {
1090 List<PointD> pts = new List<PointD>();
1091 string[] ints = s.Split(' ');
1092 for (int i = 0; i < ints.Length; i++)
1093 {
1094 string[] sints;
1095 if (s.Contains("\t"))
1096 sints = ints[i].Split('\t');
1097 else
1098 sints = ints[i].Split(',');
1099 double x = double.Parse(sints[0], CultureInfo.InvariantCulture);
1100 double y = double.Parse(sints[1], CultureInfo.InvariantCulture);
1101 pts.Add(new PointD(x, y));
1102 }
1103 return pts.ToArray();
1104 }

◆ ToString()

override string BioGTK.ROI.ToString ( )
inline
1187 {
1188 double w = Math.Round(W, 2, MidpointRounding.ToZero);
1189 double h = Math.Round(H, 2, MidpointRounding.ToZero);
1190 double x = Math.Round(Point.X, 2, MidpointRounding.ToZero);
1191 double y = Math.Round(Point.Y, 2, MidpointRounding.ToZero);
1192 return type.ToString() + ", " + Text + " (" + w + ", " + h + ") " + " (" + x + ", " + y + ") " + coord.ToString();
1193 }
AForge.Point Point
Definition ImageView.cs:10
double H
Definition Bio.cs:496
string Text
Definition Bio.cs:803
double W
Definition Bio.cs:481

◆ UpdateBoundingBox()

void BioGTK.ROI.UpdateBoundingBox ( )
inline

It takes a list of points and returns a rectangle that contains all of the points

1126 {
1127 if(type == Type.Mask)
1128 {
1129 double minx = double.MaxValue;
1130 double miny = double.MaxValue;
1131 double maxx = double.MinValue;
1132 double maxy = double.MinValue;
1133 for (int y = 0; y < roiMask.Height; y++)
1134 {
1135 for (int x = 0; x < roiMask.Width; x++)
1136 {
1137 if (roiMask.IsSelected(x, y))
1138 {
1139 if (minx > x)
1140 minx = x;
1141 if (miny > y)
1142 miny = y;
1143 if (maxx < x)
1144 maxx = x;
1145 if (maxy < y)
1146 maxy = y;
1147 }
1148 }
1149 }
1150 BoundingBox = new RectangleD(PointsD[0].X + (minx * roiMask.PhysicalSizeX), PointsD[0].Y + (miny * roiMask.PhysicalSizeY),
1151 (maxx - minx) * roiMask.PhysicalSizeX, (maxy - miny) * roiMask.PhysicalSizeY);
1152 return;
1153 }
1154 PointD min = new PointD(double.MaxValue, double.MaxValue);
1155 PointD max = new PointD(double.MinValue, double.MinValue);
1156 foreach (PointD p in Points)
1157 {
1158 if (min.X > p.X)
1159 min.X = p.X;
1160 if (min.Y > p.Y)
1161 min.Y = p.Y;
1162
1163 if (max.X < p.X)
1164 max.X = p.X;
1165 if (max.Y < p.Y)
1166 max.Y = p.Y;
1167 }
1168 RectangleD r = new RectangleD();
1169 r.X = min.X;
1170 r.Y = min.Y;
1171 r.W = max.X - min.X;
1172 r.H = max.Y - min.Y;
1173 if (r.W == 0)
1174 r.W = 1;
1175 if (r.H == 0)
1176 r.H = 1;
1177 BoundingBox = r;
1178 }
int Width
Definition Bio.cs:580
bool IsSelected(int x, int y)
Definition Bio.cs:601
int Height
Definition Bio.cs:581
double PhysicalSizeX
Definition Bio.cs:582
double PhysicalSizeY
Definition Bio.cs:583
List< PointD > PointsD
Definition Bio.cs:524

◆ UpdatePoint()

void BioGTK.ROI.UpdatePoint ( PointD  p,
int  i 
)
inline

This function updates the point at the specified index

Parameters
PointDA class that contains an X and Y coordinate.
iThe index of the point to update
978 {
979 if (i < Points.Count)
980 {
981 Points[i] = p;
982 }
984 }

Member Data Documentation

◆ BoundingBox

RectangleD BioGTK.ROI.BoundingBox

◆ closed

bool BioGTK.ROI.closed = false

◆ coord

ZCT BioGTK.ROI.coord

◆ family

string BioGTK.ROI.family = "Times New Roman"

◆ fillColor

Color BioGTK.ROI.fillColor

◆ fontSize

float BioGTK.ROI.fontSize = 12

◆ id

string BioGTK.ROI.id = ""

◆ isFilled

bool BioGTK.ROI.isFilled = false

◆ properties

string BioGTK.ROI.properties = ""

◆ roiID

string BioGTK.ROI.roiID = ""

◆ roiName

string BioGTK.ROI.roiName = ""

◆ selectBoxSize

float BioGTK.ROI.selectBoxSize = 8f
static

◆ selectedPoints

List<int> BioGTK.ROI.selectedPoints = new List<int>()

◆ serie

int BioGTK.ROI.serie = 0

◆ shapeIndex

int BioGTK.ROI.shapeIndex = 0

◆ slant

Cairo.FontSlant BioGTK.ROI.slant

◆ strokeColor

Color BioGTK.ROI.strokeColor

◆ strokeWidth

double BioGTK.ROI.strokeWidth = 1

◆ subPixel

bool BioGTK.ROI.subPixel = false

◆ type

Type BioGTK.ROI.type

◆ weight

Cairo.FontWeight BioGTK.ROI.weight

Property Documentation

◆ H

double BioGTK.ROI.H
getset
496 {
497 get
498 {
499 if (type == Type.Point)
500 return strokeWidth;
501 else
502 return BoundingBox.H;
503 }
504 set
505 {
506 Rect = new RectangleD(X, Y, W, value);
507 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
508 }
509 }
RectangleD Rect
Definition Bio.cs:419

◆ Point

PointD BioGTK.ROI.Point
getset
407 {
408 get
409 {
410 return Points[0];
411 }
412 set
413 {
414 UpdatePoint(value, 0);
416 }
417 }
void UpdatePoint(PointD p, int i)
Definition Bio.cs:977

◆ PointsD

List<PointD> BioGTK.ROI.PointsD
get
524 {
525 get
526 {
527 return Points;
528 }
529 }

◆ PointsImage

PointD [] BioGTK.ROI.PointsImage
get
531 {
532 get
533 {
535 }
536 }
PointD ToImageSpace(PointD p)
Definition Bio.cs:3450
Definition ImageView.cs:23
static BioImage SelectedImage
Definition ImageView.cs:1559

◆ Rect

RectangleD BioGTK.ROI.Rect
getset
419 {
420 get
421 {
422 if (Points.Count == 0)
423 return new RectangleD(0, 0, 0, 0);
424 if (type == Type.Line || type == Type.Polyline || type == Type.Polygon || type == Type.Freeform || type == Type.Label)
425 return BoundingBox;
426 if (type == Type.Rectangle || type == Type.Ellipse)
427 return new RectangleD(Points[0].X, Points[0].Y, Points[1].X - Points[0].X, Points[2].Y - Points[0].Y);
428 else
429 return new RectangleD(Points[0].X, Points[0].Y, 1, 1);
430 }
431 set
432 {
433 if (type == Type.Line || type == Type.Polyline || type == Type.Polygon || type == Type.Freeform)
434 {
435 BoundingBox = value;
436 }
437 else
438 if (Points.Count < 4 && (type == Type.Rectangle || type == Type.Ellipse))
439 {
440 AddPoint(new PointD(value.X, value.Y));
441 AddPoint(new PointD(value.X + value.W, value.Y));
442 AddPoint(new PointD(value.X, value.Y + value.H));
443 AddPoint(new PointD(value.X + value.W, value.Y + value.H));
444 }
445 else
446 if (type == Type.Rectangle || type == Type.Ellipse)
447 {
448 Points[0] = new PointD(value.X, value.Y);
449 Points[1] = new PointD(value.X + value.W, value.Y);
450 Points[2] = new PointD(value.X, value.Y + value.H);
451 Points[3] = new PointD(value.X + value.W, value.Y + value.H);
452 }
454 }
455 }
void AddPoint(PointD p)
Definition Bio.cs:1017

◆ Resolution

int BioGTK.ROI.Resolution
getset
511 {
512 get { return resolution; }
513 set { resolution = value; }
514 }

◆ roiMask

Mask BioGTK.ROI.roiMask
getset
570{ get; set; }

◆ Selected

bool BioGTK.ROI.Selected
getset
560 {
561 get { return selected; }
562 set
563 {
564 if (roiMask != null)
565 roiMask.Selected = value;
566 selected = value;
567 }
568 }

◆ Text

string BioGTK.ROI.Text
getset
803 {
804 get
805 {
806 return text;
807 }
808 set
809 {
810 text = value;
811 if (type == Type.Label)
812 {
814 }
815 }
816 }

◆ W

double BioGTK.ROI.W
getset
481 {
482 get
483 {
484 if (type == Type.Point)
485 return strokeWidth;
486 else
487 return BoundingBox.W;
488 }
489 set
490 {
491 Rect = new RectangleD(X, Y, value, H);
492 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
493 }
494 }

◆ X

double BioGTK.ROI.X
getset
457 {
458 get
459 {
460 return Point.X;
461 }
462 set
463 {
464 Rect = new RectangleD(value, Y, W, H);
465 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
466 }
467 }

◆ Y

double BioGTK.ROI.Y
getset
469 {
470 get
471 {
472 return Point.Y;
473 }
474 set
475 {
476 Rect = new RectangleD(X, value, W, H);
477 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
478 }
479 }

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