BioGTK  5.7.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
All Classes Namespaces Functions
BioGTK.Plot Class Reference
Inheritance diagram for BioGTK.Plot:

Public Types

enum  PlotType { Bar , Scatter }
 

Public Member Functions

void UpdateImage ()
 

Static Public Member Functions

static Plot Create (double[] vals, string name)
 
static Plot Create (double[] vals, string name, PlotType typ)
 

Protected Member Functions

 Plot (Builder builder, IntPtr handle, double[] vals, string name, PlotType typ)
 

Properties

PlotType Type [get, set]
 
static Dictionary< string, PlotPlots [get]
 
List< double[]> Data [get, set]
 
Bitmap Image [get, set]
 
ScottPlot.Plot Model [get, set]
 
static Plot SelectedPlot [get]
 

Detailed Description

Definition at line 18 of file Plot.cs.

Member Enumeration Documentation

◆ PlotType

enum BioGTK.Plot.PlotType

Definition at line 28 of file Plot.cs.

29 {
30 Bar,
31 Scatter
32 }

Constructor & Destructor Documentation

◆ Plot()

BioGTK.Plot.Plot ( Builder builder,
IntPtr handle,
double[] vals,
string name,
PlotType typ )
protected

Definition at line 140 of file Plot.cs.

140 : base(handle)
141 {
142 _builder = builder;
143 builder.Autoconnect(this);
144 model = new ScottPlot.Plot();
145 data.Add(vals);
146 if (typ == PlotType.Scatter)
147 InitScatter();
148 else
149 if (typ == PlotType.Bar)
150 InitBars();
151 if (!name.EndsWith(".png") || !name.EndsWith(".PNG"))
152 file = name + ".png";
153 this.Title = name;
154 image.Drawn += Image_Drawn;
155 image.SizeAllocated += Image_SizeAllocated;
156 image.ButtonPressEvent += Image_ButtonPressEvent;
157 barMenu.ButtonPressEvent += BarMenu_ButtonPressEvent;
158 scatterMenu.ButtonPressEvent += ScatterMenu_ButtonPressEvent;
159 saveImageMenu.ButtonPressEvent += SaveImageMenu_ButtonPressEvent;
160 saveCSVMenu.ButtonPressEvent += SaveCSVMenu_ButtonPressEvent;
161 this.DeleteEvent += About_DeleteEvent;
162 this.name = name;
163 selected = this;
164 if(plots.ContainsKey(name))
165 plots[name] = this;
166 else
167 plots.Add(name,this);
168 App.ApplyStyles(this);
169 }

Member Function Documentation

◆ Create() [1/2]

static Plot BioGTK.Plot.Create ( double[] vals,
string name )
static

It creates a new instance of the Plot class.

Returns
A new instance of the Plot class.

Definition at line 125 of file Plot.cs.

126 {
127 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/Plot.glade", FileMode.Open));
128 return new Plot(builder, builder.GetObject("plot").Handle, vals, name, PlotType.Scatter);
129 }

◆ Create() [2/2]

static Plot BioGTK.Plot.Create ( double[] vals,
string name,
PlotType typ )
static

It creates a new instance of the Plot class.

Returns
A new instance of the Plot class.

Definition at line 133 of file Plot.cs.

134 {
135 Builder builder = new Builder(new FileStream("Glade/Plot.glade", FileMode.Open));
136 return new Plot(builder, builder.GetObject("plot").Handle, vals, name, typ);
137 }

◆ UpdateImage()

void BioGTK.Plot.UpdateImage ( )

The function updates an image by saving it as a PNG file, setting the window title, creating a new Pixbuf object from the file, and redrawing the image.

Definition at line 60 of file Plot.cs.

61 {
62 model.SavePng(file, AllocatedWidth, AllocatedHeight);
63 this.Title = name;
64 pixbuf = new Pixbuf(file);
65 image.QueueDraw();
66 }

Property Documentation

◆ Data

List<double[]> BioGTK.Plot.Data
getset

Definition at line 43 of file Plot.cs.

44 {
45 get { return data; }
46 set { data = value; UpdateImage(); }
47 }
void UpdateImage()
Definition Plot.cs:60

◆ Image

Bitmap BioGTK.Plot.Image
getset

Definition at line 48 of file Plot.cs.

49 {
50 get { return bitmap; }
51 set { bitmap = value; }
52 }

◆ Model

ScottPlot.Plot BioGTK.Plot.Model
getset

Definition at line 53 of file Plot.cs.

54 {
55 get { return model; }
56 set { model = value; UpdateImage(); }
57 }

◆ Plots

Dictionary<string,Plot> BioGTK.Plot.Plots
staticget

Definition at line 39 of file Plot.cs.

40 {
41 get { return plots; }
42 }

◆ SelectedPlot

Plot BioGTK.Plot.SelectedPlot
staticget

Definition at line 287 of file Plot.cs.

288 {
289 get { return selected; }
290 }

◆ Type

PlotType BioGTK.Plot.Type
getset

Definition at line 34 of file Plot.cs.

35 {
36 get { return type; }
37 set { type = value; }
38 }

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