BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
BioImager.ROI Class Reference

Classes

class  Mask
 Represents a Mask layer. More...
 

Public Types

enum  Type
 

Public Member Functions

ROI Copy ()
 
ROI Copy (ZCT cord)
 
RectangleD GetSelectBound (double scaleX, double scaleY)
 
RectangleD[] GetSelectBoxes ()
 
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 (float[] xp, float[] yp)
 
void AddPoints (int[] xp, int[] yp)
 
void RemovePoints (int[] indexs)
 
int GetPointCount ()
 
PointD[] stringToPoints (string s)
 
string PointsToString (BioImage b)
 
void UpdateBoundingBox ()
 
override string ToString ()
 

Static Public Member Functions

static ROI CreatePoint (ZCT coord, double x, double y)
 
static ROI CreatePoint (int s, int z, int c, int t, 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
 
Font font = System.Drawing.SystemFonts.DefaultFont
 
ZCT coord
 
System.Drawing.Color strokeColor
 
System.Drawing.Color fillColor
 
bool isFilled = false
 
string id = ""
 
string roiID = ""
 
string roiName = ""
 
int serie = 0
 
string properties
 
double strokeWidth = 1
 
float fontSize = 8
 
string family = ""
 
int shapeIndex = 0
 
bool closed = false
 
bool selected = 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]
 
List< PointD > PointsD [get]
 
PointD[] PointsImage [get]
 
string Text [get, set]
 
System.Drawing.Size TextSize [get]
 
Mask roiMask [get, set]
 

Detailed Description

Definition at line 292 of file Bio.cs.

Member Enumeration Documentation

◆ Type

enum BioImager.ROI.Type

Definition at line 294 of file Bio.cs.

295 {
296 Rectangle,
297 Point,
298 Line,
299 Polygon,
300 Polyline,
301 Freeform,
302 Ellipse,
303 Label,
304 Mask
305 }

Constructor & Destructor Documentation

◆ ROI()

BioImager.ROI.ROI ( )

Definition at line 711 of file Bio.cs.

712 {
713 coord = new ZCT(0, 0, 0);
714 strokeColor = System.Drawing.Color.Yellow;
715 font = SystemFonts.DefaultFont;
716 BoundingBox = new RectangleD(0, 0, 1, 1);
717 }

Member Function Documentation

◆ AddPoint()

void BioImager.ROI.AddPoint ( PointD  p)

This function adds a point to the list of points that make up the polygon

Parameters
PointD

Definition at line 934 of file Bio.cs.

935 {
936 Points.Add(p);
938 }
void UpdateBoundingBox()
Definition: Bio.cs:1038

References BioImager.ROI.UpdateBoundingBox().

Referenced by BioImager.ROI.CreateLine(), BioImager.ROI.CreatePoint(), BioImager.BioImage.OpenOME(), BioImager.BioImage.OpenOMEROIs(), BioImager.Tools.ToolDown(), and BioImager.Tools.ToolUp().

◆ AddPoints() [1/3]

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

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

Parameters
pThe points to add to the polygon

Definition at line 950 of file Bio.cs.

951 {
952 for (int i = 0; i < xp.Length; i++)
953 {
954 Points.Add(new PointD(xp[i], yp[i]));
955 }
957 }

References BioImager.ROI.UpdateBoundingBox().

◆ AddPoints() [2/3]

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

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

Parameters
pThe points to add to the polygon

Definition at line 961 of file Bio.cs.

962 {
963 for (int i = 0; i < xp.Length; i++)
964 {
965 Points.Add(new PointD(xp[i], yp[i]));
966 }
968 }

References BioImager.ROI.UpdateBoundingBox().

◆ AddPoints() [3/3]

void BioImager.ROI.AddPoints ( PointD[]  p)

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

Parameters
pThe points to add to the polygon

Definition at line 942 of file Bio.cs.

943 {
944 Points.AddRange(p);
946 }

References BioImager.ROI.UpdateBoundingBox().

Referenced by BioImager.ROI.CreateFreeform(), BioImager.ROI.CreatePolygon(), BioImager.BioImage.OpenOME(), BioImager.BioImage.OpenOMEROIs(), and BioImager.BioImage.StringToROI().

◆ Copy() [1/2]

ROI BioImager.ROI.Copy ( )

Copy() is a function that copies the values of the ROI object to a new ROI object

Returns
A copy of the ROI object.

