vtkMRMLEMSTreeNode.h

Go to the documentation of this file.
00001 #ifndef __vtkMRMLEMSTreeNode_h
00002 #define __vtkMRMLEMSTreeNode_h
00003 
00004 #include <vector>
00005 
00006 #include "vtkMRML.h"
00007 #include "vtkMRMLNode.h"
00008 #include "vtkMRMLScene.h"
00009 #include "vtkEMSegment.h"
00010 class vtkMRMLEMSTreeParametersParentNode;
00011 class vtkMRMLEMSTreeParametersLeafNode;
00012 // Legacy
00013 class vtkMRMLEMSTreeParametersNode;
00014 
00015 class VTK_EMSEGMENT_EXPORT vtkMRMLEMSTreeNode : 
00016   public vtkMRMLNode
00017 {
00018 public:
00019   static vtkMRMLEMSTreeNode *New();
00020   vtkTypeMacro(vtkMRMLEMSTreeNode,vtkMRMLNode);
00021   void PrintSelf(ostream& os, vtkIndent indent);
00022 
00023   virtual vtkMRMLNode* CreateNodeInstance();
00024 
00025   // Description:
00026   // Set node attributes
00027   virtual void ReadXMLAttributes(const char** atts);
00028 
00029   // Description:
00030   // Write this node's information to a MRML file in XML format.
00031   virtual void WriteXML(ostream& of, int indent);
00032 
00033   // Description:
00034   // Copy the node's attributes to this object
00035   virtual void Copy(vtkMRMLNode *node);
00036 
00037   // Description:
00038   // Get node XML tag name (like Volume, Model)
00039   virtual const char* GetNodeTagName() {return "EMSTree";}
00040 
00041   // Description:
00042   // Updates this node if it depends on other nodes
00043   // when the node is deleted in the scene
00044   virtual void UpdateReferences();
00045 
00046   // Description:
00047   // Update the stored reference to another node in the scene
00048   virtual void UpdateReferenceID(const char *oldID, const char *newID);
00049 
00050 
00051   // access child nodes
00052   virtual void AddChildNode(const char* childNodeID);
00053   virtual void SetNthChildNode(int n, const char* childNodeID);
00054 
00055   virtual int  GetNumberOfChildNodes();
00056   virtual const char* GetNthChildNodeID(int n);
00057   virtual vtkMRMLEMSTreeNode* GetNthChildNode(int n);
00058 
00059   virtual void RemoveNthChildNode(int index);
00060   virtual void MoveNthChildNode(int fromIndex, int toIndex);  
00061   virtual int GetChildIndexByMRMLID(const char* childID);
00062 
00063   // manipulate target input channels
00064   vtkGetMacro(NumberOfTargetInputChannels, unsigned int);
00065   virtual void SetNumberOfTargetInputChannels(unsigned int n);
00066   virtual void AddTargetInputChannel();
00067   virtual void RemoveNthTargetInputChannel(int index);
00068   virtual void MoveNthTargetInputChannel(int fromIndex, int toIndex);
00069 
00070   // The parent EMSTreeNode 
00071   vtkGetStringMacro(ParentNodeID);
00072   vtkSetReferenceStringMacro(ParentNodeID);
00073   virtual vtkMRMLEMSTreeNode* GetParentNode();
00074 
00075   // for legacy 
00076   virtual vtkMRMLEMSTreeParametersNode* GetTreeParametersNode();
00077 
00078   // additional parameters valid for leaf nodes
00079   vtkSetReferenceStringMacro(LeafParametersNodeID);
00080   vtkGetStringMacro(LeafParametersNodeID);
00081   virtual vtkMRMLEMSTreeParametersLeafNode* GetLeafParametersNode();
00082   
00083   // additional parameters valid for parent nodes
00084   vtkSetReferenceStringMacro(ParentParametersNodeID);
00085   vtkGetStringMacro(ParentParametersNodeID);
00086   virtual vtkMRMLEMSTreeParametersParentNode* GetParentParametersNode();
00087 
00088   // input channel weights; length=NumberOfTargetInputChannels
00089   virtual double GetInputChannelWeight(int index) const;
00090   virtual void SetInputChannelWeight(int index, double value);
00091   
00092   // name of the spatial prior volume in the atlas
00093   vtkGetStringMacro(SpatialPriorVolumeName);
00094   vtkSetStringMacro(SpatialPriorVolumeName);
00095 
00096   // regulates the influence of the spatial prior
00097   // 0 => no influence, 1 => maximum influence
00098   vtkGetMacro(SpatialPriorWeight, double);
00099   vtkSetMacro(SpatialPriorWeight, double);
00100   
00101   // the relative probability of this class verses other classes at
00102   // the same level
00103   vtkGetMacro(ClassProbability, double);
00104   vtkSetMacro(ClassProbability, double);
00105 
00106   // Kilian: fill this in
00107   vtkGetMacro(ExcludeFromIncompleteEStep, int);
00108   vtkSetMacro(ExcludeFromIncompleteEStep, int);
00109   
00110   // Kilian: fill this in
00111   vtkGetMacro(PrintWeights, int);
00112   vtkSetMacro(PrintWeights, int);
00113 
00114   vtkSetVectorMacro(ColorRGB, double, 3);
00115   vtkGetVectorMacro(ColorRGB, double, 3);
00116   
00117 protected:
00118   vtkMRMLEMSTreeNode();
00119   ~vtkMRMLEMSTreeNode();
00120   vtkMRMLEMSTreeNode(const vtkMRMLEMSTreeNode&);
00121   void operator=(const vtkMRMLEMSTreeNode&);
00122 
00123   // parent of this node
00124   char*                               ParentNodeID;
00125   
00126   // children of this node
00127   //BTX
00128   std::vector<std::string>            ChildNodeIDs;
00129   //ETX
00130   
00131   // For legacy purpose 
00132   vtkGetStringMacro(TreeParametersNodeID);
00133   vtkSetReferenceStringMacro(TreeParametersNodeID);
00134   char*                                 TreeParametersNodeID;
00135   // references to other nodes
00136   char*                               LeafParametersNodeID;
00137   char*                               ParentParametersNodeID;
00138 
00139   double                              ColorRGB[3];
00140 
00141   //BTX
00142   typedef vtkstd::vector<double>      ChannelWeightListType;
00143  ChannelWeightListType  InputChannelWeights;
00144   //ETX
00145 
00146   char*                               SpatialPriorVolumeName;
00147   double                              SpatialPriorWeight;
00148 
00149   double                              ClassProbability;
00150   int                                 ExcludeFromIncompleteEStep;
00151   int                                 PrintWeights;
00152 
00153   unsigned int                        NumberOfTargetInputChannels;
00154 
00155 };
00156 
00157 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1