6 //=====================================================================
8 //=====================================================================
9 ///Abstract class that handles views, attributes and previews (GUI) for Gimmick.
15 /// Virtual destructor
16 virtual ~GimmickView();
18 //====================================================================
20 //====================================================================
22 /// Returns the size of the current selection
23 virtual int GetSelectionSize() { return 0; }
24 /// Returns true if there is a valid selection
25 virtual bool IsSelectionValid(){ return false; }
26 /// Returns the vector of full filenames of selected images
27 virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
28 /// Returns the vector of images corresponding to selection
29 virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
30 /// Returns the vector of DicomNode corresponding to selection
31 virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
32 /// Returns the DicomNode corresponding to the tree item
33 virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
36 /// Type of list of DicomDatabase
37 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
38 /// Returns the list of DicomDatabase open
39 virtual DicomDatabaseListType& GetDicomDatabaseList()
41 /// Returns the list of DicomDatabase open (const)
42 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
46 ///Opens an existing database, or else, creates a local database.
47 virtual void OpenOrNewDatabase(bool open){ return; }
49 virtual void ShowHelp();
52 ///Gets the extension of the database
53 const std::string& GetDatabaseExtension() { return null; }
54 ///Sets the extension of the database
55 virtual void SetDatabaseExtension(const std::string& ext){ return; }
58 //====================================================================
59 // Preview Display Related
60 //====================================================================
63 ///Shows the image sent as a parameter
65 virtual void ShowImage(vtkImageData* image){ return; }
67 //====================================================================
69 //====================================================================
73 ///Loads or creates a favorites database
74 virtual void LoadOrCreateFavoritesDatabase(){ return; }
76 ///Creates the user settings directory
77 void CreateUserSettingsDirectory(){ return; }
78 ///Obtains the user settings directory
79 const std::string& GetUserSettingsDirectory(){ return null; }
81 //====================================================================
82 // Attribute Display Related
83 //====================================================================
86 ///Shows the Information regarding the node sent as a parameter
88 virtual void ShowInformation(DicomNode*){ return; }
90 //====================================================================
91 // Tree Display Related
92 //====================================================================
95 /// Completely rebuilds the view with
96 /// current DicomDatabaseList
97 virtual void RebuildView(){ return; }
98 /// Recursively updates the part of the view corresponding
99 /// to the DicomDatabase passed
100 /// i.e. creates items for the DicomNode which do not have
101 /// deletes obsolete items (whose DicomNode has been deleted)
102 virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
103 /// Recursively updates the part of the view corresponding
104 /// to the DicomNode provided.
105 /// parent is its parent in the tree (where to insert / remove it)
106 virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
109 ///Type definition of the data regarding the tree
110 typedef WxGimmickTreeItemData TreeItemData;
111 ///Gets the item data of the tree item passed as a parameter
112 TreeItemData* GetItemData(const TreeItemId& id){ return null; }
113 ///Type definition of the data insid a node of the tree
114 typedef WxGimmickDicomNodeData NodeData;
117 //====================================================================
119 //====================================================================
123 int mSelectionMaxImageDimension;
124 int mCurrentSelectionImageSize[4];
126 ///Existent Database List
127 DicomDatabaseListType mDicomDatabaseList;
128 ///Favorites database
129 DicomDatabase* mFavoriteDatabase;
131 ///Path to the database list file
132 std::string mDatabaseListFile;
133 ///Extension of the database
134 std::string mDatabaseExtension;
138 int mFirstDicomDatabaseIconIndex;
141 vtkImageViewer2* mViewer;
143 int mx1,mx2,my1,my2,mz1,mz2;
144 double mspx,mspy,mspz;
147 // Multi-thread image reader
148 MultiThreadImageReader mReader;
149 // map of images name to node
150 std::map<std::string,DicomNode*> mImageFileNameToNode;
152 //Controller which manages the interaction with the model
156 // EO class GimmickView
157 //=====================================================================
159 } // EO namespace creaImageIO