vtkPETCTFusionGUI.h

Go to the documentation of this file.
00001 // .NAME vtkPETCTFusionGUI
00002 // .SECTION Description
00003 // Slicer Welcome and Overview
00004 
00005 
00006 #ifndef __vtkPETCTFusionGUI_h
00007 #define __vtkPETCTFusionGUI_h
00008 
00009 #include "vtkPETCTFusionWin32Header.h"
00010 #include "vtkSlicerModuleGUI.h"
00011 #include "vtkMRMLPETCTFusionNode.h"
00012 #include "vtkMRMLColorNode.h"
00013 #include "vtkPETCTFusionLogic.h"
00014 #include "vtkSlicerModuleCollapsibleFrame.h"
00015 #include <string>
00016 
00017 class vtkKWFrame;
00018 class vtkKWCheckButton;
00019 class vtkSlicerNodeSelectorWidget;
00020 class vtkKWRadioButton;
00021 class vtkKWRadioButtonSet;
00022 class vtkKWEntry;
00023 class vtkKWPushButton;
00024 class vtkKWLabel;
00025 class vtkKWRange;
00026 class vtkKWMenuButton;
00027 class vtkSlicerPopUpHelpWidget;
00028 class vtkKWMultiColumnList;
00029 class vtkKWMultiColumnListWithScrollbars;
00030 class vtkKWRadioButtonSetWithLabel;
00031 
00032 class VTK_PETCTFUSION_EXPORT vtkPETCTFusionGUI : public vtkSlicerModuleGUI
00033 {
00034   public:
00035   static vtkPETCTFusionGUI *New();
00036   vtkTypeRevisionMacro(vtkPETCTFusionGUI,vtkSlicerModuleGUI);
00037   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00039   // Description:
00040   // Set the logic pointer from parent class pointer.
00041   // Overloads implementation in vtkSlicerModulesGUI
00042   // to allow loadable modules.
00043   virtual void SetModuleLogic ( vtkSlicerLogic *logic )
00044   {
00045   this->SetLogic(reinterpret_cast<vtkPETCTFusionLogic*> (logic)); 
00046   };
00047 
00048   // Description: 
00049   // Get the categorization of the module.
00050   const char *GetCategory() const
00051   { return "Quantification"; }
00052 
00053   // Description:
00054   // Get/Set on Module Logic
00055   vtkGetObjectMacro (Logic, vtkPETCTFusionLogic);
00056   vtkSetObjectMacro (Logic, vtkPETCTFusionLogic);
00057 
00058    // Description:
00059   // Get/Set on PETCTFusion MRML node
00060   vtkGetObjectMacro (PETCTFusionNode, vtkMRMLPETCTFusionNode );
00061   vtkSetObjectMacro (PETCTFusionNode, vtkMRMLPETCTFusionNode );
00062   
00063   // Description:
00064   // Get/Set on all module widgets
00065   vtkGetObjectMacro(CTSelector, vtkSlicerNodeSelectorWidget);
00066   vtkGetObjectMacro(PETSelector, vtkSlicerNodeSelectorWidget);
00067   vtkGetObjectMacro(MaskSelector, vtkSlicerNodeSelectorWidget);
00068   vtkGetObjectMacro(VolumeRenderCheckbox, vtkKWCheckButton);
00069   vtkGetObjectMacro(TissueConcentrationEntry, vtkKWEntry);
00070   vtkGetObjectMacro(InjectedDoseEntry, vtkKWEntry);
00071   vtkGetObjectMacro(PatientWeightEntry, vtkKWEntry);
00072   vtkGetObjectMacro(ComputeButton, vtkKWPushButton);
00073   vtkGetObjectMacro(SaveButton, vtkKWPushButton);
00074   vtkGetObjectMacro (GetFromDICOMButton, vtkKWPushButton );
00075   vtkGetObjectMacro(HelpButton, vtkSlicerPopUpHelpWidget);
00076   vtkGetObjectMacro (PETRange, vtkKWRange );
00077   vtkGetObjectMacro (CTRange, vtkKWRange );  
00078   vtkGetObjectMacro (DoseUnitsMenuButton, vtkKWMenuButton );
00079   vtkGetObjectMacro (TissueUnitsMenuButton, vtkKWMenuButton );
00080   vtkGetObjectMacro (WeightUnitsMenuButton, vtkKWMenuButton );
00081   vtkGetObjectMacro ( ColorSet, vtkKWRadioButtonSetWithLabel );
00082 
00083   vtkGetObjectMacro ( ClearPlotArrayButton, vtkKWPushButton );
00084   vtkGetObjectMacro ( AddToPlotArrayButton, vtkKWPushButton );
00085   vtkGetObjectMacro ( ShowPlotButton, vtkKWPushButton );
00086   vtkGetObjectMacro ( SavePlotArrayButton, vtkKWPushButton );
00087 
00088   // Description:
00089   // Methods for building the module GUI (main BuildGUI method
00090   // and methods it calls for building each GUI sub-panel.
00091   virtual void BuildGUI ( );
00092   //BTX
00093   using vtkSlicerComponentGUI::BuildGUI;
00094   //ETX
00095   virtual void BuildDisplayFrame(vtkKWWidget *parent);
00096   virtual void BuildFusionFrame(vtkKWWidget *parent);
00097   virtual void BuildAnalysisFrame(vtkKWWidget *parent);
00098   virtual void BuildReportFrame( vtkKWWidget *parent);
00099 
00100   // Description:
00101   // This method is called when GUI is created, when a new PET volume
00102   // is selected. It clears the nuclear medicine DICOM tags, and the results.
00103   virtual void InitializeGUI ( );
00104 
00105   // Description:
00106   // This method is called when any other MRML event triggers a need
00107   // to update the GUI.  When updateDICOMevent = 1, the panel
00108   // that displays SUV attributes collected from the DICOM header
00109   // is also cleared and updated.
00110   virtual void UpdateGUIFromMRML ( int updateDICOMevent );
00111 
00112   // Description:
00113   // Method is called when a new PET volume is selected;
00114   // It updates the GUI panel to show what LUT
00115   // is used to colorize the volume.
00116   virtual void UpdateColorRadioButtonsFromMRML ();
00117 
00118   // Description:
00119   // Removes all GUI observers. Called when module exits.
00120   virtual void TearDownGUI ( );
00121 
00122   // Description:
00123   // Defines MRML Scene events that this module observes.
00124   vtkIntArray *NewObservableEvents();
00125 
00126   // Description:
00127   // Applies the selected LUT to the Pet Volume.
00128   virtual void ColorizePETVolume(int type);
00129 
00130   // Description:
00131   // These methods are used to interactively update
00132   // the window/level display of the PET volume as
00133   // user adjusts the PETRange widget.
00134   virtual void ProcessPETRangeCommand (double min, double max);
00135   virtual void ProcessPETRangeStartCommand(double min, double max);
00136   virtual void ProcessPETRangeStopCommand ( double min, double max);
00137 
00138 
00139   // Description:
00140   // These methods are used to interactively update
00141   // the window/level display of the CT volume as
00142   // user adjusts the CTRange widget.
00143   virtual void ProcessCTRangeCommand (double min, double max);
00144   virtual void ProcessCTRangeStartCommand(double min, double max);
00145   virtual void ProcessCTRangeStopCommand ( double min, double max);
00146 
00147   // Description:
00148   // Add observers to GUI widgets
00149   virtual void AddGUIObservers ( );
00150 
00151   // Description:
00152   // Remove observers to GUI widgets
00153   virtual void RemoveGUIObservers ( );
00154 
00155   // Description:
00156   // Methods to enable/disable volume rendering...
00157   // NOT currently implemented.
00158   virtual void EnablePETCTVolumeRendering();
00159   virtual void DisablePETCTVolumeRendering();
00160 
00161   // Description:
00162   // Process observed events generated by GUI widgets
00163   virtual void ProcessGUIEvents ( vtkObject *caller, unsigned long event,
00164                                   void *callData );
00165   // Description:
00166   // Process observed events generated by the MRML scene.
00167   virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event,
00168                                   void *callData );
00169 
00170   // Description:
00171   // Describe behavior at module startup and exit.
00172   virtual void Enter ( );
00173   //BTX
00174   using vtkSlicerComponentGUI::Enter;
00175   //ETX
00176   virtual void Exit ( );
00177   virtual void Init ( );
00178 
00179   // Description:
00180   // Clears the GUI panel containing SUV
00181   // attributes parsed from the PET volume's
00182   // DICOM header.
00183   virtual void ClearDICOMInformation ( );
00184 
00185   // Description:
00186   // Clears the GUI panel that permits
00187   // manual specification of SUV attributes.
00188   virtual void ResetManualEntryGUI ( );
00189 
00190   // Description:
00191   // updates the panel containing SUV attributes
00192   // parsed from the dicom header.
00193   virtual void UpdateDICOMPanel ( );
00194 
00195   // Description:
00196   // updates the display of colorized pet based on changes to
00197   // mrml color range. Changes window, level of PET
00198   // volume's display node.
00199   virtual void UpdatePETDisplayFromMRML ( );
00200 
00201   // Description:
00202   // updates the display of colorized pet based on changes to
00203   // mrml color range. Changes window, level of CT
00204   // volume's display node.
00205   virtual void UpdateCTDisplayFromMRML ( );
00206 
00207   // Description:
00208   // When a new CT volume is selected, this method
00209   // changes its color LUT to Greyscale, if that LUT
00210   // is not already selected, and references the LUT in
00211   // MRML.
00212   virtual void ApplyDefaultCTLUT();
00213 
00214   // Description:
00215   // When a new PET volume is selected, this method
00216   // changes its color LUT to PETheat, if a valid PETLUT
00217   // is not already selected, and references the LUT in
00218   // MRML.
00219   virtual void ApplyDefaultPETLUT();
00220   
00221   // Description:
00222   // Clears the Results GUI panel of
00223   // all SUV computation results.
00224   virtual void ClearResultsTable();
00225 
00226   // Description:
00227   // Repopulates GUI panel with SUV statistics
00228   // stored in PETCTFusionNode.
00229   virtual void UpdateResultsTableFromMRML();
00230   
00231   // Description:
00232   // Show plot of timeseries SUV measurements
00233   virtual void RaisePlot();
00234 
00235   // Description:
00236   // Convenience method that returns a 
00237   // vtkMRMLColorTableNodeID given its type.
00238   const char *GetCTColorTableNodeIDByType (int type);
00239   // Description:
00240   // Convenience method that returns a
00241   // vtkPETProceduralColorNode ID given its type.
00242   const char *GetPETColorNodeIDByType(int type);
00243 
00244   
00245 
00246   // Description:
00247   // Sets the max and min values in the PET dataset.
00248   // Method invoked when NO volume is selected.
00249   virtual void InitializePETMinAndMax();
00250   // Description:
00251   // Sets the max and min values in the CT dataset.
00252   // Method invoked when NO volume is selected.
00253   virtual void InitializeCTMinAndMax();
00254 
00255 
00256 
00257 
00258   // Description:
00259   // Gets the selected PET volume, and updates
00260   // the window/level range from the volume's display node
00261   virtual void UpdatePETRangeFromMRML();
00262   // Description:
00263   // Gets the selected CT volume, and updates
00264   // the window/level range from the volume's display node
00265   virtual void UpdateCTRangeFromMRML();
00266 
00267 
00268 
00269   // Description:
00270   // Method updates node's color range
00271   // when user adjusts the module's win/lev
00272   // range widget.
00273   virtual void UpdateNodePETColorRange ( );
00274   // Description:
00275   // Method updates node's color range
00276   // when user adjusts the module's win/lev
00277   // range widget.
00278   virtual void UpdateNodeCTColorRange ( );
00279 
00280 
00281 
00282   // Description:
00283   // Method is called from method Enter()
00284   // If PET, CT, or Mask volumes have had 
00285   // display adjusted in the volumes
00286   // module, this method tracks those changes.
00287   virtual void UpdateFusionDisplayFromMRML();
00288 
00289   
00290 
00291   // Descriptoin:
00292   // Scales the PET volume's color lut over a
00293   // range of selected values.
00294   virtual void ScalePETColormap(double min, double max);
00295   // Descriptoin:
00296   // Scales the CT volume's color lut over a
00297   // range of selected values.
00298   virtual void ScaleCTColormap(double min, double max);
00299 
00300 
00301 protected:
00302   vtkPETCTFusionGUI();
00303   ~vtkPETCTFusionGUI();
00304   vtkPETCTFusionGUI(const vtkPETCTFusionGUI&);
00305   void operator=(const vtkPETCTFusionGUI&);
00306 
00307   // Description:
00308   // updates status text in the slicer window.
00309   void SetStatusText( const char *txt);
00310 
00311   vtkPETCTFusionLogic *Logic;
00312   vtkMRMLPETCTFusionNode *PETCTFusionNode;
00313 
00314   //---
00315   //--- widgets
00316   //---
00317   
00318   // Description:
00319   // Ruler GUI elements
00320   vtkSlicerNodeSelectorWidget* CTSelector;
00321   vtkSlicerNodeSelectorWidget* PETSelector;
00322   vtkSlicerNodeSelectorWidget* MaskSelector;
00323   vtkKWCheckButton *VolumeRenderCheckbox;
00324   vtkKWEntry *TissueConcentrationEntry;
00325   vtkKWEntry *InjectedDoseEntry;
00326   vtkKWEntry *PatientWeightEntry;
00327   vtkKWPushButton *ComputeButton;
00328   vtkKWPushButton *GetFromDICOMButton;
00329   vtkKWPushButton *SaveButton;
00330   vtkSlicerPopUpHelpWidget *HelpButton;
00331   vtkKWMenuButton *DoseUnitsMenuButton;
00332   vtkKWMenuButton *WeightUnitsMenuButton;
00333   vtkKWMenuButton *TissueUnitsMenuButton;  
00334   vtkKWRange *PETRange;
00335   vtkKWRange *CTRange;
00336   vtkKWRadioButtonSetWithLabel *ColorSet;
00337   vtkSlicerNodeSelectorWidget *PlotSelector;
00338 
00339   vtkKWPushButton *AddToPlotArrayButton;
00340   vtkKWPushButton *ShowPlotButton;
00341   vtkKWPushButton *SavePlotArrayButton;
00342   vtkKWPushButton *ClearPlotArrayButton;
00343 
00344   vtkMRMLDoubleArrayNode *SUVmaxArray;
00345   vtkMRMLDoubleArrayNode *SUVmeanArray;
00346 
00347   bool Raised;
00348   
00349   //--- for internal use only.
00350   vtkKWLabel *PatientWeightLabel;
00351   vtkKWLabel *InjectedDoseLabel;
00352   vtkKWLabel *PatientNameLabel;
00353   vtkKWLabel *StudyDateLabel;
00354   vtkKWMultiColumnList *ResultList;
00355   vtkKWMultiColumnListWithScrollbars *ResultListWithScrollbars;
00356 
00357   
00358   double PETMin;
00359   double PETMax;
00360   int UpdatingLUT;
00361   int UpdatingGUI;
00362 
00363 };
00364 
00365 #endif
00366 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1