BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
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)
 
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]
 

Constructor & Destructor Documentation

◆ HistogramControl()

BioGTK.HistogramControl.HistogramControl ( Builder  builder,
IntPtr  handle,
Channel  channel 
)
inlineprotected
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.
Definition HistogramControl.cs:60
Channel channel
Definition HistogramControl.cs:58

Member Function Documentation

◆ Create()

static HistogramControl BioGTK.HistogramControl.Create ( Channel  channel)
inlinestatic
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(Builder builder, IntPtr handle, Channel channel)
Definition HistogramControl.cs:49

◆ HistogramControl_ButtonPressEvent()

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

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

Parameters
oThe object that the event is being called on.
ButtonPressEventArgs
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 
)
inline

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.
200 {
201 mouseValX = (float)args.Event.X / fx;
202 mouseValY = (float)args.Event.Y / fy;
203 }

◆ Init()

void BioGTK.HistogramControl.Init ( )
inline

This function initializes the histogram control.

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)
Definition HistogramControl.cs:185
float Bin
Definition HistogramControl.cs:456
void HistogramControl_MotionNotifyEvent(object o, MotionNotifyEventArgs args)
Definition HistogramControl.cs:199

◆ UpdateChannel()

void BioGTK.HistogramControl.UpdateChannel ( Channel  c)
inline

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

Parameters
ChannelThe channel object that contains the channel information.
567 {
568 channel = c;
569 }

◆ UpdateView()

void BioGTK.HistogramControl.UpdateView ( )
inline

‍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

574 {
575 view.QueueDraw();
576 }

Member Data Documentation

◆ channel

Channel BioGTK.HistogramControl.channel = null

Property Documentation

◆ AxisNumbers

bool BioGTK.HistogramControl.AxisNumbers
getset
547 {
548 get { return axisNumbers;}
549 set { axisNumbers = value; }
550 }

◆ AxisTicks

bool BioGTK.HistogramControl.AxisTicks
getset
554 {
555 get { return axisTicks; }
556 set { axisTicks = value; }
557 }

◆ Bin

float BioGTK.HistogramControl.Bin
getset
456 {
457 get
458 {
459 return bin;
460 }
461 set
462 {
463 bin = value;
464 }
465 }

◆ GraphMax

int BioGTK.HistogramControl.GraphMax
getset
490 {
491 get { return graphMax; }
492 set { graphMax = value; }
493 }

◆ GraphMin

int BioGTK.HistogramControl.GraphMin
getset
496 {
497 get { return graphMin; }
498 set { graphMin = value; }
499 }

◆ Max

float BioGTK.HistogramControl.Max
getset
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
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
531 {
532 get
533 {
534 return mouseValX;
535 }
536 }

◆ MouseValY

float BioGTK.HistogramControl.MouseValY
get
538 {
539 get
540 {
541 return mouseValY;
542 }
543 }

◆ MouseX

int BioGTK.HistogramControl.MouseX
get
515 {
516 get
517 {
518 return mouseX;
519 }
520 }

◆ MouseY

int BioGTK.HistogramControl.MouseY
get
522 {
523 get
524 {
525 return mouseX;
526 }
527 }

◆ StackHistogram

bool BioGTK.HistogramControl.StackHistogram
getset
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: