BioGTK  6.7.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
Loading...
Searching...
No Matches
BioGTK.HistogramControl Class Reference
Inheritance diagram for BioGTK.HistogramControl:

Public Member Functions

void Init ()
 This function initializes the histogram control.
 
void HistogramControl_ButtonPressEvent (object o, ButtonPressEventArgs args)
 
void HistogramControl_MotionNotifyEvent (object o, MotionNotifyEventArgs args)
 
Cairo.Color ToCairoColor (Color c)
 
void UpdateChannel (Channel c)
 
void UpdateView ()
 

Static Public Member Functions

static HistogramControl Create (Channel channel)
 

Public Attributes

Channel channel = null
 

Protected Member Functions

 HistogramControl (Builder builder, IntPtr handle, Channel channel)
 

Properties

float Bin [get, set]
 
float Min [get, set]
 
float Max [get, set]
 
int GraphMax [get, set]
 
int GraphMin [get, set]
 
bool StackHistogram [get, set]
 
int MouseX [get]
 
int MouseY [get]
 
float MouseValX [get]
 
float MouseValY [get]
 
bool AxisNumbers [get, set]
 
bool AxisTicks [get, set]
 

Detailed Description

Definition at line 18 of file HistogramControl.cs.

Constructor & Destructor Documentation

◆ HistogramControl()

BioGTK.HistogramControl.HistogramControl ( Builder builder,
IntPtr handle,
Channel channel )
protected

Definition at line 49 of file HistogramControl.cs.

49 : base(handle)
50 {
51 _builder = builder;
52 this.channel = channel;
53 builder.Autoconnect(this);
54 Init();
55 }
void Init()
This function initializes the histogram control.

Member Function Documentation

◆ Create()

static HistogramControl BioGTK.HistogramControl.Create ( Channel channel)
static

Definition at line 44 of file HistogramControl.cs.

45 {
46 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/Histogram.glade", FileMode.Open));
47 return new HistogramControl(builder, builder.GetObject("histogram").Handle,channel);
48 }

◆ HistogramControl_ButtonPressEvent()

void BioGTK.HistogramControl.HistogramControl_ButtonPressEvent ( object o,
ButtonPressEventArgs args )

This function is called when the user presses a button on the mouse

Parameters
oThe object that the event is being called on.
ButtonPressEventArgs

Definition at line 187 of file HistogramControl.cs.

188 {
189 mouseX = (int)args.Event.X;
190 mouseY = (int)args.Event.Y;
191 this.QueueDraw();
192 if(args.Event.Button == 3)
193 menu.Popup();
194 }

◆ HistogramControl_MotionNotifyEvent()

void BioGTK.HistogramControl.HistogramControl_MotionNotifyEvent ( object o,
MotionNotifyEventArgs args )

The function takes the mouse position and divides it by the scaling factor to get the actual value of the mouse position

Parameters
oThe object that the event is being called from.
MotionNotifyEventArgsThis is the event that is triggered when the mouse is moved.

Definition at line 201 of file HistogramControl.cs.

202 {
203 mouseValX = (float)args.Event.X / fx;
204 mouseValY = (float)args.Event.Y / fy;
205 }

◆ Init()

void BioGTK.HistogramControl.Init ( )

This function initializes the histogram control.

Definition at line 62 of file HistogramControl.cs.

63 {
64 if (ImageView.SelectedImage.bitsPerPixel == 8)
65 {
66 graphMax = 255;
67 Bin = 1;
68 }
69 else
70 {
71 graphMax = ushort.MaxValue;
72 Bin = 1;
73 }
74 view.Drawn += HistogramControl_Drawn;
75 this.MotionNotifyEvent += HistogramControl_MotionNotifyEvent;
76 this.ButtonPressEvent += HistogramControl_ButtonPressEvent;
77 this.ScrollEvent += HistogramControl_ScrollEvent;
78 this.DeleteEvent += HistogramControl_DeleteEvent;
79 setMin.ButtonPressEvent += SetMin_ButtonPressEvent;
80 setMax.ButtonPressEvent += SetMax_ButtonPressEvent;
81 setMinAll.ButtonPressEvent += SetMinAll_ButtonPressEvent;
82 setMaxAll.ButtonPressEvent += SetMaxAll_ButtonPressEvent;
83 this.AddEvents((int)
84 (EventMask.ButtonPressMask
85 | EventMask.ButtonReleaseMask
86 | EventMask.KeyPressMask
87 | EventMask.PointerMotionMask | EventMask.ScrollMask));
88 }
void HistogramControl_ButtonPressEvent(object o, ButtonPressEventArgs args)
void HistogramControl_MotionNotifyEvent(object o, MotionNotifyEventArgs args)

