BioLib  4.3.0
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
 

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.
2766 {
2767 ImageJ = "";
2768 images = b.ImageCount;
2769 channels = b.SizeC;
2770 slices = b.SizeZ;
2771 frames = b.SizeT;
2772 hyperstack = true;
2773 mode = "grayscale";
2774 unit = "micron";
2775 finterval = b.frameInterval;
2776 spacing = b.PhysicalSizeZ;
2777 loop = false;
2778 /*
2779 double dmax = double.MinValue;
2780 double dmin = double.MaxValue;
2781 foreach (Channel c in b.Channels)
2782 {
2783 if(dmax < c.Max)
2784 dmax = c.Max;
2785 if(dmin > c.Min)
2786 dmin = c.Min;
2787 }
2788 min = dmin;
2789 max = dmax;
2790 */
2791 min = b.Channels[0].RangeR.Min;
2792 max = b.Channels[0].RangeR.Max;
2793 return this;
2794 }
return b
Definition Bio.cs:7393
double finterval
Definition Bio.cs:2749
double spacing
Definition Bio.cs:2750
double min
Definition Bio.cs:2752
string mode
Definition Bio.cs:2747
int slices
Definition Bio.cs:2744
bool loop
Definition Bio.cs:2751
int images
Definition Bio.cs:2742
bool hyperstack
Definition Bio.cs:2746
int channels
Definition Bio.cs:2743
string unit
Definition Bio.cs:2748
int frames
Definition Bio.cs:2745
double max
Definition Bio.cs:2753
Definition ImageJ.cs:18

◆ 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.
2799 {
2800 string s = "";
2801 s += "ImageJ=" + ImageJ + "\n";
2802 s += "images=" + images + "\n";
2803 s += "channels=" + channels.ToString() + "\n";
2804 s += "slices=" + slices.ToString() + "\n";
2805 s += "frames=" + frames.ToString() + "\n";
2806 s += "hyperstack=" + hyperstack.ToString() + "\n";
2807 s += "mode=" + mode.ToString() + "\n";
2808 s += "unit=" + unit.ToString() + "\n";
2809 s += "finterval=" + finterval.ToString() + "\n";
2810 s += "spacing=" + spacing.ToString() + "\n";
2811 s += "loop=" + loop.ToString() + "\n";
2812 s += "min=" + min.ToString() + "\n";
2813 s += "max=" + max.ToString() + "\n";
2814 return s;
2815 }

◆ SetString()

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

It sets the string to the value of the parameter.

Parameters
descThe description of the string.
2820 {
2821 string[] lines = desc.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
2822 int maxlen = 20;
2823 for (int i = 0; i < lines.Length; i++)
2824 {
2825 if (i < maxlen)
2826 {
2827 string[] sp = lines[i].Split('=');
2828 if (sp[0] == "ImageJ")
2829 ImageJ = sp[1];
2830 if (sp[0] == "images")
2831 images = int.Parse(sp[1], CultureInfo.InvariantCulture);
2832 if (sp[0] == "channels")
2833 channels = int.Parse(sp[1], CultureInfo.InvariantCulture);
2834 if (sp[0] == "slices")
2835 slices = int.Parse(sp[1], CultureInfo.InvariantCulture);
2836 if (sp[0] == "frames")
2837 frames = int.Parse(sp[1], CultureInfo.InvariantCulture);
2838 if (sp[0] == "hyperstack")
2839 hyperstack = bool.Parse(sp[1]);
2840 if (sp[0] == "mode")
2841 mode = sp[1];
2842 if (sp[0] == "unit")
2843 unit = sp[1];
2844 if (sp[0] == "finterval")
2845 finterval = double.Parse(sp[1], CultureInfo.InvariantCulture);
2846 if (sp[0] == "spacing")
2847 spacing = double.Parse(sp[1], CultureInfo.InvariantCulture);
2848 if (sp[0] == "loop")
2849 loop = bool.Parse(sp[1]);
2850 if (sp[0] == "min")
2851 min = double.Parse(sp[1], CultureInfo.InvariantCulture);
2852 if (sp[0] == "max")
2853 max = double.Parse(sp[1], CultureInfo.InvariantCulture);
2854 if (sp[0] == "8bitcolor")
2855 bit8color = bool.Parse(sp[1]);
2856 }
2857 else
2858 return;
2859 }
2860
2861 }
bool bit8color
Definition Bio.cs:2755

Member Data Documentation

◆ bit8color

bool BioLib.BioImage.ImageJDesc.bit8color = false

◆ channels

int BioLib.BioImage.ImageJDesc.channels = 0

◆ count

int BioLib.BioImage.ImageJDesc.count

◆ finterval

double BioLib.BioImage.ImageJDesc.finterval = 0

◆ frames

int BioLib.BioImage.ImageJDesc.frames = 0

◆ hyperstack

bool BioLib.BioImage.ImageJDesc.hyperstack

◆ ImageJ

string BioLib.BioImage.ImageJDesc.ImageJ

◆ images

int BioLib.BioImage.ImageJDesc.images = 0

◆ loop

bool BioLib.BioImage.ImageJDesc.loop

◆ max

double BioLib.BioImage.ImageJDesc.max = 0

◆ min

double BioLib.BioImage.ImageJDesc.min = 0

◆ mode

string BioLib.BioImage.ImageJDesc.mode

◆ slices

int BioLib.BioImage.ImageJDesc.slices = 0

◆ spacing

double BioLib.BioImage.ImageJDesc.spacing = 0

◆ unit

string BioLib.BioImage.ImageJDesc.unit

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