ALBA
albaGUILutHistogramEditor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUILutHistogramEditor
5 Authors: Crimi Gianluigi
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGUILutHistogramEditor_H__
18#define __albaGUILutHistogramEditor_H__
19
20#include "albaDefines.h"
21#include "albaEvent.h"
22#include "albaLUTLibrary.h"
23
24#include "albaGUILutWidget.h"
26#include "albaGUIColorWidget.h"
27#include "albaGUIDialog.h"
28
29#include "vtkLookupTable.h"
38class vtkDataSet;
40class albaGUI;
41
45
47{
48public:
50 {
51 ID_ = MINID,
55 ID_LOG_SCALE_VIEW
56 };
57
59 albaGUILutHistogramEditor(vtkDataSet *dataSet,mmaVolumeMaterial *material, char *name="Histogram & Windowing", albaObserver *Listener=NULL, int id=MINID);
60
63
65 virtual void SetListener(albaObserver *Listener) {m_Listener = Listener;};
66
68 virtual albaObserver *GetListener() {return m_Listener;};
69
70 /* Main event handler */
71 void OnEvent(albaEventBase *alba_event);
72
74 void OnSize(wxSizeEvent &event);
75
77 static void ShowLutHistogramDialog(vtkDataSet *dataSet,mmaVolumeMaterial *material, char *name="Histogram & Windowing", albaObserver *Listener=NULL, int id=MINID);
78
79protected:
80
81 /* Resample the VME because full histogram is slow*/
82 static vtkDataArray* Resample(vtkDataArray *inDA, vtkDataArray* outDA);
83
84 /* Resets the dialog values to default */
85 void ResetLutDialog(double gamma, double low, double high);
86
87 /* Update the volume lut, if reset is true the update i make from default values */
88 void UpdateVolumeLut(bool reset = false);
89
90 /* Set the volume for the histogram */
92
93 /* Set the volume for the histogram */
94 void SetDataSet(vtkDataSet *dataSet);
95
97 void CopyLut(vtkLookupTable *from, vtkLookupTable *to);
98
103
104
106 vtkDataSet *m_DataSet;
107 vtkDataArray *m_ResampledData;
108
111 double m_Gamma;
113 double m_HiRange;
114
115
118 vtkLookupTable *m_ExternalLut;
119 vtkLookupTable *m_Lut;
120
121};
122#endif
MINID
Definition: albaDecl.h:420
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUIDialog is the base class for albaDialogs.
Definition: albaGUIDialog.h:76
albaObserver * m_Listener
a Slider that can be used to set double values, albaGUIFloatSlider send usual wxWindows Events; Use a...
albaGUIHistogramWidget : widget that encapsulate render window into a gui
albaGUILutHistogramSwatch * m_LutSwatch
static vtkDataArray * Resample(vtkDataArray *inDA, vtkDataArray *outDA)
virtual albaObserver * GetListener()
Get the event listener.
albaGUILutHistogramEditor(vtkDataSet *dataSet, mmaVolumeMaterial *material, char *name="Histogram & Windowing", albaObserver *Listener=NULL, int id=MINID)
Constructor.
vtkLookupTable * m_ExternalLut
Given lut that will be modified by "ok" or "apply".
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
static void ShowLutHistogramDialog(vtkDataSet *dataSet, mmaVolumeMaterial *material, char *name="Histogram & Windowing", albaObserver *Listener=NULL, int id=MINID)
Show the dialog.
virtual void SetListener(albaObserver *Listener)
Set the event listener.
void ResetLutDialog(double gamma, double low, double high)
void SetDataSet(vtkDataSet *dataSet)
void CopyLut(vtkLookupTable *from, vtkLookupTable *to)
Copy the external Lookup Table given by the user to the internal one.
vtkLookupTable * m_Lut
Internal lut – initialized in SetLut.
albaGUIHistogramWidget * m_Histogram
virtual ~albaGUILutHistogramEditor()
Destructor.
void UpdateVolumeLut(bool reset=false)
void OnSize(wxSizeEvent &event)
Handle resize event.
void SetMaterial(mmaVolumeMaterial *material)
albaGUILutSlider is a Label that notify user-click using the normal wxEvents.
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36