Definition at line 463 of file Bio.cs.

464 {
465 ROI copy = new ROI();
466 copy.id = id;
467 copy.roiID = roiID;
468 copy.roiName = roiName;
469 copy.text = text;
470 copy.strokeWidth = strokeWidth;
471 copy.strokeColor = strokeColor;
472 copy.fillColor = fillColor;
473 copy.Points = Points;
474 copy.selected = selected;
475 copy.shapeIndex = shapeIndex;
476 copy.closed = closed;
477 copy.font = font;
478 copy.selectBoxs = selectBoxs;
479 copy.BoundingBox = BoundingBox;
480 copy.isFilled = isFilled;
481 copy.coord = coord;
482 copy.selectedPoints = selectedPoints;
483
484 return copy;
485 }

◆ Copy() [2/2]

ROI BioImager.ROI.Copy ( ZCT  cord)

Copy() is a function that copies the ROI object and returns a new ROI object

Parameters
ZCTA class that contains the coordinates of the image.
Returns
A copy of the ROI object.

Definition at line 491 of file Bio.cs.

492 {
493 ROI copy = new ROI();
494 copy.type = type;
495 copy.id = id;
496 copy.roiID = roiID;
497 copy.roiName = roiName;
498 copy.text = text;
499 copy.strokeWidth = strokeWidth;
500 copy.strokeColor = strokeColor;
501 copy.fillColor = fillColor;
502 copy.Points.AddRange(Points);
503 copy.selected = selected;
504 copy.shapeIndex = shapeIndex;
505 copy.closed = closed;
506 copy.font = font;
507 copy.selectBoxs.AddRange(selectBoxs);
508 copy.BoundingBox = BoundingBox;
509 copy.isFilled = isFilled;
510 copy.coord = cord;
511 copy.selectedPoints = selectedPoints;
512 return copy;
513 }

◆ CreateEllipse()

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

Create an ellipse ROI at the specified ZCT coordinate with the specified dimensions

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.

Definition at line 833 of file Bio.cs.

834 {
835 ROI an = new ROI();
836 an.coord = coord;
837 an.type = Type.Ellipse;
838 an.Rect = new RectangleD(x, y, w, h);
839 Recorder.AddLine("ROI.CreateEllipse(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new RectangleD(" + x + "," + y + "," + w + "," + h + ");");
840 return an;
841 }

Referenced by BioImager.ImageJ.RoiDecoder.getRoi().

◆ CreateFreeform()

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

‍Create a new ROI object of type Freeform, with the specified ZCT coordinates 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.

Definition at line 863 of file Bio.cs.

864 {
865 ROI an = new ROI();
866 an.coord = coord;
867 an.type = Type.Freeform;
868 an.AddPoints(pts);
869 an.closed = true;
870 return an;
871 }

References BioImager.ROI.AddPoints().

Referenced by BioImager.Tools.ToolUp().

◆ CreateLine()

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

Create a line ROI with the specified coordinates

Parameters
ZCTZ is the Z-axis, C is the color channel, and T is the time frame.
PointDA point in the image.
PointDA point in the image.
Returns
A new ROI object.

Definition at line 796 of file Bio.cs.

797 {
798 ROI an = new ROI();
799 an.coord = coord;
800 an.type = Type.Line;
801 an.AddPoint(x1);
802 an.AddPoint(x2);
803 Recorder.AddLine("ROI.CreateLine(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new PointD(" + x1.X + "," + x1.Y + "), new PointD(" + x2.X + "," + x2.Y + "));");
804 return an;
805 }

References BioImager.ROI.AddPoint().

Referenced by BioImager.ImageJ.RoiDecoder.getRoi().

◆ CreateMask() [1/2]

static ROI BioImager.ROI.CreateMask ( ZCT  coord,
byte[]  mask,
int  width,
int  height,
PointD  loc,
double  physicalX,
double  physicalY 
)
static

Definition at line 881 of file Bio.cs.

882 {
883 ROI an = new ROI();
884 an.coord = coord;
885 an.type = Type.Mask;
886 an.roiMask = new Mask(mask, width, height, physicalX, physicalY);
887 an.AddPoint(loc);
888 return an;
889 }

◆ CreateMask() [2/2]

static ROI BioImager.ROI.CreateMask ( ZCT  coord,
float[]  mask,
int  width,
int  height,
PointD  loc,
double  physicalX,
double  physicalY 
)
static

