2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
33 //=====================================================================
35 //=====================================================================
36 ///Abstract class that handles views, attributes and previews (GUI) for Gimmick.
42 /// Virtual destructor
43 virtual ~GimmickView();
45 //====================================================================
47 //====================================================================
49 /// Returns the size of the current selection
50 virtual int GetSelectionSize() { return 0; }
51 /// Returns true if there is a valid selection
52 virtual bool IsSelectionValid(){ return false; }
53 /// Returns the vector of full filenames of selected images
54 virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
55 /// Returns the vector of images corresponding to selection
56 virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
57 /// Returns the vector of DicomNode corresponding to selection
58 virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
59 /// Returns the DicomNode corresponding to the tree item
60 virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
63 /// Type of list of DicomDatabase
64 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
65 /// Returns the list of DicomDatabase open
66 virtual DicomDatabaseListType& GetDicomDatabaseList()
68 /// Returns the list of DicomDatabase open (const)
69 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
73 ///Opens an existing database, or else, creates a local database.
74 virtual void OpenOrNewDatabase(bool open){ return; }
76 virtual void ShowHelp();
79 ///Gets the extension of the database
80 const std::string& GetDatabaseExtension() { return null; }
81 ///Sets the extension of the database
82 virtual void SetDatabaseExtension(const std::string& ext){ return; }
85 //====================================================================
86 // Preview Display Related
87 //====================================================================
90 ///Shows the image sent as a parameter
92 virtual void ShowImage(vtkImageData* image){ return; }
94 //====================================================================
96 //====================================================================
100 ///Loads or creates a favorites database
101 virtual void LoadOrCreateFavoritesDatabase(){ return; }
103 ///Creates the user settings directory
104 void CreateUserSettingsDirectory(){ return; }
105 ///Obtains the user settings directory
106 const std::string& GetUserSettingsDirectory(){ return null; }
108 //====================================================================
109 // Attribute Display Related
110 //====================================================================
113 ///Shows the Information regarding the node sent as a parameter
115 virtual void ShowInformation(DicomNode*){ return; }
117 //====================================================================
118 // Tree Display Related
119 //====================================================================
122 /// Completely rebuilds the view with
123 /// current DicomDatabaseList
124 virtual void RebuildView(){ return; }
125 /// Recursively updates the part of the view corresponding
126 /// to the DicomDatabase passed
127 /// i.e. creates items for the DicomNode which do not have
128 /// deletes obsolete items (whose DicomNode has been deleted)
129 virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
130 /// Recursively updates the part of the view corresponding
131 /// to the DicomNode provided.
132 /// parent is its parent in the tree (where to insert / remove it)
133 virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
136 ///Type definition of the data regarding the tree
137 typedef WxGimmickTreeItemData TreeItemData;
138 ///Gets the item data of the tree item passed as a parameter
139 TreeItemData* GetItemData(const TreeItemId& id){ return null; }
140 ///Type definition of the data insid a node of the tree
141 typedef WxGimmickDicomNodeData NodeData;
144 //====================================================================
146 //====================================================================
150 int mSelectionMaxImageDimension;
151 int mCurrentSelectionImageSize[4];
153 ///Existent Database List
154 DicomDatabaseListType mDicomDatabaseList;
155 ///Favorites database
156 DicomDatabase* mFavoriteDatabase;
158 ///Path to the database list file
159 std::string mDatabaseListFile;
160 ///Extension of the database
161 std::string mDatabaseExtension;
165 int mFirstDicomDatabaseIconIndex;
168 vtkImageViewer2* mViewer;
170 int mx1,mx2,my1,my2,mz1,mz2;
171 double mspx,mspy,mspz;
174 // Multi-thread image reader
175 MultiThreadImageReader mReader;
176 // map of images name to node
177 std::map<std::string,DicomNode*> mImageFileNameToNode;
179 //Controller which manages the interaction with the model
183 // EO class GimmickView
184 //=====================================================================
186 } // EO namespace creaImageIO