00001 // .NAME vtkSlicerMeasurementFrameWidget 00002 // .SECTION Description 00003 // This class implements Slicer's DWI Measurement Frame widget, part of the DiffusionEditor GUI. 00004 // Inherits most behavior from vtkSlicerWidget. 00005 #ifndef __vtkSlicerMeasurementFrameWidget_h 00006 #define __vtkSlicerMeasurementFrameWidget_h 00007 00008 #include "vtkVolumes.h" 00009 #include "vtkSlicerWidget.h" 00010 #include "vtkSlicerDiffusionEditorLogic.h" 00011 00012 class vtkMRMLDiffusionWeightedVolumeNode; 00013 class vtkMatrix4x4; 00014 //widgets 00015 class vtkKWPushButton; 00016 class vtkKWMatrixWidget; 00017 class vtkKWLabel; 00018 class vtkKWComboBox; 00019 class vtkKWCheckButton; 00020 class vtkKWFrameWithLabel; 00021 00022 class VTK_VOLUMES_EXPORT vtkSlicerMeasurementFrameWidget : public vtkSlicerWidget 00023 { 00024 public: 00025 00026 // Description: 00027 // Usual vtk class functions. 00028 static vtkSlicerMeasurementFrameWidget* New(); 00029 vtkTypeRevisionMacro(vtkSlicerMeasurementFrameWidget,vtkSlicerWidget); 00030 void PrintSelf(ostream& os, vtkIndent indent); 00031 00032 // Description: 00033 // Add/Remove observers on widgets in the GUI. 00034 virtual void AddWidgetObservers(); 00035 virtual void RemoveWidgetObservers(); 00036 00037 // Description: 00038 // Propagates events generated in GUI to logic / mrml. 00039 virtual void ProcessWidgetEvents(vtkObject *caller, unsigned long event, void *callData); 00040 00041 // Description: 00042 // Updates the widget when a new ActiveVolumeNode is loaded. 00043 void UpdateWidget(vtkMRMLVolumeNode *node); 00044 00045 // Description: 00046 // Event is invoked when a matrix value changed. 00047 //BTX 00048 enum 00049 { 00050 ChangedEvent = 1234, 00051 }; 00052 //ETX 00053 00054 // Description: 00055 // Sets the Logic to the current vtkSlicerDiffusionEditorLogic of the editor. 00056 virtual void SetLogic(vtkSlicerDiffusionEditorLogic *logic); 00057 00058 vtkGetObjectMacro(Matrix, vtkMatrix4x4); 00059 00060 protected: 00061 vtkSlicerMeasurementFrameWidget(void); 00062 virtual ~vtkSlicerMeasurementFrameWidget(void); 00063 00064 // Description: 00065 // Creates the widget. 00066 virtual void CreateWidget(); 00067 00068 // Description: 00069 // Updates the MatrixWidget (GUI). 00070 void UpdateMatrix(); 00071 00072 // Description: 00073 // Saves changes of the Matrix to the ActiveVolumeNode. 00074 void SaveMatrix(); 00075 00076 // Description: 00077 // Return value is 1 if determinat is +1 or -1; otherwise 0; 00078 int CheckDeterminant(); 00079 00080 vtkMRMLDiffusionWeightedVolumeNode *ActiveVolumeNode; 00081 vtkMatrix4x4 *Matrix; 00082 vtkSlicerDiffusionEditorLogic *Logic; 00083 //widgets (GUI) 00084 vtkKWFrameWithLabel *MeasurementFrame; 00085 vtkKWMatrixWidget *MatrixWidget; 00086 vtkKWPushButton *InvertButton; 00087 vtkKWPushButton *SwapButton; 00088 vtkKWPushButton *RotateButton; 00089 vtkKWPushButton *IdentityButton; 00090 vtkKWLabel *AngleLabel; 00091 vtkKWComboBox *AngleCombobox; 00092 vtkKWCheckButton* Checkbuttons[3]; 00093 00094 private: 00095 vtkSlicerMeasurementFrameWidget (const vtkSlicerMeasurementFrameWidget&); // Not implemented. 00096 void operator = (const vtkSlicerMeasurementFrameWidget&); //Not implemented. 00097 }; 00098 00099 #endif
1.6.1