Definition at line 872 of file Bio.cs.

873 {
874 ROI an = new ROI();
875 an.coord = coord;
876 an.type = Type.Mask;
877 an.roiMask = new Mask(mask, width, height, physicalX, physicalY);
878 an.AddPoint(loc);
879 return an;
880 }

◆ CreatePoint() [1/2]

static ROI BioImager.ROI.CreatePoint ( int  s,
int  z,
int  c,
int  t,
double  x,
double  y 
)
static

Create a point ROI at the specified ZCT coordinates and x,y coordinates

Parameters
sseries
zthe z-slice of the image
cchannel
ttimepoint
xx coordinate of the point
yy-coordinate of the point
Returns
A point ROI

Definition at line 785 of file Bio.cs.

786 {
787 return CreatePoint(new ZCT(z, c, t), x, y);
788 }
static ROI CreatePoint(ZCT coord, double x, double y)
Definition: Bio.cs:766

References BioImager.ROI.CreatePoint().

◆ CreatePoint() [2/2]

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

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

Definition at line 766 of file Bio.cs.

767 {
768 ROI an = new ROI();
769 an.coord = coord;
770 an.AddPoint(new PointD(x, y));
771 an.type = Type.Point;
772 Recorder.AddLine("ROI.CreatePoint(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), " + x + "," + y + ");");
773 return an;
774 }

References BioImager.ROI.AddPoint().

Referenced by BioImager.ROI.CreatePoint().

◆ CreatePolygon()

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

‍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

Definition at line 848 of file Bio.cs.

849 {
850 ROI an = new ROI();
851 an.coord = coord;
852 an.type = Type.Polygon;
853 an.AddPoints(pts);
854 an.closed = true;
855 return an;
856 }

References BioImager.ROI.AddPoints().

◆ CreateRectangle()

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

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.

Definition at line 815 of file Bio.cs.

816 {
817 ROI an = new ROI();
818 an.coord = coord;
819 an.type = Type.Rectangle;
820 an.Rect = new RectangleD(x, y, w, h);
821 Recorder.AddLine("ROI.CreateRectangle(new ZCT(" + coord.Z + "," + coord.C + "," + coord.T + "), new RectangleD(" + x + "," + y + "," + w + "," + h + ");");
822 return an;
823 }

Referenced by BioImager.ImageJ.RoiDecoder.getRoi().

◆ GetPoint()

PointD BioImager.ROI.GetPoint ( int  i)

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.

Definition at line 907 of file Bio.cs.

908 {
909 return Points[i];
910 }

Referenced by BioImager.ImageView.RenderFrame(), and BioImager.BioImage.SaveOMESeries().

◆ GetPointCount()

int BioImager.ROI.GetPointCount ( )

This function returns the number of points in the polygon

Returns
The number of points in the list.

Definition at line 992 of file Bio.cs.

993 {
994 return Points.Count;
995 }

Referenced by BioImager.ImageView.RenderFrame(), BioImager.Tools.ToolDown(), and BioImager.Tools.ToolUp().

◆ GetPoints()

PointD[] BioImager.ROI.GetPoints ( )

It returns an array of PointD objects

Returns
An array of PointD objects.

Definition at line 914 of file Bio.cs.

915 {
916 return Points.ToArray();
917 }

Referenced by BioImager.BioImage.ROIToString().

◆ GetPointsF()

PointF[] BioImager.ROI.GetPointsF ( )

It converts a list of points to an array of points

Returns
A PointF array.

Definition at line 921 of file Bio.cs.

922 {
923 PointF[] pfs = new PointF[Points.Count];
924 for (int i = 0; i < Points.Count; i++)
925 {
926 pfs[i].X = (float)Points[i].X;
927 pfs[i].Y = (float)Points[i].Y;
928 }
929 return pfs;
930 }

◆ GetSelectBound()

RectangleD BioImager.ROI.GetSelectBound ( double  scaleX,
double  scaleY 
)

‍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:

Definition at line 724 of file Bio.cs.

725 {
726 double fx = scaleX / 2;
727 double fy = scaleY / 2;
728 return new RectangleD(BoundingBox.X - fx, BoundingBox.Y - fy, BoundingBox.W + scaleX, BoundingBox.H + scaleY);
729 }

Referenced by BioImager.Tools.ToolUp().

