BioLib  3.7.0
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 )
272 {
273 x = w;
274 y = h;
275 sx = stageX;
276 sy = stageY;
277 sz = stageZ;
278 format = BioImage.GetPixelFormat(omePx, bitsPerPixel);
279 px = physX;
280 py = physY;
281 pz = physZ;
282 }
Definition Bio.cs:1849
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:7439

◆ Resolution() [2/2]

BioLib.Resolution.Resolution ( int w,
int h,
PixelFormat f,
double physX,
double physY,
double physZ,
double stageX,
double stageY,
double stageZ )
284 {
285 x = w;
286 y = h;
287 format = f;
288 sx = stageX;
289 sy = stageY;
290 sz = stageZ;
291 px = physX;
292 py = physY;
293 pz = physZ;
294 }

Member Function Documentation

◆ Copy()

Resolution BioLib.Resolution.Copy ( )
296 {
297 return new Resolution(x, y, format, px, py, pz, sx, sy, sz);
298 }
Definition Bio.cs:178

◆ ToString()

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

Property Documentation

◆ PhysicalSizeX

double BioLib.Resolution.PhysicalSizeX
getset
194 {
195 get { return px; }
196 set { px = value; }
197 }

◆ PhysicalSizeY

double BioLib.Resolution.PhysicalSizeY
getset
199 {
200 get { return py; }
201 set { py = value; }
202 }

◆ PhysicalSizeZ

double BioLib.Resolution.PhysicalSizeZ
getset
204 {
205 get { return pz; }
206 set { pz = value; }
207 }

◆ PixelFormat

PixelFormat BioLib.Resolution.PixelFormat
getset
238 {
239 get { return format; }
240 set { format = value; }
241 }

◆ RGBChannelsCount

int BioLib.Resolution.RGBChannelsCount
get
243 {
244 get
245 {
246 if (PixelFormat == PixelFormat.Format8bppIndexed || PixelFormat == PixelFormat.Format16bppGrayScale)
247 return 1;
248 else if (PixelFormat == PixelFormat.Format24bppRgb || PixelFormat == PixelFormat.Format48bppRgb)
249 return 3;
250 else
251 return 4;
252 }
253 }

◆ SizeInBytes

long BioLib.Resolution.SizeInBytes
get
255 {
256 get
257 {
258 if (format == PixelFormat.Format8bppIndexed)
259 return (long)y * (long)x;
260 else if (format == PixelFormat.Format16bppGrayScale)
261 return (long)y * (long)x * 2;
262 else if (format == PixelFormat.Format24bppRgb)
263 return (long)y * (long)x * 3;
264 else if (format == PixelFormat.Format32bppRgb || format == PixelFormat.Format32bppArgb)
265 return (long)y * (long)x * 4;
266 else if (format == PixelFormat.Format48bppRgb || format == PixelFormat.Format48bppRgb)
267 return (long)y * (long)x * 6;
268 throw new NotSupportedException(format + " is not supported.");
269 }
270 }

◆ SizeX

int BioLib.Resolution.SizeX
getset
184 {
185 get { return x; }
186 set { x = value; }
187 }

◆ SizeY

int BioLib.Resolution.SizeY
getset
189 {
190 get { return y; }
191 set { y = value; }
192 }

◆ StageSizeX

double BioLib.Resolution.StageSizeX
getset
209 {
210 get { return sx; }
211 set { sx = value; }
212 }

◆ StageSizeY

double BioLib.Resolution.StageSizeY
getset
214 {
215 get { return sy; }
216 set { sy = value; }
217 }

◆ StageSizeZ

double BioLib.Resolution.StageSizeZ
getset
219 {
220 get { return sz; }
221 set { sz = value; }
222 }

◆ VolumeHeight

double BioLib.Resolution.VolumeHeight
get
231 {
232 get
233 {
234 return PhysicalSizeY * SizeY;
235 }
236 }

◆ VolumeWidth

double BioLib.Resolution.VolumeWidth
get
224 {
225 get
226 {
227 return PhysicalSizeX * SizeX;
228 }
229 }

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