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

Public Member Functions

ImageJDesc FromImage (BioImage b)
 
string GetString ()
 
void SetString (string desc)
 

Public Attributes

string ImageJ
 
int images = 0
 
int channels = 0
 
int slices = 0
 
int frames = 0
 
bool hyperstack
 
string mode
 
string unit
 
double finterval = 0
 
double spacing = 0
 
bool loop
 
double min = 0
 
double max = 0
 
int count
 
bool bit8color = false
 

Detailed Description

Definition at line 3487 of file Bio.cs.

Member Function Documentation

◆ FromImage()

ImageJDesc BioLib.BioImage.ImageJDesc.FromImage ( BioImage b)

The function "FromImage" takes a BioImage object and sets the properties of an ImageJDesc object based on the properties of the BioImage object.

Parameters
BioImageThe BioImage parameter represents an object that contains information about a biological image, such as the number of images, channels, slices, and frames, as well as other properties like frame interval, physical size, and channel ranges.
Returns
The method is returning an instance of the ImageJDesc class.

Definition at line 3513 of file Bio.cs.

3514 {
3515 ImageJ = "";
3516 images = b.ImageCount;
3517 channels = b.SizeC;
3518 slices = b.SizeZ;
3519 frames = b.SizeT;
3520 hyperstack = true;
3521 mode = "grayscale";
3522 unit = "micron";
3523 finterval = b.frameInterval;
3524 spacing = b.PhysicalSizeZ;
3525 loop = false;
3526 /*
3527 double dmax = double.MinValue;
3528 double dmin = double.MaxValue;
3529 foreach (Channel c in b.Channels)
3530 {
3531 if(dmax < c.Max)
3532 dmax = c.Max;
3533 if(dmin > c.Min)
3534 dmin = c.Min;
3535 }
3536 min = dmin;
3537 max = dmax;
3538 */
3539 min = b.Channels[0].RangeR.Min;
3540 max = b.Channels[0].RangeR.Max;
3541 return this;
3542 }

◆ GetString()

string BioLib.BioImage.ImageJDesc.GetString ( )

It returns a string that contains the values of all the variables in the imagej image

Returns
A string representation of the imagej image data.

Definition at line 3546 of file Bio.cs.

3547 {
3548 string s = "";
3549 s += "ImageJ=" + ImageJ + "\n";
3550 s += "images=" + images + "\n";
3551 s += "channels=" + channels.ToString() + "\n";
3552 s += "slices=" + slices.ToString() + "\n";
3553 s += "frames=" + frames.ToString() + "\n";
3554 s += "hyperstack=" + hyperstack.ToString() + "\n";
3555 s += "mode=" + mode.ToString() + "\n";
3556 s += "unit=" + unit.ToString() + "\n";
3557 s += "finterval=" + finterval.ToString() + "\n";
3558 s += "spacing=" + spacing.ToString() + "\n";
3559 s += "loop=" + loop.ToString() + "\n";
3560 s += "min=" + min.ToString() + "\n";
3561 s += "max=" + max.ToString() + "\n";
3562 return s;
3563 }

◆ SetString()

void BioLib.BioImage.ImageJDesc.SetString ( string desc)

It sets the string to the value of the parameter.

Parameters
descThe description of the string.

Definition at line 3567 of file Bio.cs.

3568 {
3569 string[] lines = desc.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
3570 int maxlen = 20;
3571 for (int i = 0; i < lines.Length; i++)
3572 {
3573 if (i < maxlen)
3574 {
3575 string[] sp = lines[i].Split('=');
3576 if (sp[0] == "ImageJ")
3577 ImageJ = sp[1];
3578 if (sp[0] == "images")
3579 images = int.Parse(sp[1], CultureInfo.InvariantCulture);
3580 if (sp[0] == "channels")
3581 channels = int.Parse(sp[1], CultureInfo.InvariantCulture);
3582 if (sp[0] == "slices")
3583 slices = int.Parse(sp[1], CultureInfo.InvariantCulture);
3584 if (sp[0] == "frames")
3585 frames = int.Parse(sp[1], CultureInfo.InvariantCulture);
3586 if (sp[0] == "hyperstack")
3587 hyperstack = bool.Parse(sp[1]);
3588 if (sp[0] == "mode")
3589 mode = sp[1];
3590 if (sp[0] == "unit")
3591 unit = sp[1];
3592 if (sp[0] == "finterval")
3593 finterval = double.Parse(sp[1], CultureInfo.InvariantCulture);
3594 if (sp[0] == "spacing")
3595 spacing = double.Parse(sp[1], CultureInfo.InvariantCulture);
3596 if (sp[0] == "loop")
3597 loop = bool.Parse(sp[1]);
3598 if (sp[0] == "min")
3599 min = double.Parse(sp[1], CultureInfo.InvariantCulture);
3600 if (sp[0] == "max")
3601 max = double.Parse(sp[1], CultureInfo.InvariantCulture);
3602 if (sp[0] == "8bitcolor")
3603 bit8color = bool.Parse(sp[1]);
3604 }
3605 else
3606 return;
3607 }
3608
3609 }

Member Data Documentation

◆ bit8color

bool BioLib.BioImage.ImageJDesc.bit8color = false

Definition at line 3503 of file Bio.cs.

◆ channels

int BioLib.BioImage.ImageJDesc.channels = 0

Definition at line 3491 of file Bio.cs.

◆ count

int BioLib.BioImage.ImageJDesc.count

Definition at line 3502 of file Bio.cs.

◆ finterval

double BioLib.BioImage.ImageJDesc.finterval = 0

Definition at line 3497 of file Bio.cs.

◆ frames

int BioLib.BioImage.ImageJDesc.frames = 0

Definition at line 3493 of file Bio.cs.

◆ hyperstack

bool BioLib.BioImage.ImageJDesc.hyperstack

Definition at line 3494 of file Bio.cs.

◆ ImageJ

string BioLib.BioImage.ImageJDesc.ImageJ

Definition at line 3489 of file Bio.cs.

◆ images

int BioLib.BioImage.ImageJDesc.images = 0

Definition at line 3490 of file Bio.cs.

◆ loop

bool BioLib.BioImage.ImageJDesc.loop

Definition at line 3499 of file Bio.cs.

◆ max

double BioLib.BioImage.ImageJDesc.max = 0

Definition at line 3501 of file Bio.cs.

◆ min

double BioLib.BioImage.ImageJDesc.min = 0

Definition at line 3500 of file Bio.cs.

◆ mode

string BioLib.BioImage.ImageJDesc.mode

Definition at line 3495 of file Bio.cs.

◆ slices

int BioLib.BioImage.ImageJDesc.slices = 0

Definition at line 3492 of file Bio.cs.

◆ spacing

double BioLib.BioImage.ImageJDesc.spacing = 0

Definition at line 3498 of file Bio.cs.

◆ unit

string BioLib.BioImage.ImageJDesc.unit

Definition at line 3496 of file Bio.cs.


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