◆ GetSelectBoxes() [1/2]

RectangleD[] BioImager.ROI.GetSelectBoxes ( )

It creates a list of rectangles, each rectangle is a square with a side length of ROI.selectBoxSize, and the center of the square is the point in the list of points

Returns
A list of RectangleF objects.

Definition at line 734 of file Bio.cs.

735 {
736 selectBoxs.Clear();
737 for (int i = 0; i < Points.Count; i++)
738 {
739 selectBoxs.Add(new RectangleD((Points[i].X), (Points[i].Y), ROI.selectBoxSize, ROI.selectBoxSize));
740 }
741 return selectBoxs.ToArray();
742 }

Referenced by BioImager.ImageView.RenderFrame(), and BioImager.Tools.ToolUp().

◆ GetSelectBoxes() [2/2]

RectangleD[] BioImager.ROI.GetSelectBoxes ( double  s)

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.

Definition at line 749 of file Bio.cs.

750 {
751 double f = s / 2;
752 selectBoxs.Clear();
753 for (int i = 0; i < Points.Count; i++)
754 {
755 selectBoxs.Add(new RectangleD((float)(Points[i].X - f), (float)(Points[i].Y - f), (float)s, (float)s));
756 }
757 return selectBoxs.ToArray();
758 }

◆ PointsToString()

string BioImager.ROI.PointsToString ( BioImage  b)

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.

Definition at line 1023 of file Bio.cs.

1024 {
1025 string pts = "";
1026 PointD[] ps = b.ToImageSpace(Points);
1027 for (int j = 0; j < ps.Length; j++)
1028 {
1029 if (j == ps.Length - 1)
1030 pts += ps[j].X.ToString() + "," + ps[j].Y.ToString();
1031 else
1032 pts += ps[j].X.ToString() + "," + ps[j].Y.ToString() + " ";
1033 }
1034 return pts;
1035 }

References BioImager.BioImage.ToImageSpace().

Referenced by BioImager.BioImage.SaveOMESeries().

◆ RemovePoints()

void BioImager.ROI.RemovePoints ( int[]  indexs)

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

Definition at line 972 of file Bio.cs.

973 {
974 List<PointD> inds = new List<PointD>();
975 for (int i = 0; i < Points.Count; i++)
976 {
977 bool found = false;
978 for (int ind = 0; ind < indexs.Length; ind++)
979 {
980 if (indexs[ind] == i)
981 found = true;
982 }
983 if (!found)
984 inds.Add(Points[i]);
985 }
986 Points = inds;
988 }

References BioImager.ROI.UpdateBoundingBox().

Referenced by BioImager.Tools.ToolDown().

◆ stringToPoints()

PointD[] BioImager.ROI.stringToPoints ( string  s)

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

Parameters
sThe string to convert to points.
Returns
A list of points.

Definition at line 1001 of file Bio.cs.

1002 {
1003 List<PointD> pts = new List<PointD>();
1004 string[] ints = s.Split(' ');
1005 for (int i = 0; i < ints.Length; i++)
1006 {
1007 string[] sints;
1008 if (s.Contains("\t"))
1009 sints = ints[i].Split('\t');
1010 else
1011 sints = ints[i].Split(',');
1012 double x = double.Parse(sints[0]);
1013 double y = double.Parse(sints[1]);
1014 pts.Add(new PointD(x, y));
1015 }
1016 return pts.ToArray();
1017 }

Referenced by BioImager.BioImage.OpenOME(), BioImager.BioImage.OpenOMEROIs(), and BioImager.BioImage.StringToROI().

◆ ToString()

override string BioImager.ROI.ToString ( )

It returns a string that contains the type of the object, the text, the width and height, and the coordinates of the object

Returns
The type of the object, the text, the width, the height, the point, and the coordinates.

Definition at line 1081 of file Bio.cs.

1082 {
1083 return type.ToString() + ", " + Text + " (" + W + ", " + H + "); " + " (" + Point.X + ", " + Point.Y + ") " + coord.ToString();
1084 }

◆ UpdateBoundingBox()

void BioImager.ROI.UpdateBoundingBox ( )

It takes the minimum and maximum X and Y values of the points in the shape and uses them to create a bounding box

Definition at line 1038 of file Bio.cs.

