BioLib  3.7.0
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]
 

Member Function Documentation

◆ FromROI()

static GeoJsonPolygon BioLib.QuPath.GeoJsonPolygon.FromROI ( ROI roi,
BioImage b )
static
158 {
159 int pc = roi.Points.Count;
160 if (roi.Points.Last() != roi.Points.First())
161 pc = roi.Points.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.Points.Count)
168 {
169 PointD po = b.ToImageSpace(roi.Points[0]);
170 ds[i] = new double[2] { (int)po.X, (int)po.Y };
171 }
172 else
173 {
174 PointD po = b.ToImageSpace(roi.Points[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
155{ get; set; }

◆ plane

GeoJsonPlane BioLib.QuPath.GeoJsonPolygon.plane
getset
156{ get; set; }

◆ type

string BioLib.QuPath.GeoJsonPolygon.type
getset
154{ get; set; }

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