00001 #ifndef _SIGNMRMLMANAGER_H
00002 #define _SIGNMRMLMANAGER_H
00003
00004 #include <SignDLL.h>
00005
00006 #include <string>
00007 #include <map>
00008 #include <vector>
00009
00010 #include <vtkObject.h>
00011
00012 class SignMRMLScene;
00013 class vtkMRMLNode;
00014 class SignContext;
00015 class SignFiducialCollection;
00016 class vtkCollection;
00017
00018 typedef std::vector<vtkMRMLNode*> MRMLNodeVector;
00019 typedef std::map<vtkMRMLNode*,SignFiducialCollection*> FiducialMap;
00020
00021 class SIGN_EXPORT SignMRMLManager : public vtkObject
00022 {
00023 friend class SignStateManager;
00024
00025 vtkTypeRevisionMacro(SignMRMLManager,vtkObject);
00026 static SignMRMLManager* New();
00027
00028 void LoadMRMLFile(std::string filename);
00029 void SaveMRMLFile();
00030
00031 vtkMRMLNode* FindNodeByName(std::string name);
00032 vtkMRMLNode* FindNodeByID(std::string id);
00033 vtkMRMLNode* FindNodeByClassAndName(std::string clss,std::string name);
00034
00035 SignFiducialCollection* GetFiducialsForNode(vtkMRMLNode* node);
00036 vtkMRMLNode* GetNodeForFiducials(SignFiducialCollection* fiducials);
00037 SignFiducialCollection* FindFiducialsByNodeName(std::string name);
00038 SignFiducialCollection* FindFiducialsByNodeID(std::string id);
00039 void GetNodesByClass(std::string clss,MRMLNodeVector& vec);
00040
00041 void SetContext(SignContext* context_);
00042
00043 SignMRMLScene* GetScene();
00044
00045 vtkMRMLNode* AddVolumeNode(std::string name,std::string filename,int window, int level, bool notify=true);
00046 vtkMRMLNode* AddVolumeNode(std::string name,std::string filename,int window, int level, void(*function)(vtkObject *caller,unsigned long eid,void *clientdata, void*calldata),void* clientdata, bool notify=true);
00047 vtkMRMLNode* AddSliceNode(std::string name,std::string orientation,std::string layoutName);
00048 vtkMRMLNode* AddCameraNode(std::string name);
00049 void AddMRMLFiducial(std::string volID,int fidID, double x, double y, double z, std::string labelText);
00050 void RemoveMRMLFiducial(std::string volID,int fidID);
00051 void AddMRMLColorTransferFunctionPointNode(double x,double r,double g,double b,double midpoint,double sharpness);
00052 void AddMRMLScalarOpacityTransferFunctionPointNode(double x,double y,double midpoint,double sharpness);
00053 void AddMRMLGradientOpacityTransferFunctionPointNode(double x,double y,double midpoint,double sharpness);
00054
00055 void AddNode(vtkMRMLNode* node);
00056 void RemoveNode(vtkMRMLNode* node);
00057 void RemoveAllTransferFunctionNodes();
00058 void Add2DViewerForID(std::string ID, std::string viewer);
00059 void Add3DViewerForID(std::string ID, std::string viewer);
00060 vtkCollection* GetSliceCompositeNodesByVolumeID(std::string volID);
00061 vtkCollection* GetVolumeViewerNodesByVolumeID(std::string volID);
00062 vtkCollection* GetModelViewerNodesByModelID(std::string volID);
00063 protected:
00064 SignMRMLManager();
00065 ~SignMRMLManager();
00066
00067 private:
00068 SignMRMLScene* scene;
00069 SignContext* context;
00070 FiducialMap fiducials;
00071
00072
00073 static void MRMLModifiedCallback(vtkObject* caller,unsigned long event,void* data,void* calldata);
00074 };
00075
00076 #endif