1039 {
1040 if (type == Type.Label)
1041 {
1042 if (text != "")
1043 {
1044 System.Drawing.Size s = TextSize;
1045 BoundingBox = new RectangleD(Points[0].X, Points[0].Y, s.Width, s.Height);
1046 }
1047 }
1048 else
1049 {
1050 PointD min = new PointD(double.MaxValue, double.MaxValue);
1051 PointD max = new PointD(double.MinValue, double.MinValue);
1052 foreach (PointD p in Points)
1053 {
1054 if (min.X > p.X)
1055 min.X = p.X;
1056 if (min.Y > p.Y)
1057 min.Y = p.Y;
1058
1059 if (max.X < p.X)
1060 max.X = p.X;
1061 if (max.Y < p.Y)
1062 max.Y = p.Y;
1063 }
1064 RectangleD r = new RectangleD();
1065 r.X = min.X;
1066 r.Y = min.Y;
1067 r.W = max.X - min.X;
1068 r.H = max.Y - min.Y;
1069 if (r.W == 0)
1070 r.W = 1;
1071 if (r.H == 0)
1072 r.H = 1;
1073 BoundingBox = r;
1074 }
1075 }

Referenced by BioImager.ROI.AddPoint(), BioImager.ROI.AddPoints(), BioImager.ROI.RemovePoints(), and BioImager.ROI.UpdatePoint().

◆ UpdatePoint()

void BioImager.ROI.UpdatePoint ( PointD  p,
int  i 
)

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

Definition at line 894 of file Bio.cs.

895 {
896 if (i < Points.Count)
897 {
898 Points[i] = p;
899 }
901 }

References BioImager.ROI.UpdateBoundingBox().

Referenced by BioImager.Tools.ToolUp().

Member Data Documentation

◆ BoundingBox

RectangleD BioImager.ROI.BoundingBox

Definition at line 435 of file Bio.cs.

◆ closed

bool BioImager.ROI.closed = false

Definition at line 451 of file Bio.cs.

◆ coord

ZCT BioImager.ROI.coord

Definition at line 437 of file Bio.cs.

◆ family

string BioImager.ROI.family = ""

Definition at line 449 of file Bio.cs.

◆ fillColor

System.Drawing.Color BioImager.ROI.fillColor

Definition at line 439 of file Bio.cs.

◆ font

Font BioImager.ROI.font = System.Drawing.SystemFonts.DefaultFont

Definition at line 436 of file Bio.cs.

◆ fontSize

float BioImager.ROI.fontSize = 8

Definition at line 448 of file Bio.cs.

◆ id

string BioImager.ROI.id = ""

Definition at line 441 of file Bio.cs.

◆ isFilled

bool BioImager.ROI.isFilled = false

Definition at line 440 of file Bio.cs.

◆ properties

string BioImager.ROI.properties

Definition at line 446 of file Bio.cs.

◆ roiID

string BioImager.ROI.roiID = ""

Definition at line 442 of file Bio.cs.

◆ roiName

string BioImager.ROI.roiName = ""

Definition at line 443 of file Bio.cs.

◆ selectBoxSize

float BioImager.ROI.selectBoxSize = 8f
static

Definition at line 424 of file Bio.cs.

◆ selected

bool BioImager.ROI.selected = false

Definition at line 452 of file Bio.cs.

◆ selectedPoints

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

Definition at line 434 of file Bio.cs.

◆ serie

int BioImager.ROI.serie = 0

Definition at line 444 of file Bio.cs.

◆ shapeIndex

int BioImager.ROI.shapeIndex = 0

Definition at line 450 of file Bio.cs.

◆ strokeColor

System.Drawing.Color BioImager.ROI.strokeColor

Definition at line 438 of file Bio.cs.

◆ strokeWidth

double BioImager.ROI.strokeWidth = 1

Definition at line 447 of file Bio.cs.

◆ type

Type BioImager.ROI.type

Definition at line 423 of file Bio.cs.

Referenced by microscope.stages.linkam._CommsInfo.view_of_info().

Property Documentation

◆ H

double BioImager.ROI.H
getset

Definition at line 408 of file Bio.cs.

409 {
410 get
411 {
412 if (type == Type.Point)
413 return strokeWidth;
414 else
415 return BoundingBox.H;
416 }
417 set
418 {
419 Rect = new RectangleD(X, Y, W, value);
420 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
421 }
422 }

◆ Point

PointD BioImager.ROI.Point
getset

Definition at line 307 of file Bio.cs.

