BioGTK  6.5.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 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)

◆ ToCairoColor()

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

Definition at line 205 of file HistogramControl.cs.

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

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

573 {
574 channel = c;
575 }

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

580 {
581 view.QueueDraw();
582 }

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

553 {
554 get { return axisNumbers;}
555 set { axisNumbers = value; }
556 }

◆ AxisTicks

bool BioGTK.HistogramControl.AxisTicks
getset

Definition at line 559 of file HistogramControl.cs.

560 {
561 get { return axisTicks; }
562 set { axisTicks = value; }
563 }

◆ Bin

float BioGTK.HistogramControl.Bin
getset

Definition at line 461 of file HistogramControl.cs.

462 {
463 get
464 {
465 return bin;
466 }
467 set
468 {
469 bin = value;
470 }
471 }

◆ GraphMax

int BioGTK.HistogramControl.GraphMax
getset

Definition at line 495 of file HistogramControl.cs.

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

◆ GraphMin

int BioGTK.HistogramControl.GraphMin
getset

Definition at line 501 of file HistogramControl.cs.

502 {
503 get { return graphMin; }
504 set { graphMin = value; }
505 }

◆ Max

float BioGTK.HistogramControl.Max
getset

Definition at line 484 of file HistogramControl.cs.

485 {
486 get { return max; }
487 set
488 {
489 if (channel != null)
490 channel.range[App.channelsTool.SelectedSample].Max = (int)value;
491 max = (int)value;
492 }
493 }

◆ Min

float BioGTK.HistogramControl.Min
getset

Definition at line 473 of file HistogramControl.cs.

474 {
475 get { return min; }
476 set
477 {
478 if(channel!=null)
479 channel.range[App.channelsTool.SelectedSample].Min = (int)value;
480 min = (int)value;
481 }
482 }

◆ MouseValX

float BioGTK.HistogramControl.MouseValX
get

Definition at line 536 of file HistogramControl.cs.

537 {
538 get
539 {
540 return mouseValX;
541 }
542 }

◆ MouseValY

float BioGTK.HistogramControl.MouseValY
get

Definition at line 543 of file HistogramControl.cs.

544 {
545 get
546 {
547 return mouseValY;
548 }
549 }

◆ MouseX

int BioGTK.HistogramControl.MouseX
get

Definition at line 520 of file HistogramControl.cs.

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

◆ MouseY

int BioGTK.HistogramControl.MouseY
get

Definition at line 527 of file HistogramControl.cs.

528 {
529 get
530 {
531 return mouseX;
532 }
533 }

◆ StackHistogram

bool BioGTK.HistogramControl.StackHistogram
getset

Definition at line 507 of file HistogramControl.cs.

508 {
509 get
510 {
511 return stackHistogram;
512 }
513 set
514 {
515 stackHistogram = value;
516 }
517 }

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