vtkSlicerGradientsWidget.h

Go to the documentation of this file.
00001 // .NAME vtkSlicerGradientsWidget 
00002 // .SECTION Description
00003 // This class implements Slicer's DWI Gradients widget, part of the DiffusionEditor GUI.
00004 // Inherits most behavior from vtkSlicerWidget.
00005 #ifndef __vtkSlicerGradientsWidget_h
00006 #define __vtkSlicerGradientsWidget_h
00007 
00008 #include "vtkVolumes.h"
00009 #include "vtkSlicerWidget.h"
00010 #include "vtkSlicerDiffusionEditorLogic.h"
00011 #include "vtkSlicerApplication.h"
00012 
00013 class vtkMRMLDiffusionWeightedVolumeNode;
00014 class vtkDoubleArray;
00015 //widgets
00016 class vtkKWFrameWithLabel;
00017 class vtkKWFrame;
00018 class vtkKWLoadSaveButtonWithLabel;
00019 class vtkKWCheckButton;
00020 class vtkKWTextWithScrollbars ;
00021 class vtkKWLabel;
00022 class vtkKWMessageDialog;
00023 class vtkKWPushButton;
00024 
00025 class VTK_VOLUMES_EXPORT vtkSlicerGradientsWidget : public vtkSlicerWidget
00026   {
00027   public:
00028 
00029     // Description:
00030     // Usual vtk class functions.
00031     static vtkSlicerGradientsWidget* New();
00032     vtkTypeRevisionMacro(vtkSlicerGradientsWidget,vtkSlicerWidget);
00033     void PrintSelf(ostream& os, vtkIndent indent);
00034 
00035     // Description:
00036     // Add/Remove observers on widgets in the GUI.
00037     virtual void AddWidgetObservers();
00038     virtual void RemoveWidgetObservers();
00039 
00040     // Description:
00041     // Propagates events generated in GUI to logic / mrml.
00042     void ProcessWidgetEvents(vtkObject *caller, unsigned long event, void *callData );
00043 
00044     // Description:
00045     // Updates the widget when a new ActiveVolumeNode is loaded.
00046     void UpdateWidget(vtkMRMLDiffusionWeightedVolumeNode *dwiNode);
00047 
00048     // Description:
00049     // Propagates keypress-events generated in the GradientsTextbox.
00050     void TextFieldModifiedCallback();
00051 
00052     // Description:
00053     // Event is invoked when a matrix value changed.
00054     //BTX
00055     enum
00056       {
00057       ChangedEvent = 1234,
00058       };
00059     //ETX
00060 
00061     // Description:
00062     // Sets the Logic to the current vtkSlicerDiffusionEditorLogic of the editor.
00063     virtual void SetLogic(vtkSlicerDiffusionEditorLogic *logic);
00064 
00065     // Description:
00066     // Enables/Disables the whole widget, also collapses the widget.
00067     void SetStatus(int status);
00068 
00069     // Description:
00070     // Sets the Application to the current vtkSlicerApplication.
00071     vtkSetObjectMacro(Application, vtkSlicerApplication);
00072     virtual void SetApplication (vtkKWApplication* arg)
00073       { this->Superclass::SetApplication( arg ); }
00074 
00075   protected:
00076     vtkSlicerGradientsWidget(void);
00077     virtual ~vtkSlicerGradientsWidget(void);
00078 
00079     // Description:
00080     // Creates the widget.
00081     virtual void CreateWidget();
00082 
00083     // Description:
00084     // Updates the GradientsTextbox containing bValue and gradients (GUI).
00085     void UpdateGradients();
00086 
00087     // Description:
00088     // Updates the StatusLabel for the gradients (GUI).
00089     void UpdateStatusLabel(int status);
00090 
00091     // Description:
00092     // Saves changes of the gradients/bValues to the ActiveVolumeNode.
00093     void SaveGradients();
00094 
00095     // Description:
00096     // Displays a message dialog to the user (GUI).
00097     void DisplayMessageDialog(const char* message);
00098 
00099     vtkSlicerApplication *Application;
00100 
00101     vtkMRMLDiffusionWeightedVolumeNode *ActiveVolumeNode;
00102     vtkDoubleArray *Gradients;
00103     vtkDoubleArray *BValues;
00104     vtkSlicerDiffusionEditorLogic *Logic;
00105     //widgets (GUI)
00106     vtkKWFrameWithLabel *GradientsFrame;
00107     vtkKWFrame *ButtonsFrame;
00108     vtkKWLoadSaveButtonWithLabel *LoadGradientsButton;
00109     vtkKWCheckButton *EnableGradientsButton;
00110     vtkKWTextWithScrollbars *GradientsTextbox;
00111     vtkKWLabel *StatusLabel;
00112     vtkKWMessageDialog *MessageDialog;
00113 
00114   private:
00115     vtkSlicerGradientsWidget (const vtkSlicerGradientsWidget&); // Not implemented.
00116     void operator = (const vtkSlicerGradientsWidget&); //Not implemented.
00117   };
00118 
00119 #endif 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1