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

Public Member Functions

 Resolution (int w, int h, int omePx, int bitsPerPixel, double physX, double physY, double physZ, double stageX, double stageY, double stageZ)
 
 Resolution (int w, int h, PixelFormat f, double physX, double physY, double physZ, double stageX, double stageY, double stageZ)
 
Resolution Copy ()
 
override string ToString ()
 

Public Attributes

int x
 
int y
 
PixelFormat format
 
double px
 
double py
 
double pz
 
double sx
 
double sy
 
double sz
 

Properties

int SizeX [get, set]
 
int SizeY [get, set]
 
double PhysicalSizeX [get, set]
 
double PhysicalSizeY [get, set]
 
double PhysicalSizeZ [get, set]
 
double StageSizeX [get, set]
 
double StageSizeY [get, set]
 
double StageSizeZ [get, set]
 
double VolumeWidth [get]
 
double VolumeHeight [get]
 
PixelFormat PixelFormat [get, set]
 
int RGBChannelsCount [get]
 
long SizeInBytes [get]
 

Detailed Description

Definition at line 167 of file Bio.cs.

Constructor & Destructor Documentation

◆ Resolution() [1/2]

BioLib.Resolution.Resolution ( int w,
int h,
int omePx,
int bitsPerPixel,
double physX,
double physY,
double physZ,
double stageX,
double stageY,
double stageZ )

Definition at line 261 of file Bio.cs.

262 {
263 x = w;
264 y = h;
265 sx = stageX;
266 sy = stageY;
267 sz = stageZ;
268 format = BioImage.GetPixelFormat(omePx, bitsPerPixel);
269 px = physX;
270 py = physY;
271 pz = physZ;
272 }

◆ Resolution() [2/2]

BioLib.Resolution.Resolution ( int w,
int h,
PixelFormat f,
double physX,
double physY,
double physZ,
double stageX,
double stageY,
double stageZ )

Definition at line 273 of file Bio.cs.

274 {
275 x = w;
276 y = h;
277 format = f;
278 sx = stageX;
279 sy = stageY;
280 sz = stageZ;
281 px = physX;
282 py = physY;
283 pz = physZ;
284 }

Member Function Documentation

◆ Copy()

Resolution BioLib.Resolution.Copy ( )

Definition at line 285 of file Bio.cs.

286 {
287 return new Resolution(x, y, format, px, py, pz, sx, sy, sz);
288 }

◆ ToString()

override string BioLib.Resolution.ToString ( )

Definition at line 289 of file Bio.cs.

290 {
291 return "new Resolution(" + SizeX + "," + SizeY + "," + format + "," + PhysicalSizeX + "," + PhysicalSizeY + "," + PhysicalSizeZ + "," + StageSizeX + "," + StageSizeY + "," + StageSizeZ + ");";
292 }

Member Data Documentation

◆ format

PixelFormat BioLib.Resolution.format

Definition at line 171 of file Bio.cs.

◆ px

double BioLib.Resolution.px

Definition at line 172 of file Bio.cs.

◆ py

double BioLib.Resolution.py

Definition at line 172 of file Bio.cs.

◆ pz

double BioLib.Resolution.pz

Definition at line 172 of file Bio.cs.

◆ sx

double BioLib.Resolution.sx

Definition at line 172 of file Bio.cs.

◆ sy

double BioLib.Resolution.sy

Definition at line 172 of file Bio.cs.

◆ sz

double BioLib.Resolution.sz

Definition at line 172 of file Bio.cs.

◆ x

int BioLib.Resolution.x

Definition at line 169 of file Bio.cs.

◆ y

int BioLib.Resolution.y

Definition at line 170 of file Bio.cs.

Property Documentation

◆ PhysicalSizeX

double BioLib.Resolution.PhysicalSizeX
getset

Definition at line 183 of file Bio.cs.

184 {
185 get { return px; }
186 set { px = value; }
187 }

◆ PhysicalSizeY

double BioLib.Resolution.PhysicalSizeY
getset

Definition at line 188 of file Bio.cs.

189 {
190 get { return py; }
191 set { py = value; }
192 }

◆ PhysicalSizeZ

double BioLib.Resolution.PhysicalSizeZ
getset

Definition at line 193 of file Bio.cs.

194 {
195 get { return pz; }
196 set { pz = value; }
197 }

◆ PixelFormat

PixelFormat BioLib.Resolution.PixelFormat
getset

Definition at line 227 of file Bio.cs.

228 {
229 get { return format; }
230 set { format = value; }
231 }

◆ RGBChannelsCount

int BioLib.Resolution.RGBChannelsCount
get

Definition at line 232 of file Bio.cs.

233 {
234 get
235 {
236 if (PixelFormat == PixelFormat.Format8bppIndexed || PixelFormat == PixelFormat.Format16bppGrayScale)
237 return 1;
238 else if (PixelFormat == PixelFormat.Format24bppRgb || PixelFormat == PixelFormat.Format48bppRgb)
239 return 3;
240 else
241 return 4;
242 }
243 }

◆ SizeInBytes

long BioLib.Resolution.SizeInBytes
get

Definition at line 244 of file Bio.cs.

245 {
246 get
247 {
248 if (format == PixelFormat.Format8bppIndexed)
249 return (long)y * (long)x;
250 else if (format == PixelFormat.Format16bppGrayScale)
251 return (long)y * (long)x * 2;
252 else if (format == PixelFormat.Format24bppRgb)
253 return (long)y * (long)x * 3;
254 else if (format == PixelFormat.Format32bppRgb || format == PixelFormat.Format32bppArgb)
255 return (long)y * (long)x * 4;
256 else if (format == PixelFormat.Format48bppRgb || format == PixelFormat.Format48bppRgb)
257 return (long)y * (long)x * 6;
258 throw new NotSupportedException(format + " is not supported.");
259 }
260 }

◆ SizeX

int BioLib.Resolution.SizeX
getset

Definition at line 173 of file Bio.cs.

174 {
175 get { return x; }
176 set { x = value; }
177 }

◆ SizeY

int BioLib.Resolution.SizeY
getset

Definition at line 178 of file Bio.cs.

179 {
180 get { return y; }
181 set { y = value; }
182 }

◆ StageSizeX

double BioLib.Resolution.StageSizeX
getset

Definition at line 198 of file Bio.cs.

199 {
200 get { return sx; }
201 set { sx = value; }
202 }

◆ StageSizeY

double BioLib.Resolution.StageSizeY
getset

Definition at line 203 of file Bio.cs.

204 {
205 get { return sy; }
206 set { sy = value; }
207 }

◆ StageSizeZ

double BioLib.Resolution.StageSizeZ
getset

Definition at line 208 of file Bio.cs.

209 {
210 get { return sz; }
211 set { sz = value; }
212 }

◆ VolumeHeight

double BioLib.Resolution.VolumeHeight
get

Definition at line 220 of file Bio.cs.

221 {
222 get
223 {
224 return PhysicalSizeY * SizeY;
225 }
226 }

◆ VolumeWidth

double BioLib.Resolution.VolumeWidth
get

Definition at line 213 of file Bio.cs.

214 {
215 get
216 {
217 return PhysicalSizeX * SizeX;
218 }
219 }

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