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

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 )
284 {
285 x = w;
286 y = h;
287 sx = stageX;
288 sy = stageY;
289 sz = stageZ;
290 format = BioImage.GetPixelFormat(omePx, bitsPerPixel);
291 px = physX;
292 py = physY;
293 pz = physZ;
294 }
Definition Bio.cs:1861
static PixelFormat GetPixelFormat(int rgbChannelCount, int bitsPerPixel)
If the bits per pixel is 8, then the pixel format is either 8bppIndexed, 24bppRgb,...
Definition Bio.cs:7522

◆ Resolution() [2/2]

BioLib.Resolution.Resolution ( int w,
int h,
PixelFormat f,
double physX,
double physY,
double physZ,
double stageX,
double stageY,
double stageZ )
296 {
297 x = w;
298 y = h;
299 format = f;
300 sx = stageX;
301 sy = stageY;
302 sz = stageZ;
303 px = physX;
304 py = physY;
305 pz = physZ;
306 }

Member Function Documentation

◆ Copy()

Resolution BioLib.Resolution.Copy ( )
308 {
309 return new Resolution(x, y, format, px, py, pz, sx, sy, sz);
310 }
Definition Bio.cs:190

◆ ToString()

override string BioLib.Resolution.ToString ( )
312 {
313 return "new Resolution(" + SizeX + "," + SizeY + "," + format + "," + PhysicalSizeX + "," + PhysicalSizeY + "," + PhysicalSizeZ + "," + StageSizeX + "," + StageSizeY + "," + StageSizeZ + ");";
314 }

Property Documentation

◆ PhysicalSizeX

double BioLib.Resolution.PhysicalSizeX
getset
206 {
207 get { return px; }
208 set { px = value; }
209 }

◆ PhysicalSizeY

double BioLib.Resolution.PhysicalSizeY
getset
211 {
212 get { return py; }
213 set { py = value; }
214 }

◆ PhysicalSizeZ

double BioLib.Resolution.PhysicalSizeZ
getset
216 {
217 get { return pz; }
218 set { pz = value; }
219 }

◆ PixelFormat

PixelFormat BioLib.Resolution.PixelFormat
getset
250 {
251 get { return format; }
252 set { format = value; }
253 }

◆ RGBChannelsCount

int BioLib.Resolution.RGBChannelsCount
get
255 {
256 get
257 {
258 if (PixelFormat == PixelFormat.Format8bppIndexed || PixelFormat == PixelFormat.Format16bppGrayScale)
259 return 1;
260 else if (PixelFormat == PixelFormat.Format24bppRgb || PixelFormat == PixelFormat.Format48bppRgb)
261 return 3;
262 else
263 return 4;
264 }
265 }

◆ SizeInBytes

long BioLib.Resolution.SizeInBytes
get
267 {
268 get
269 {
270 if (format == PixelFormat.Format8bppIndexed)
271 return (long)y * (long)x;
272 else if (format == PixelFormat.Format16bppGrayScale)
273 return (long)y * (long)x * 2;
274 else if (format == PixelFormat.Format24bppRgb)
275 return (long)y * (long)x * 3;
276 else if (format == PixelFormat.Format32bppRgb || format == PixelFormat.Format32bppArgb)
277 return (long)y * (long)x * 4;
278 else if (format == PixelFormat.Format48bppRgb || format == PixelFormat.Format48bppRgb)
279 return (long)y * (long)x * 6;
280 throw new NotSupportedException(format + " is not supported.");
281 }
282 }

◆ SizeX

int BioLib.Resolution.SizeX
getset
196 {
197 get { return x; }
198 set { x = value; }
199 }

◆ SizeY

int BioLib.Resolution.SizeY
getset
201 {
202 get { return y; }
203 set { y = value; }
204 }

◆ StageSizeX

double BioLib.Resolution.StageSizeX
getset
221 {
222 get { return sx; }
223 set { sx = value; }
224 }

◆ StageSizeY

double BioLib.Resolution.StageSizeY
getset
226 {
227 get { return sy; }
228 set { sy = value; }
229 }

◆ StageSizeZ

double BioLib.Resolution.StageSizeZ
getset
231 {
232 get { return sz; }
233 set { sz = value; }
234 }

◆ VolumeHeight

double BioLib.Resolution.VolumeHeight
get
243 {
244 get
245 {
246 return PhysicalSizeY * SizeY;
247 }
248 }

◆ VolumeWidth

double BioLib.Resolution.VolumeWidth
get
236 {
237 get
238 {
239 return PhysicalSizeX * SizeX;
240 }
241 }

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