308 {
309 get
310 {
311 if (Points.Count == 0)
312 return new PointD(0, 0);
313 if (type == Type.Line || type == Type.Ellipse || type == Type.Label || type == Type.Freeform)
314 return new PointD(BoundingBox.X, BoundingBox.Y);
315 return Points[0];
316 }
317 set
318 {
319 if (Points.Count == 0)
320 {
321 AddPoint(value);
322 }
323 else
324 UpdatePoint(value, 0);
326 }
327 }
void UpdatePoint(PointD p, int i)
Definition: Bio.cs:894
void AddPoint(PointD p)
Definition: Bio.cs:934

◆ PointsD

List<PointD> BioImager.ROI.PointsD
get

Definition at line 426 of file Bio.cs.

427 {
428 get
429 {
430 return Points;
431 }
432 }

◆ PointsImage

PointD [] BioImager.ROI.PointsImage
get

Definition at line 453 of file Bio.cs.

454 {
455 get
456 {
457 return ImageView.SelectedImage.ToImageSpace(PointsD);
458 }
459 }

◆ Rect

RectangleD BioImager.ROI.Rect
getset

Definition at line 329 of file Bio.cs.

330 {
331 get
332 {
333 if (Points.Count == 0)
334 return new RectangleD(0, 0, 0, 0);
335 if (type == Type.Line || type == Type.Polyline || type == Type.Polygon || type == Type.Freeform || type == Type.Label)
336 return BoundingBox;
337 if (type == Type.Rectangle || type == Type.Ellipse)
338 return new RectangleD(Points[0].X, Points[0].Y, Points[1].X - Points[0].X, Points[2].Y - Points[0].Y);
339 else
340 return new RectangleD(Points[0].X, Points[0].Y, 1, 1);
341 }
342 set
343 {
344 if (type == Type.Line || type == Type.Polyline || type == Type.Polygon || type == Type.Freeform)
345 {
346 BoundingBox = value;
347 }
348 else
349 if (Points.Count < 4 && (type == Type.Rectangle || type == Type.Ellipse))
350 {
351 AddPoint(new PointD(value.X, value.Y));
352 AddPoint(new PointD(value.X + value.W, value.Y));
353 AddPoint(new PointD(value.X, value.Y + value.H));
354 AddPoint(new PointD(value.X + value.W, value.Y + value.H));
355 }
356 else
357 if (type == Type.Rectangle || type == Type.Ellipse)
358 {
359 Points[0] = new PointD(value.X, value.Y);
360 Points[1] = new PointD(value.X + value.W, value.Y);
361 Points[2] = new PointD(value.X, value.Y + value.H);
362 Points[3] = new PointD(value.X + value.W, value.Y + value.H);
363 }
365 }
366 }

◆ roiMask

Mask BioImager.ROI.roiMask
getset

Definition at line 537 of file Bio.cs.

537{ get; set; }

◆ Text

string BioImager.ROI.Text
getset

Definition at line 515 of file Bio.cs.

516 {
517 get
518 {
519 return text;
520 }
521 set
522 {
523 text = value;
524 if (type == Type.Label)
525 {
527 }
528 }
529 }

◆ TextSize

System.Drawing.Size BioImager.ROI.TextSize
get

Definition at line 530 of file Bio.cs.

531 {
532 get
533 {
534 return System.Windows.Forms.TextRenderer.MeasureText(text, font);
535 }
536 }

◆ W

double BioImager.ROI.W
getset

Definition at line 393 of file Bio.cs.

394 {
395 get
396 {
397 if (type == Type.Point)
398 return strokeWidth;
399 else
400 return BoundingBox.W;
401 }
402 set
403 {
404 Rect = new RectangleD(X, Y, value, H);
405 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
406 }
407 }

◆ X

double BioImager.ROI.X
getset

Definition at line 368 of file Bio.cs.

369 {
370 get
371 {
372 return Point.X;
373 }
374 set
375 {
376 Rect = new RectangleD(value, Y, W, H);
377 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
378 }
379 }

◆ Y

double BioImager.ROI.Y
getset

Definition at line 381 of file Bio.cs.

382 {
383 get
384 {
385 return Point.Y;
386 }
387 set
388 {
389 Rect = new RectangleD(X, value, W, H);
390 Recorder.AddLine("App.AddROI(" + BioImage.ROIToString(this) + ");");
391 }
392 }

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