7 //=====================================================================
9 //=====================================================================
10 /// Abstract class to handle tree item information
14 virtual ~TreeListCtrl() {}
16 // EO class TreeListCtrl
21 //=====================================================================
23 //=====================================================================
24 /// Abstract class to handle tree item ids
28 virtual ~TreeItemId() {}
30 // EO class TreeItemId
35 //=====================================================================
37 //=====================================================================
38 ///Abstract class that handles views, attributes and previews (GUI) for Gimmick.
44 /// Virtual destructor
45 virtual ~GimmickView();
47 //====================================================================
49 //====================================================================
51 /// Returns the size of the current selection
52 virtual int GetSelectionSize() { return 0; }
53 /// Returns true if there is a valid selection
54 virtual bool IsSelectionValid(){ return false; }
55 /// Returns the vector of full filenames of selected images
56 virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
57 /// Returns the vector of images corresponding to selection
58 virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
59 /// Returns the vector of DicomNode corresponding to selection
60 virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
61 /// Returns the vector of TreeItemId corresponding to selection
62 virtual void GetSelectedItems(std::vector<TreeItemId>&){ return; }
63 /// Returns the DicomNode corresponding to the tree item
64 virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
67 /// Type of list of DicomDatabase
68 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
69 /// Returns the list of DicomDatabase open
70 virtual DicomDatabaseListType& GetDicomDatabaseList()
72 /// Returns the list of DicomDatabase open (const)
73 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
76 /// Returns the TreeListCtrl of the main view
77 TreeListCtrl* GetTreeListCtrl() { return null; }
78 /// Returns the TreeListCtrl of the main view (const)
79 const TreeListCtrl* GetTreeListCtrl() const { return null; }
82 ///Inserts a TreeItem in a specified database
83 virtual void InsertDicomDatabase(TreeItemId& id, DicomDatabase* r);
84 ///Deletes a TreeItem from a specified database
85 virtual void DeleteDicomDatabase(TreeItemId& id, DicomDatabase* r);
86 ///Loads the children of the specified TreeItem
87 virtual void LoadChildren( TreeItemId& id );
88 ///Opens an existing database, or else, creates a local database.
89 virtual void OpenOrNewDatabase(bool open){ return; }
91 virtual void ShowHelp();
94 ///Gets the extension of the database
95 const std::string& GetDatabaseExtension() { return null; }
96 ///Sets the extension of the database
97 virtual void SetDatabaseExtension(const std::string& ext){ return; }
100 //====================================================================
101 // Preview Display Related
102 //====================================================================
105 ///Shows the image sent as a parameter
107 virtual void ShowImage(vtkImageData* image){ return; }
109 //====================================================================
111 //====================================================================
115 /// Sets a new configuration file
116 virtual void SetConfigurationFile(const std::string& filename){ return; }
117 ///Loads a configuration file with the parameters for the favorites database
118 virtual void LoadConfiguration(){ return; }
119 ///Saves a configuration file with the parameters for the favorites database
120 virtual void SaveConfiguration(){ return; }
121 ///Sets the status for the save configuration on close to the new value
122 ///specified by the parameter
123 virtual void SetSaveConfigurationOnClose(bool v) { return; }
124 ///Loads or creates a favorites database
125 virtual void LoadOrCreateFavoritesDatabase(){ return; }
127 ///Creates the user settings directory
128 void CreateUserSettingsDirectory(){ return; }
129 ///Obtains the user settings directory
130 const std::string& GetUserSettingsDirectory(){ return null; }
132 //====================================================================
133 // Attribute Display Related
134 //====================================================================
137 ///Shows the Information regarding the node sent as a parameter
139 virtual void ShowInformation(DicomNode*){ return; }
141 //====================================================================
142 // Tree Display Related
143 //====================================================================
146 /// Completely rebuilds the view with
147 /// current DicomDatabaseList
148 virtual void RebuildView(){ return; }
149 /// Recursively updates the part of the view corresponding
150 /// to the DicomDatabase passed
151 /// i.e. creates items for the DicomNode which do not have
152 /// deletes obsolete items (whose DicomNode has been deleted)
153 virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
154 /// Recursively updates the part of the view corresponding
155 /// to the DicomNode provided.
156 /// parent is its parent in the tree (where to insert / remove it)
157 virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
158 /// Recursively deletes
159 virtual void DeleteObsoleteChildren(TreeItemId& id){ return; }
160 /// Create the column titles of the children of the item
161 virtual TreeItemId CreateChildrenColumnsTitles(TreeItemId& item,
162 DicomNode::Type t){ return null }
163 /// Updates the titles of the columns
164 virtual void UpdateColumnsTitles(TreeItemId& item, DicomNode::Type t){ return; }
165 /// Updates the information on the columns
166 virtual void UpdateColumns(TreeItemId& item, bool only_first = false){ return; }
169 ///Type definition of the data regarding the tree
170 typedef WxGimmickTreeItemData TreeItemData;
171 ///Gets the item data of the tree item passed as a parameter
172 TreeItemData* GetItemData(const TreeItemId& id){ return null; }
173 ///Type definition of the data insid a node of the tree
174 typedef WxGimmickDicomNodeData NodeData;
177 //====================================================================
179 //====================================================================
183 int mSelectionMaxImageDimension;
184 int mCurrentSelectionImageSize[4];
186 ///Existent Database List
187 DicomDatabaseListType mDicomDatabaseList;
188 ///Favorites database
189 DicomDatabase* mFavoriteDatabase;
190 ///The tree list controller
191 TreeListCtrl* mTreeListCtrl;
192 ///Path to the user settings directory
193 std::string mUserSettingsDirectory;
194 ///Path to the configuration file
195 std::string mConfigurationFile;
196 ///Path to the database list file
197 std::string mDatabaseListFile;
198 ///Boolean to check wether to save on close or not
199 bool mSaveConfigurationOnClose;
200 ///Extension of the database
201 std::string mDatabaseExtension;
205 int mFirstDicomDatabaseIconIndex;
206 // Id of the item which activated the popup menu
207 TreeItemId mItemOfMenu;
210 vtkImageViewer2* mViewer;
212 int mx1,mx2,my1,my2,mz1,mz2;
213 double mspx,mspy,mspz;
216 // Multi-thread image reader
217 MultiThreadImageReader mReader;
218 // map of images name to node
219 std::map<std::string,DicomNode*> mImageFileNameToNode;
220 // Cur image item to show
221 TreeItemId mCurImageItemToShow;
224 // EO class GimmickView
225 //=====================================================================
227 } // EO namespace creaImageIO