BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
BioGTK.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
 

Member Function Documentation

◆ FromImage()

ImageJDesc BioGTK.BioImage.ImageJDesc.FromImage ( BioImage  b)
inline

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.
2523 {
2524 ImageJ = "";
2525 images = b.ImageCount;
2526 channels = b.SizeC;
2527 slices = b.SizeZ;
2528 frames = b.SizeT;
2529 hyperstack = true;
2530 mode = "grayscale";
2531 unit = "micron";
2532 finterval = b.frameInterval;
2533 spacing = b.PhysicalSizeZ;
2534 loop = false;
2535 /*
2536 double dmax = double.MinValue;
2537 double dmin = double.MaxValue;
2538 foreach (Channel c in b.Channels)
2539 {
2540 if(dmax < c.Max)
2541 dmax = c.Max;
2542 if(dmin > c.Min)
2543 dmin = c.Min;
2544 }
2545 min = dmin;
2546 max = dmax;
2547 */
2548 min = b.Channels[0].RangeR.Min;
2549 max = b.Channels[0].RangeR.Max;
2550 return this;
2551 }
int images
Definition Bio.cs:2499
string ImageJ
Definition Bio.cs:2498
string mode
Definition Bio.cs:2504
double min
Definition Bio.cs:2509
int channels
Definition Bio.cs:2500
string unit
Definition Bio.cs:2505
double spacing
Definition Bio.cs:2507
double finterval
Definition Bio.cs:2506
int slices
Definition Bio.cs:2501
double max
Definition Bio.cs:2510
int frames
Definition Bio.cs:2502
bool hyperstack
Definition Bio.cs:2503
bool loop
Definition Bio.cs:2508

◆ GetString()

string BioGTK.BioImage.ImageJDesc.GetString ( )
inline

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.
2556 {
2557 string s = "";
2558 s += "ImageJ=" + ImageJ + "\n";
2559 s += "images=" + images + "\n";
2560 s += "channels=" + channels.ToString() + "\n";
2561 s += "slices=" + slices.ToString() + "\n";
2562 s += "frames=" + frames.ToString() + "\n";
2563 s += "hyperstack=" + hyperstack.ToString() + "\n";
2564 s += "mode=" + mode.ToString() + "\n";
2565 s += "unit=" + unit.ToString() + "\n";
2566 s += "finterval=" + finterval.ToString() + "\n";
2567 s += "spacing=" + spacing.ToString() + "\n";
2568 s += "loop=" + loop.ToString() + "\n";
2569 s += "min=" + min.ToString() + "\n";
2570 s += "max=" + max.ToString() + "\n";
2571 return s;
2572 }

◆ SetString()

void BioGTK.BioImage.ImageJDesc.SetString ( string  desc)
inline

It sets the string to the value of the parameter.

Parameters
descThe description of the string.
2577 {
2578 string[] lines = desc.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
2579 int maxlen = 20;
2580 for (int i = 0; i < lines.Length; i++)
2581 {
2582 if (i < maxlen)
2583 {
2584 string[] sp = lines[i].Split('=');
2585 if (sp[0] == "ImageJ")
2586 ImageJ = sp[1];
2587 if (sp[0] == "images")
2588 images = int.Parse(sp[1], CultureInfo.InvariantCulture);
2589 if (sp[0] == "channels")
2590 channels = int.Parse(sp[1], CultureInfo.InvariantCulture);
2591 if (sp[0] == "slices")
2592 slices = int.Parse(sp[1], CultureInfo.InvariantCulture);
2593 if (sp[0] == "frames")
2594 frames = int.Parse(sp[1], CultureInfo.InvariantCulture);
2595 if (sp[0] == "hyperstack")
2596 hyperstack = bool.Parse(sp[1]);
2597 if (sp[0] == "mode")
2598 mode = sp[1];
2599 if (sp[0] == "unit")
2600 unit = sp[1];
2601 if (sp[0] == "finterval")
2602 finterval = double.Parse(sp[1], CultureInfo.InvariantCulture);
2603 if (sp[0] == "spacing")
2604 spacing = double.Parse(sp[1], CultureInfo.InvariantCulture);
2605 if (sp[0] == "loop")
2606 loop = bool.Parse(sp[1]);
2607 if (sp[0] == "min")
2608 min = double.Parse(sp[1], CultureInfo.InvariantCulture);
2609 if (sp[0] == "max")
2610 max = double.Parse(sp[1], CultureInfo.InvariantCulture);
2611 if (sp[0] == "8bitcolor")
2612 bit8color = bool.Parse(sp[1]);
2613 }
2614 else
2615 return;
2616 }
2617
2618 }
bool bit8color
Definition Bio.cs:2512

Member Data Documentation

◆ bit8color

bool BioGTK.BioImage.ImageJDesc.bit8color = false

◆ channels

int BioGTK.BioImage.ImageJDesc.channels = 0

◆ count

int BioGTK.BioImage.ImageJDesc.count

◆ finterval

double BioGTK.BioImage.ImageJDesc.finterval = 0

◆ frames

int BioGTK.BioImage.ImageJDesc.frames = 0

◆ hyperstack

bool BioGTK.BioImage.ImageJDesc.hyperstack

◆ ImageJ

string BioGTK.BioImage.ImageJDesc.ImageJ

◆ images

int BioGTK.BioImage.ImageJDesc.images = 0

◆ loop

bool BioGTK.BioImage.ImageJDesc.loop

◆ max

double BioGTK.BioImage.ImageJDesc.max = 0

◆ min

double BioGTK.BioImage.ImageJDesc.min = 0

◆ mode

string BioGTK.BioImage.ImageJDesc.mode

◆ slices

int BioGTK.BioImage.ImageJDesc.slices = 0

◆ spacing

double BioGTK.BioImage.ImageJDesc.spacing = 0

◆ unit

string BioGTK.BioImage.ImageJDesc.unit

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