vtkEMSegmentAnatomicalStructureStep.h

Go to the documentation of this file.
00001 #ifndef __vtkEMSegmentAnatomicalStructureStep_h
00002 #define __vtkEMSegmentAnatomicalStructureStep_h
00003 
00004 #include "vtkEMSegmentStep.h"
00005 
00006 class vtkKWFrameWithLabel;
00007 class vtkKWEntryWithLabel;
00008 //class vtkKWChangeColorButton;
00009 class vtkKWMenu;
00010 class vtkKWTreeWithScrollbars;
00011 class vtkKWPushButtonSet;
00012 class vtkSlicerNodeSelectorWidget;
00013 class vtkKWMultiColumnListWithScrollbars;
00014 class vtkKWCheckButton;
00015 class vtkKWFrame;
00016 class vtkKWLabelWithLabel;
00017 class vtkKWTopLevel;
00018 class vtkKWPushButton;
00019 
00020 class VTK_EMSEGMENT_EXPORT vtkEMSegmentAnatomicalStructureStep : public vtkEMSegmentStep
00021 {
00022 public:
00023   static vtkEMSegmentAnatomicalStructureStep *New();
00024   vtkTypeRevisionMacro(vtkEMSegmentAnatomicalStructureStep,vtkEMSegmentStep);
00025   void PrintSelf(ostream& os, vtkIndent indent);
00026 
00027   // Description:
00028   // Reimplement the superclass's method (see vtkKWWizardStep).
00029   virtual void ShowUserInterface();
00030 
00031   // Description:
00032   // The anatomical tree is shared between several steps
00033   vtkGetObjectMacro(AnatomicalStructureTree, vtkKWTreeWithScrollbars);
00034   virtual void ShowAnatomicalStructureTree(vtkKWFrame * parent = NULL);
00035   virtual void SetAnatomicalTreeNodesSelectableOn();
00036   virtual void SetAnatomicalTreeLeafNodeSelectableState(
00037     const char* parent, int state);
00038   virtual void SetAnatomicalTreeParentNodeSelectableState(
00039     const char* parent, int state);
00040 
00041   // Description:
00042   // Callbacks.
00043   virtual void SelectedAnatomicalNodeChangedCallback();
00044   virtual void PopupNodeContextMenuCallback(const char *node);
00045   virtual void DeleteNodeCallback(vtkIdType);
00046   virtual void AddChildNodeCallback(vtkIdType);
00047   virtual void NodeParentChangedCallback(
00048     const char*, const char*, const char*);
00049   virtual void SelectedNodeNameChangedCallback(
00050     vtkIdType, const char*);
00051   virtual void SelectedNodeIntensityLabelChangedCallback(
00052     vtkIdType, int);
00053   virtual void SelectedNodeColorChangedCallback(
00054     vtkIdType, double r, double g, double b);
00055   virtual void OpenTreeCallback();
00056   virtual void CloseTreeCallback();
00057   void  RemoveAnatomicalStructureTree();
00058   void PopUpLabelColorSelect();
00059   void LabelWindowCollapseCallback();
00060 
00061 protected:
00062   vtkEMSegmentAnatomicalStructureStep();
00063   ~vtkEMSegmentAnatomicalStructureStep();
00064 
00065   vtkKWMenu *ContextMenu;
00066 
00067   vtkKWTreeWithScrollbars *AnatomicalStructureTree;
00068   vtkKWFrameWithLabel     *AnatomicalStructureFrame;
00069   vtkKWPushButtonSet      *AnatomicalStructureTreeButtonSet;
00070 
00071   vtkKWFrameWithLabel                *AnatomicalNodeAttributesFrame;
00072   vtkKWEntryWithLabel                *AnatomicalNodeAttributeNameEntry;
00073   vtkKWEntryWithLabel                *AnatomicalNodeIntensityLabelEntry;
00074   vtkKWPushButton                    *AnatomicalNodeAttributeColorButton;
00075   vtkKWLabelWithLabel                *AnatomicalNodeAttributeColorLabel;
00076   vtkKWCheckButton                   *ShowOnlyNamedColorsCheckButton;
00077   vtkKWMultiColumnListWithScrollbars *ColorMultiColumnList;
00078   int NumberOfColumns;
00079   bool MultiSelectMode;
00080   vtkKWFrameWithLabel                *ColormapFrame;
00081   vtkSlicerNodeSelectorWidget        *ColorSelectorWidget;
00082 
00083   vtkCallbackCommand      *SelectedColorChangedCallbackCommand;
00084   vtkCallbackCommand      *SelectedColormapChangedCallbackCommand;
00085 
00086   vtkKWTopLevel* LabelTopLevel;
00087   vtkKWPushButton* LabelApply;
00088   vtkKWFrame* LabelTopLevelFrame; 
00089 
00090   //BTX
00091   enum
00092     {
00093       EntryColumn = 0,
00094       NameColumn = 1,
00095       ColourColumn = 2,
00096     };
00097   //ETX
00098   
00099   // Description:
00100   // The anatomical tree (common to several steps)
00101   virtual void PopulateAnatomicalStructureTree(const char*, vtkIdType);
00102 
00103   static void SelectedColormapChangedCallback(vtkObject *caller,  
00104                      unsigned long eid, void *clientData, void *callData);
00105   static void SelectedColorChangedCallback(vtkObject *caller, 
00106                      unsigned long eid, void *clientData, void *callData);
00107   
00108 private:
00109   vtkEMSegmentAnatomicalStructureStep(const vtkEMSegmentAnatomicalStructureStep&);
00110   void operator=(const vtkEMSegmentAnatomicalStructureStep&);
00111 
00112   void UpdateAnatomicalNodeAttributeColorButton();
00113   void AddSelectedColorChangedObserver();
00114   void RemoveSelectedColorChangedObserver();
00115 
00116   // Select a row in ColorMultiColumnList that has the matching entryValue
00117   // Return -1 with no selection performed if such an entry does not exist.
00118   int SelectRowByIntensityLabelEntryValue(int entryValue, int columnIndex = EntryColumn);
00119 
00120   // Get the intensity label value of the first selected row in ColorMultiColumnList
00121   // return -1 if no row has been selected
00122   int GetIntensityLabelEntryValueOfFirstSelectedRow(int columnIndex = EntryColumn);
00123 
00124   // AnatomicalNodeIntensityLabelEntry and ColorMultiColumnList are sending update
00125   // messages to each other, we need a lock to prevent endless loop.
00126   bool LockSelectedColorChangedMessage;
00127 
00128 };
00129 
00130 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1