BioGTK  6.0.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.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)
 
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 185 of file HistogramControl.cs.

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

◆ 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 199 of file HistogramControl.cs.

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

◆ Init()

void BioGTK.HistogramControl.Init ( )

This function initializes the histogram control.

Definition at line 60 of file HistogramControl.cs.

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

◆ 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 566 of file HistogramControl.cs.

567 {
568 channel = c;
569 }

◆ 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 573 of file HistogramControl.cs.

574 {
575 view.QueueDraw();
576 }

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 546 of file HistogramControl.cs.

547 {
548 get { return axisNumbers;}
549 set { axisNumbers = value; }
550 }

◆ AxisTicks

bool BioGTK.HistogramControl.AxisTicks
getset

Definition at line 553 of file HistogramControl.cs.

554 {
555 get { return axisTicks; }
556 set { axisTicks = value; }
557 }

◆ Bin

float BioGTK.HistogramControl.Bin
getset

Definition at line 455 of file HistogramControl.cs.

456 {
457 get
458 {
459 return bin;
460 }
461 set
462 {
463 bin = value;
464 }
465 }

◆ GraphMax

int BioGTK.HistogramControl.GraphMax
getset

Definition at line 489 of file HistogramControl.cs.

490 {
491 get { return graphMax; }
492 set { graphMax = value; }
493 }

◆ GraphMin

int BioGTK.HistogramControl.GraphMin
getset

Definition at line 495 of file HistogramControl.cs.

496 {
497 get { return graphMin; }
498 set { graphMin = value; }
499 }

◆ Max

float BioGTK.HistogramControl.Max
getset

Definition at line 478 of file HistogramControl.cs.

479 {
480 get { return max; }
481 set
482 {
483 if (channel != null)
484 channel.range[App.channelsTool.SelectedSample].Max = (int)value;
485 max = (int)value;
486 }
487 }

◆ Min

float BioGTK.HistogramControl.Min
getset

Definition at line 467 of file HistogramControl.cs.

468 {
469 get { return min; }
470 set
471 {
472 if(channel!=null)
473 channel.range[App.channelsTool.SelectedSample].Min = (int)value;
474 min = (int)value;
475 }
476 }

◆ MouseValX

float BioGTK.HistogramControl.MouseValX
get

Definition at line 530 of file HistogramControl.cs.

531 {
532 get
533 {
534 return mouseValX;
535 }
536 }

◆ MouseValY

float BioGTK.HistogramControl.MouseValY
get

Definition at line 537 of file HistogramControl.cs.

538 {
539 get
540 {
541 return mouseValY;
542 }
543 }

◆ MouseX

int BioGTK.HistogramControl.MouseX
get

Definition at line 514 of file HistogramControl.cs.

515 {
516 get
517 {
518 return mouseX;
519 }
520 }

◆ MouseY

int BioGTK.HistogramControl.MouseY
get

Definition at line 521 of file HistogramControl.cs.

522 {
523 get
524 {
525 return mouseX;
526 }
527 }

◆ StackHistogram

bool BioGTK.HistogramControl.StackHistogram
getset

Definition at line 501 of file HistogramControl.cs.

502 {
503 get
504 {
505 return stackHistogram;
506 }
507 set
508 {
509 stackHistogram = value;
510 }
511 }

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