vtkEMSegmentMRMLManager.h

Go to the documentation of this file.
00001 #ifndef __vtkEMSegmentMRMLManager_h
00002 #define __vtkEMSegmentMRMLManager_h
00003 
00004 #include "vtkEMSegment.h"
00005 #include <vtkSetGet.h>
00006 
00007 class vtkMRMLEMSGlobalParametersNode;
00008 class vtkMRMLEMSTemplateNode;
00009 class vtkMRMLEMSAtlasNode;
00010 class vtkMRMLEMSTreeNode;
00011 class vtkMRMLEMSTreeParametersNode;
00012 class vtkMRMLEMSTreeParametersParentNode;
00013 class vtkMRMLEMSWorkingDataNode;
00014 class vtkMRMLScalarVolumeNode;
00015 class vtkMRMLVolumeNode;
00016 class vtkMRMLEMSVolumeCollectionNode;
00017 // need enum values
00018 #include "vtkMRMLEMSTreeParametersLeafNode.h"
00019 
00020 class vtkMRMLScene;
00021 
00022 #include <vtksys/stl/string>
00023 #include <vtksys/stl/map>
00024 #include <vtksys/stl/vector>
00025 
00026 class VTK_EMSEGMENT_EXPORT vtkEMSegmentMRMLManager : 
00027   public vtkObject
00028 {
00029 public:
00030   static vtkEMSegmentMRMLManager *New();
00031   vtkTypeMacro(vtkEMSegmentMRMLManager,vtkObject);
00032   void PrintSelf(ostream& os, vtkIndent indent);
00033 
00034   // Prints out important info about the current template / task 
00035   void PrintInfo(ostream& os);
00036   void PrintInfo();
00037 
00038   // Get/Set the current mrml scene
00039   vtkSetObjectMacro(MRMLScene, vtkMRMLScene);
00040   vtkGetObjectMacro(MRMLScene, vtkMRMLScene);
00041 
00042   // Get/Set MRML node storing parameter values
00043   virtual int SetNodeWithCheck(vtkMRMLEMSTemplateNode*);
00044   vtkGetObjectMacro(Node, vtkMRMLEMSTemplateNode);
00045 
00046   // this will be be passed along by the logic node 
00047   virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event,
00048                                    void *callData );
00049 
00050   int CreateTemplateFile();
00051 
00052   //
00053   // functions for getting and setting the current template builder
00054   // node (i.e. the set of parameters to edit and use)
00055   //
00056   virtual int         GetNumberOfParameterSets();
00057   virtual const char* GetNthParameterSetName(int n);
00058   virtual void SetNthParameterName(int n, const char* newName);
00059 
00060   // this functions creates a full set of MRML nodes for this module,
00061   // populates the nodes with default values, adds the nodes to the
00062   // MRML scene.
00063   virtual void        CreateAndObserveNewParameterSet();
00064   virtual int         SetLoadedParameterSetIndex(int i);
00065   virtual int         CheckEMSTemplateVolumeNodes(vtkMRMLEMSTemplateNode* emsTemplateNode);
00066 
00067   //
00068   // functions for manipulating the tree structure
00069   //
00070   virtual vtkIdType GetTreeRootNodeID();  
00071   virtual int       GetTreeNodeIsLeaf(vtkIdType nodeID);
00072   virtual int       GetTreeNodeNumberOfChildren(vtkIdType nodeID);
00073   virtual vtkIdType GetTreeNodeChildNodeID(vtkIdType parentNodeID, 
00074                                            int childIndex);
00075   virtual vtkIdType GetTreeNodeParentNodeID(vtkIdType childNodeID);
00076   virtual void      SetTreeNodeParentNodeID(vtkIdType childNodeID, 
00077                                             vtkIdType newParentNodeID);
00078   virtual vtkIdType AddTreeNode(vtkIdType parentNodeID);
00079   virtual void      RemoveTreeNode(vtkIdType removedNodeID);
00080 
00081   //
00082   // functions for accessing tree-node parameters
00083   //
00084 
00085   // Step 1
00086   int         GetTreeNodeIntensityLabel(vtkIdType nodeID);
00087   virtual void        SetTreeNodeIntensityLabel(vtkIdType nodeID, int label);
00088 
00089   virtual const char* GetTreeNodeName(vtkIdType id);
00090   virtual void        SetTreeNodeName(vtkIdType id, const char* label);
00091 
00092   virtual void        GetTreeNodeColor(vtkIdType nodeID, double rgb[3]);
00093   virtual void        SetTreeNodeColor(vtkIdType nodeID, double rgb[3]);
00094 
00095   // Step 2 see below (volume access)
00096 
00097   // Step 3 does not depend on tree structure
00098 
00099   // Step 4
00100   
00101   //BTX
00102   enum
00103     {
00104     DistributionSpecificationManual = 
00105     vtkMRMLEMSTreeParametersLeafNode::DistributionSpecificationManual,
00106     DistributionSpecificationManuallySample = 
00107     vtkMRMLEMSTreeParametersLeafNode::DistributionSpecificationManuallySample,
00108     DistributionSpecificationAutoSample =
00109     vtkMRMLEMSTreeParametersLeafNode::DistributionSpecificationAutoSample
00110     };
00111   //ETX
00112   virtual int   GetTreeNodeDistributionSpecificationMethod(vtkIdType nodeID);
00113   virtual void  SetTreeNodeDistributionSpecificationMethod(vtkIdType nodeID, 
00114                                                            int method);
00115   virtual void  ChangeTreeNodeDistributionsFromManualSamplingToManual();
00116   virtual void  SetTreeNodeDistributionLogMean(vtkIdType nodeID, int volumeNumber, double value);
00117 
00118   virtual double   GetTreeNodeDistributionLogMeanWithCorrection(vtkIdType nodeID, int volumeNumber);
00119 
00120   virtual void     SetTreeNodeDistributionLogCovariance(vtkIdType nodeID, 
00121                                                         int rowIndex, 
00122                                                         int columnIndex,
00123                                                         double value);
00124 
00125 
00126   virtual double   GetTreeNodeDistributionLogCovarianceWithCorrection(vtkIdType nodeID, int rowIndex, int columnIndex);
00127 
00128   virtual bool     IsTreeNodeDistributionLogCovarianceWithCorrectionInvertableAndSemiDefinite(vtkIdType nodeID);
00129 
00130   virtual int      GetTreeNodeDistributionNumberOfSamples(vtkIdType nodeID);
00131 
00132   // send RAS coordinates
00133   virtual int   AddTreeNodeDistributionSamplePoint(vtkIdType nodeID, 
00134                                                    double xyz[3]);
00135   virtual void  RemoveTreeNodeDistributionSamplePoint(vtkIdType nodeID, 
00136                                                       int samplePointNumber);
00137   virtual void  RemoveAllTreeNodeDistributionSamplePoints(vtkIdType nodeID);
00138   virtual void  GetTreeNodeDistributionSamplePoint(vtkIdType nodeID, 
00139                                                    int tupleNumber, 
00140                                                    double xyz[3]);
00141 
00142   virtual double 
00143   GetTreeNodeDistributionSampleIntensityValue(vtkIdType nodeID, 
00144                                               int tupleNumber, 
00145                                               vtkIdType volumeID);
00146 
00147   virtual void     UpdateIntensityDistributions();
00148 
00149   // Step 5
00150 
00151   virtual int      GetTreeNodePrintWeight(vtkIdType nodeID);
00152   virtual void     SetTreeNodePrintWeight(vtkIdType nodeID, int shouldPrint);
00153 
00154   virtual int      GetTreeNodePrintQuality(vtkIdType nodeID);
00155   virtual void     SetTreeNodePrintQuality(vtkIdType nodeID, int shouldPrint);
00156 
00157   virtual int      GetTreeNodePrintFrequency(vtkIdType nodeID);
00158   virtual void     SetTreeNodePrintFrequency(vtkIdType nodeID, 
00159                                              int shouldPrint);
00160 
00161   virtual int      GetTreeNodePrintLabelMap(vtkIdType nodeID);
00162   virtual void     SetTreeNodePrintLabelMap(vtkIdType nodeID, int shouldPrint);
00163 
00164   virtual int      GetTreeNodePrintEMLabelMapConvergence(vtkIdType nodeID);
00165   virtual void     SetTreeNodePrintEMLabelMapConvergence(vtkIdType nodeID, 
00166                                                          int shouldPrint);
00167   
00168   virtual int      GetTreeNodePrintEMWeightsConvergence(vtkIdType nodeID);
00169   virtual void     SetTreeNodePrintEMWeightsConvergence(vtkIdType nodeID, 
00170                                                         int shouldPrint);
00171 
00172   virtual int      GetTreeNodePrintMFALabelMapConvergence(vtkIdType nodeID);
00173   virtual void     SetTreeNodePrintMFALabelMapConvergence(vtkIdType nodeID, 
00174                                                           int shouldPrint);
00175 
00176   virtual int      GetTreeNodePrintMFAWeightsConvergence(vtkIdType nodeID);
00177   virtual void     SetTreeNodePrintMFAWeightsConvergence(vtkIdType nodeID, 
00178                                                          int shouldPrint);
00179 
00180   virtual int      GetTreeNodeGenerateBackgroundProbability(vtkIdType nodeID);
00181   virtual void     SetTreeNodeGenerateBackgroundProbability(vtkIdType nodeID, 
00182                                                             int value);
00183 
00184   virtual int      GetTreeNodeExcludeFromIncompleteEStep(vtkIdType nodeID);
00185   virtual void     SetTreeNodeExcludeFromIncompleteEStep(vtkIdType nodeID, 
00186                                                          int shouldExclude);
00187 
00188   virtual double   GetTreeNodeAlpha(vtkIdType nodeID);
00189   virtual void     SetTreeNodeAlpha(vtkIdType nodeID, double value);
00190   
00191   virtual int      GetTreeNodePrintBias(vtkIdType nodeID);
00192   virtual void     SetTreeNodePrintBias(vtkIdType nodeID, int shouldPrint);
00193 
00194   virtual int      GetTreeNodeBiasCalculationMaxIterations(vtkIdType nodeID);
00195   virtual void     SetTreeNodeBiasCalculationMaxIterations(vtkIdType nodeID, 
00196                                                            int value);
00197 
00198   virtual int      GetTreeNodeSmoothingKernelWidth(vtkIdType nodeID);
00199   virtual void     SetTreeNodeSmoothingKernelWidth(vtkIdType nodeID, 
00200                                                    int value);
00201 
00202   virtual double   GetTreeNodeSmoothingKernelSigma(vtkIdType nodeID);
00203   virtual void     SetTreeNodeSmoothingKernelSigma(vtkIdType nodeID, 
00204                                                    double value);
00205 
00206   virtual double   GetTreeNodeClassProbability(vtkIdType nodeID);
00207   virtual void     SetTreeNodeClassProbability(vtkIdType nodeID, double value);
00208 
00209   virtual double   GetTreeNodeChildrenSumClassProbability(vtkIdType nodeID);
00210 
00211   virtual double   GetTreeNodeSpatialPriorWeight(vtkIdType nodeID);
00212   virtual void     SetTreeNodeSpatialPriorWeight(vtkIdType nodeID, double value);
00213 
00214   virtual double   GetTreeNodeInputChannelWeight(vtkIdType nodeID, 
00215                                                  int volumeNumber);
00216   virtual void     SetTreeNodeInputChannelWeight(vtkIdType nodeID, 
00217                                                  int volumeNumber, 
00218                                                  double value);
00219 
00220   virtual int      GetTreeNodeStoppingConditionEMType(vtkIdType nodeID);
00221   virtual void     SetTreeNodeStoppingConditionEMType(vtkIdType nodeID, 
00222                                                       int conditionType);
00223   
00224   virtual double   GetTreeNodeStoppingConditionEMValue(vtkIdType nodeID);
00225   virtual void     SetTreeNodeStoppingConditionEMValue(vtkIdType nodeID, 
00226                                                        double value);
00227   
00228   virtual int      GetTreeNodeStoppingConditionEMIterations(vtkIdType nodeID);
00229   virtual void     SetTreeNodeStoppingConditionEMIterations(vtkIdType nodeID,
00230                                                             int iterations);
00231 
00232   //BTX
00233   enum
00234     {
00235     StoppingConditionIterations = 0,
00236     StoppingConditionLabelMapMeasure = 1,
00237     StoppingConditionWeightsMeasure = 2
00238     };
00239   //ETX
00240   virtual int      GetTreeNodeStoppingConditionMFAType(vtkIdType nodeID);
00241   virtual void     SetTreeNodeStoppingConditionMFAType(vtkIdType nodeID, 
00242                                                        int conditionType);
00243   
00244   virtual double   GetTreeNodeStoppingConditionMFAValue(vtkIdType nodeID);
00245   virtual void     SetTreeNodeStoppingConditionMFAValue(vtkIdType nodeID, 
00246                                                         double value);
00247   
00248   virtual int      GetTreeNodeStoppingConditionMFAIterations(vtkIdType nodeID);
00249   virtual void     SetTreeNodeStoppingConditionMFAIterations(vtkIdType nodeID,
00250                                                              int iterations);
00251 
00252   // Step 6 does not depend on tree structure
00253 
00254   // Step 7 does not depend on tree structure
00255 
00256   //
00257   // functions for checking tree node parameters
00258   //
00259   virtual vtkIdType GetTreeNodeFirstIDWithChildProbabilityError();
00260 
00261   //
00262   // functions for accessing volumes
00263   //
00264   virtual int       GetVolumeNumberOfChoices();
00265   virtual vtkIdType GetVolumeNthID(int n);
00266   virtual const char* GetVolumeName(vtkIdType volumeID);
00267 
00268   // spatial prior volumes
00269   virtual vtkIdType GetTreeNodeSpatialPriorVolumeID(vtkIdType nodeID);
00270   virtual void      SetTreeNodeSpatialPriorVolumeID(vtkIdType nodeID, vtkIdType volumeID);
00271   vtkMRMLVolumeNode* GetAlignedSpatialPriorFromTreeNodeID(vtkIdType nodeID);
00272 
00273   virtual vtkIdType GetTreeNodeSubParcellationVolumeID(vtkIdType nodeID);
00274   virtual void      SetTreeNodeSubParcellationVolumeID(vtkIdType nodeID, vtkIdType volumeID);
00275   vtkMRMLVolumeNode* GetAlignedSubParcellationFromTreeNodeID(vtkIdType nodeID);
00276 
00277   virtual void      SetEnableSubParcellation(int state);
00278   virtual int       GetEnableSubParcellation();
00279 
00280   virtual void      SetMinimumIslandSize(int value);
00281   virtual int       GetMinimumIslandSize();
00282 
00283   // target volumes
00284   virtual int         GetTargetNumberOfSelectedVolumes();
00285   // index in [0, #selected volumes)
00286   virtual vtkIdType   GetTargetSelectedVolumeNthID(int n); 
00287   virtual const char* GetTargetSelectedVolumeNthMRMLID(int n); 
00288 
00289   //BTX
00290   virtual void
00291     ResetTargetSelectedVolumes(const std::vector<vtkIdType>& volumeID);
00292   //ETX
00293   virtual void        AddTargetSelectedVolume(vtkIdType volumeID);
00294   virtual void        AddTargetSelectedVolumeByMRMLID(char* mrmlID);
00295   virtual void        RemoveTargetSelectedVolume(vtkIdType volumeID);
00296   virtual void        RemoveTargetSelectedVolumeIndex(vtkIdType imageIndex);
00297 
00298   virtual void        MoveNthTargetSelectedVolume(int fromIndex,
00299                                                   int toIndex);
00300   virtual void        MoveTargetSelectedVolume(vtkIdType volumeID,
00301                                                int toIndex);
00302 
00303   virtual bool        DoTargetAndAtlasDataTypesMatch( vtkMRMLEMSVolumeCollectionNode* targetNode, vtkMRMLEMSAtlasNode* atlasNode ); 
00304 
00305   //
00306   // registration parameters
00307   //
00308 
00309   //BTX
00310   enum
00311     {
00312     RegistrationTest = -1,
00313     RegistrationOff  = 0,
00314     RegistrationFast = 1,
00315     RegistrationSlow = 2
00316     };
00317   //ETX
00318   virtual int       GetRegistrationAffineType();
00319   virtual void      SetRegistrationAffineType(int affineType);
00320 
00321   int GetRegistrationTypeFromString(const char* type);
00322 
00323   virtual int       GetRegistrationDeformableType();
00324   virtual void      SetRegistrationDeformableType(int deformableType);
00325 
00326   virtual int       GetEnableTargetToTargetRegistration();
00327   virtual void      SetEnableTargetToTargetRegistration(int enable);
00328 
00329   virtual const char*  GetColorNodeID();
00330   virtual void         SetColorNodeID(const char* colormap);
00331 
00332   //BTX
00333   enum
00334     {
00335     InterpolationLinear = 0,
00336     InterpolationNearestNeighbor = 1,
00337     // !!!todo!!! there is no corresponding definition in the algorithm!
00338     InterpolationCubic = 2
00339     };
00340   //ETX
00341   virtual int       GetRegistrationInterpolationType();
00342   virtual void      SetRegistrationInterpolationType(int interpolationType);
00343   int               GetInterpolationTypeFromString(const char* type);
00344 
00345   //BTX
00346   enum
00347     {
00348     CMTK = 0,
00349     BRAINS = 1,
00350     };
00351   //ETX
00352   virtual int       GetRegistrationPackageType();
00353   virtual void      SetRegistrationPackageType(int packageType);
00354   int               GetPackageTypeFromString(const char* type);
00355 
00356   virtual vtkIdType GetRegistrationAtlasVolumeID();
00357   virtual void      SetRegistrationAtlasVolumeID(vtkIdType volumeID);
00358 
00359   virtual vtkIdType GetRegistrationAtlasVolumeID(vtkIdType inputID);
00360   virtual void      SetRegistrationAtlasVolumeID(vtkIdType inputID, vtkIdType volumeID);
00361   virtual bool      ExistRegistrationAtlasVolumeKey(vtkIdType inputID);
00362 
00363   virtual void   SetTargetSelectedVolumeNthID(int n, vtkIdType newVolumeID); 
00364   virtual void SetTargetSelectedVolumeNthMRMLID(int n, const char* mrmlID); 
00365 
00366   virtual double   GetTreeNodeDistributionMeanWithCorrection(vtkIdType nodeID, int volumeNumber);
00367   virtual void     SetTreeNodeDistributionMeanWithCorrection(vtkIdType nodeID, int volumeNumber, double value);
00368   virtual void     ResetTreeNodeDistributionLogMeanCorrection(vtkIdType nodeID); 
00369 
00370   void ResetTreeNodeDistributionLogCovarianceCorrection(vtkIdType nodeID); 
00371   // Resets the LogCovariance of the entire tree
00372   void ResetLogCovarianceCorrectionOfAllNodes();
00373   void SetTreeNodeDistributionLogCovarianceWithCorrection(vtkIdType nodeID, int rowIndex, int columnIndex, double value);
00374 
00375   //
00376   // save parameters
00377   //
00378   virtual const char*  GetSaveWorkingDirectory();
00379   virtual void         SetSaveWorkingDirectory(const char* directory);
00380 
00381   virtual const char*  GetSaveTemplateFilename();
00382   virtual void         SetSaveTemplateFilename(const char* file);
00383 
00384   virtual int          GetSaveTemplateAfterSegmentation();
00385   virtual void         SetSaveTemplateAfterSegmentation(int shouldSave);
00386 
00387   virtual int          GetSaveIntermediateResults();
00388   virtual void         SetSaveIntermediateResults(int shouldSaveResults);
00389 
00390   virtual int          GetSaveSurfaceModels();
00391   virtual void         SetSaveSurfaceModels(int shouldSaveModels);
00392 
00393   virtual const char*  GetOutputVolumeMRMLID();
00394   virtual void         SetOutputVolumeMRMLID(const char* mrmlID);
00395 
00396   //
00397   // miscellaneous
00398   //
00399   virtual int       GetEnableMultithreading();
00400   virtual void      SetEnableMultithreading(int isEnabled);
00401 
00402   virtual int       GetUpdateIntermediateData();
00403   virtual void      SetUpdateIntermediateData(int shouldUpdate);
00404 
00405   virtual int       GetAtlasNumberOfTrainingSamples();
00406   virtual void      ComputeAtlasNumberOfTrainingSamples();
00407 
00408   virtual void      GetSegmentationBoundaryMin(int minPoint[3]);
00409   virtual void      SetSegmentationBoundaryMin(int minPoint[3]);
00410 
00411   virtual void      GetSegmentationBoundaryMax(int maxPoint[3]);
00412   virtual void      SetSegmentationBoundaryMax(int maxPoint[3]);
00413 
00414   // If flag is set then only checks the template for nodes that are essential for GUI
00415   // If flag = 0 then checks the existence of all nodes essential for processing 
00416   virtual   int     CheckTemplateMRMLStructure(vtkMRMLEMSTemplateNode *emsTemp, int guiFlag);
00417 
00418   // checks the entire tree if all nodes are defined so we can start segmentation
00419   virtual int     CheckMRMLNodeStructureForProcessing()
00420   {
00421     return this->CheckTemplateMRMLStructure(this->Node,0);
00422   }
00423 
00424   // adds important nodes to the tree that are needed for using the gui 
00425   virtual void      CompleteTemplateMRMLStructureForGUI(vtkMRMLEMSTemplateNode *emsTemp);
00426 
00427 
00428  
00429 
00430   //
00431   // this functions registers all of the MRML nodes needed by this
00432   // class with the MRML scene
00433   //
00434   virtual void      RegisterMRMLNodesWithScene();
00435 
00436   // Return if we have a global parameters node
00437   virtual int HasGlobalParametersNode();
00438 
00439   virtual void PrintTree();
00440   virtual void PrintTree(vtkIdType rootID, vtkIndent indent);
00441 
00442   virtual void PrintVolumeInfo( vtkMRMLScene* mrmlScene );
00443 
00444   //
00445   // convenience functions for managing MRML nodes
00446   //
00447   virtual vtkMRMLEMSVolumeCollectionNode*   GetTargetInputNode();
00448   virtual vtkMRMLEMSAtlasNode*              GetAtlasInputNode();
00449   virtual vtkMRMLEMSVolumeCollectionNode*   GetSubParcellationInputNode();
00450   virtual vtkMRMLEMSAtlasNode*              GetAtlasAlignedNode();
00451 
00452   virtual vtkMRMLScalarVolumeNode*          GetOutputVolumeNode();
00453 
00454   virtual vtkMRMLEMSGlobalParametersNode*   GetGlobalParametersNode();
00455   virtual vtkMRMLEMSTreeNode*               GetTreeRootNode();
00456   virtual vtkMRMLEMSTreeNode*               GetTreeNode(vtkIdType);
00457   virtual vtkMRMLEMSTreeParametersLeafNode* GetTreeParametersLeafNode(vtkIdType);  
00458 
00459   virtual vtkMRMLVolumeNode*                GetVolumeNode(vtkIdType);
00460   virtual vtkMRMLEMSWorkingDataNode*        GetWorkingDataNode();
00461 
00462   virtual vtkMRMLEMSVolumeCollectionNode*   CloneTargetNode(vtkMRMLEMSVolumeCollectionNode* target, const char* name)
00463   {
00464     return CloneVolumeCollectionNode(target, name);
00465   }
00466   virtual vtkMRMLEMSVolumeCollectionNode*   CloneSubParcellationNode(vtkMRMLEMSVolumeCollectionNode* target, const char* name)
00467   {
00468     return CloneVolumeCollectionNode(target, name);
00469   }
00470 
00471   virtual vtkMRMLEMSAtlasNode*  CloneAtlasNode(vtkMRMLEMSAtlasNode* target, const char* name);
00472 
00473   virtual void SynchronizeTargetNode(vtkMRMLEMSVolumeCollectionNode* templateNode, vtkMRMLEMSVolumeCollectionNode* changingNode, const char* name)
00474   {
00475        this->SynchronizeVolumeCollectionNode(templateNode, changingNode, name);
00476   }
00477 
00478   virtual void SynchronizeSubParcellationNode(vtkMRMLEMSVolumeCollectionNode* templateNode, vtkMRMLEMSVolumeCollectionNode* changingNode, const char* name)
00479   {
00480        this->SynchronizeVolumeCollectionNode(templateNode, changingNode, name);
00481   }
00482 
00483   virtual void SynchronizeAtlasNode(vtkMRMLEMSAtlasNode* templateNode, vtkMRMLEMSAtlasNode* changingNode, const char* name);
00484 
00485   virtual vtkIdType    MapMRMLNodeIDToVTKNodeID(const char* MRMLNodeID);
00486 
00487   //BTX
00488   virtual void           GetListOfTreeNodeIDs(vtkIdType rootNodeID, 
00489                                               vtkstd::vector<vtkIdType>& list);
00490   //ETX
00491 
00492   virtual const char* GetTclTaskFilename();
00493   virtual void SetTclTaskFilename(const char* fileName);
00494 
00495   //BTX
00496   vtksys_stl::string TurnDefaultMRMLFileIntoTaskName(const char* fileName);
00497   vtksys_stl::string TurnDefaultTclFileIntoPreprocessingName(const char* fileName);
00498   //ETX
00499 
00500   virtual int          IDMapContainsMRMLNodeID(const char* MRMLNodeID);
00501   virtual int          IDMapContainsVTKNodeID(vtkIdType id);
00502 
00503   void  SetTreeNodeDistributionLogCovarianceOffDiagonal(vtkIdType nodeID, double value);
00504 
00505   virtual void CopyEMRelatedNodesToMRMLScene(vtkMRMLScene* newScene);
00506 
00507   virtual  void RemoveLegacyNodes();
00508 //BTX
00509   void ImportMRMLFile(const char *mrmlFile,  vtksys_stl::string errMSG);  
00510 //ETX
00511 private:
00512   vtkEMSegmentMRMLManager();
00513   ~vtkEMSegmentMRMLManager();
00514   vtkEMSegmentMRMLManager(const vtkEMSegmentMRMLManager&);
00515   void operator=(const vtkEMSegmentMRMLManager&);
00516 
00517   // Should only be used within  this structure as it does not check 
00518   virtual void SetNode(vtkMRMLEMSTemplateNode*);
00519 
00520   virtual vtkIdType                       AddNewTreeNode();
00521   virtual vtkIdType                       GetNewVTKNodeID();
00522 
00523   virtual void           RemoveTreeNodeParametersNodes(vtkIdType nodeID);
00524 
00525   virtual void           PropogateAdditionOfSelectedTargetImage();
00526   virtual void           PropogateRemovalOfSelectedTargetImage(int index);
00527   virtual void           PropogateMovementOfSelectedTargetImage(int fromIndex,
00528                                                                 int toIndex);
00529 
00530   // Update intensity statistics for a particular tissue type.
00531   virtual void      UpdateIntensityDistributionFromSample(vtkIdType nodeID);
00532 
00533   //BTX
00534   vtksys_stl::string TurnDefaultFileIntoName(vtksys_stl::string taskName);
00535  //ETX
00536 
00537   //
00538   // convenience functions for managing ID mapping (mrml id <-> vtkIdType)
00539   //
00540   virtual const char*  MapVTKNodeIDToMRMLNodeID(vtkIdType vtkID);
00541 
00542   virtual void         IDMapInsertPair(vtkIdType vtkID, 
00543                                        const char* MRMLNodeID);
00544   virtual void         IDMapRemovePair(vtkIdType vtkID);
00545   virtual void         IDMapRemovePair(const char* MRMLNodeID);
00546 
00547   virtual void         UpdateMapsFromMRML();
00548 
00549   virtual int          GetTargetVolumeIndex(vtkIdType vtkID);
00550 
00551   // the current mrml scene
00552   vtkMRMLScene*   MRMLScene;
00553 
00554   //
00555   // parameters node that is currently under consideration
00556   //
00557   vtkMRMLEMSTemplateNode* Node;
00558   
00559   // global switch to hide EM segment parameters from MRML tree
00560   // editors
00561   bool   HideNodesFromEditors;
00562 
00563   //
00564   // The api of this class exposes vtkIdType ids for tree nodes and
00565   // volumes.  This essentially hides the mrml ids from client code and
00566   // insulates the client from changes in the slicer mrml id
00567   // mechanism.
00568   //
00569 
00570   vtkIdType NextVTKNodeID;
00571 
00572   //BTX
00573   typedef vtksys_stl::map<vtkIdType, vtksys_stl::string>  VTKToMRMLMapType;
00574   VTKToMRMLMapType                                VTKNodeIDToMRMLNodeIDMap;
00575   typedef vtksys_stl::map<vtksys_stl::string, vtkIdType>  MRMLToVTKMapType;
00576   MRMLToVTKMapType                                MRMLNodeIDToVTKNodeIDMap;
00577 
00578   vtkstd::vector<vtkstd::vector<double> > GetTreeNodeDistributionLogCovariance(vtkIdType nodeID);
00579   vtkstd::vector<vtkstd::vector<double> > GetTreeNodeDistributionLogCovarianceCorrection(vtkIdType nodeID);
00580 
00581    // Should Only be used in this function - bc only set through gui which calls DistributionMeanWithCorrection
00582   virtual double   GetTreeNodeDistributionLogMeanCorrection(vtkIdType nodeID, 
00583                                                   int volumeNumber);
00584   virtual void     SetTreeNodeDistributionLogMeanCorrection(vtkIdType nodeID, 
00585                                                   int volumeNumber, 
00586                                                   double value);
00587 
00588   // Functions should only call the corrected ones 
00589   virtual double   GetTreeNodeDistributionLogMean(vtkIdType nodeID, int volumeNumber);
00590 
00591   // Should Only be used in this function - bc only set through gui which calls DistributionLogCovarianceWithCorrection
00592   virtual double   GetTreeNodeDistributionLogCovarianceCorrection(vtkIdType nodeID, int rowIndex, int columnIndex);
00593 
00594   // virtual void     SetTreeNodeDistributionLogCovarianceCorrection(vtkIdType nodeID, vtkstd::vector<vtkstd::vector<double> > cov);
00595 
00596     virtual double   GetTreeNodeDistributionLogCovariance(vtkIdType nodeID, 
00597                                                         int rowIndex,
00598                                                         int columnIndex);
00599   int TreeNodeDistributionLogCovarianceCorrectionEnabled(vtkIdType nodeID);
00600 
00601   // Reset the correction of the node as well as subtree 
00602   void ResetLogCovarianceCorrectionsOfAllNodes(vtkIdType rootID);
00603 
00604   void TurnFromParentToLeafNode(vtkMRMLEMSTreeNode* treeNode) ;
00605 
00606 
00607   virtual vtkMRMLEMSVolumeCollectionNode*  CloneVolumeCollectionNode(vtkMRMLEMSVolumeCollectionNode* target, const char* name);
00608   virtual void SynchronizeVolumeCollectionNode(vtkMRMLEMSVolumeCollectionNode* templateNode, vtkMRMLEMSVolumeCollectionNode* changingNode, const char* name);
00609 
00610   //ETX
00611 
00612   virtual void         SetOutputVolumeID(vtkIdType volumeID);
00613 
00614 };
00615 
00616 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1