◆ ToCairoColor()

Cairo.Color BioGTK.HistogramControl.ToCairoColor ( Color c)

Definition at line 207 of file HistogramControl.cs.

208 {
209 return new Cairo.Color((double)c.R / 255.0, (double)c.G / 255.0, (double)c.B / 255.0, (double)c.A / 255.0);
210 }

◆ UpdateChannel()

void BioGTK.HistogramControl.UpdateChannel ( Channel c)

This function updates the channel variable with the channel that is passed in

Parameters
ChannelThe channel object that contains the channel information.

Definition at line 649 of file HistogramControl.cs.

650 {
651 channel = c;
652 }

◆ UpdateView()

void BioGTK.HistogramControl.UpdateView ( )

‍The function UpdateView() is called when the user clicks the button. It calls the function QueueDraw() which is a function of the Gtk.DrawingArea widget. This function tells the widget to redraw itself

Definition at line 656 of file HistogramControl.cs.

657 {
658 view.QueueDraw();
659 }

Member Data Documentation

◆ channel

Channel BioGTK.HistogramControl.channel = null

Definition at line 58 of file HistogramControl.cs.

Property Documentation

◆ AxisNumbers

bool BioGTK.HistogramControl.AxisNumbers
getset

Definition at line 629 of file HistogramControl.cs.

630 {
631 get { return axisNumbers;}
632 set { axisNumbers = value; }
633 }

◆ AxisTicks

bool BioGTK.HistogramControl.AxisTicks
getset

Definition at line 636 of file HistogramControl.cs.

637 {
638 get { return axisTicks; }
639 set { axisTicks = value; }
640 }

◆ Bin

float BioGTK.HistogramControl.Bin
getset

Definition at line 538 of file HistogramControl.cs.

539 {
540 get
541 {
542 return bin;
543 }
544 set
545 {
546 bin = value;
547 }
548 }

◆ GraphMax

int BioGTK.HistogramControl.GraphMax
getset

Definition at line 572 of file HistogramControl.cs.

573 {
574 get { return graphMax; }
575 set { graphMax = value; }
576 }

◆ GraphMin

int BioGTK.HistogramControl.GraphMin
getset

Definition at line 578 of file HistogramControl.cs.

579 {
580 get { return graphMin; }
581 set { graphMin = value; }
582 }

◆ Max

float BioGTK.HistogramControl.Max
getset

Definition at line 561 of file HistogramControl.cs.

562 {
563 get { return max; }
564 set
565 {
566 if (channel != null)
567 channel.range[App.channelsTool.SelectedSample].Max = (int)value;
568 max = (int)value;
569 }
570 }

◆ Min

float BioGTK.HistogramControl.Min
getset

Definition at line 550 of file HistogramControl.cs.

551 {
552 get { return min; }
553 set
554 {
555 if(channel!=null)
556 channel.range[App.channelsTool.SelectedSample].Min = (int)value;
557 min = (int)value;
558 }
559 }

◆ MouseValX

float BioGTK.HistogramControl.MouseValX
get

Definition at line 613 of file HistogramControl.cs.

614 {
615 get
616 {
617 return mouseValX;
618 }
619 }

◆ MouseValY

float BioGTK.HistogramControl.MouseValY
get

Definition at line 620 of file HistogramControl.cs.

621 {
622 get
623 {
624 return mouseValY;
625 }
626 }

◆ MouseX

int BioGTK.HistogramControl.MouseX
get

Definition at line 597 of file HistogramControl.cs.

598 {
599 get
600 {
601 return mouseX;
602 }
603 }

◆ MouseY

int BioGTK.HistogramControl.MouseY
get

Definition at line 604 of file HistogramControl.cs.

605 {
606 get
607 {
608 return mouseX;
609 }
610 }

◆ StackHistogram

bool BioGTK.HistogramControl.StackHistogram
getset

Definition at line 584 of file HistogramControl.cs.

585 {
586 get
587 {
588 return stackHistogram;
589 }
590 set
591 {
592 stackHistogram = value;
593 }
594 }

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