BioLib  3.6.2
A GUI-less version of Bio .NET library for editing & annotating various microscopy image formats.
Loading...
Searching...
No Matches
BioLib.QuPath.GeoJsonPolygon Class Reference

Classes

class  GeoJsonPlane
 

Static Public Member Functions

static GeoJsonPolygon FromROI (ROI roi, BioImage b)
 

Properties

string type [get, set]
 
double[][][] coordinates [get, set]
 
GeoJsonPlane plane [get, set]
 

Detailed Description

Definition at line 146 of file QuPath.cs.

Member Function Documentation

◆ FromROI()

static GeoJsonPolygon BioLib.QuPath.GeoJsonPolygon.FromROI ( ROI roi,
BioImage b )
static

Definition at line 157 of file QuPath.cs.

158 {
159 int pc = roi.PointsD.Count;
160 if (roi.PointsD.Last() != roi.PointsD.First())
161 pc = roi.PointsD.Count + 1;
162 GeoJsonPolygon g = new GeoJsonPolygon();
163 double[][][] dds = new double[1][][];
164 double[][] ds = new double[pc][];
165 for (int i = 0; i < pc; i++)
166 {
167 if (i >= roi.PointsD.Count)
168 {
169 PointD po = b.ToImageSpace(roi.PointsD[0]);
170 ds[i] = new double[2] { (int)po.X, (int)po.Y };
171 }
172 else
173 {
174 PointD po = b.ToImageSpace(roi.PointsD[i]);
175 ds[i] = new double[2] { (int)po.X, (int)po.Y };
176 }
177 }
178
179 dds[0] = ds;
180 g.coordinates = dds;
181 g.type = "Polygon";
182 g.plane = new GeoJsonPlane();
183 g.plane.z = roi.coord.Z;
184 g.plane.c = roi.coord.C;
185 g.plane.t = roi.coord.T;
186 return g;
187 }

Property Documentation

◆ coordinates

double [][][] BioLib.QuPath.GeoJsonPolygon.coordinates
getset

Definition at line 155 of file QuPath.cs.

155{ get; set; }

◆ plane

GeoJsonPlane BioLib.QuPath.GeoJsonPolygon.plane
getset

Definition at line 156 of file QuPath.cs.

156{ get; set; }

◆ type

string BioLib.QuPath.GeoJsonPolygon.type
getset

Definition at line 154 of file QuPath.cs.

154{ get; set; }

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