SimpleITK  1.3.0.dev466
sitkImageViewer.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef sitkImageViewer_h
19 #define sitkImageViewer_h
20 
21 #include "sitkImage.h"
22 #include "sitkIO.h"
23 #include "sitkProcessObject.h"
24 
25 namespace itk
26 {
27 namespace simple
28 {
29 
51 {
52 
53 public:
54  ImageViewer();
55 
57  virtual std::string GetName() const { return std::string("ImageViewer"); }
58 
59 
63  static void SetGlobalDefaultSearchPath( const std::vector<std::string> & path );
64  static const std::vector<std::string> & GetGlobalDefaultSearchPath();
70  static void SetGlobalDefaultExecutableNames( const std::vector<std::string> & names );
71  static const std::vector<std::string> & GetGlobalDefaultExecutableNames();
80  static void SetGlobalDefaultFileExtension( const std::string & ext );
81  static const std::string & GetGlobalDefaultFileExtension();
87  static void SetGlobalDefaultApplication( const std::string & app );
88  static const std::string & GetGlobalDefaultApplication();
101  void SetApplication( const std::string & app, const std::string & command = "%a %f" );
102 
104  const std::string & GetApplication() const;
105 
145  void SetCommand( const std::string & command );
146 
147  /* \brief Get the command string used to launch the viewing application */
148  const std::string & GetCommand() const;
149 
157  void SetFileExtension( const std::string & ext );
158  const std::string & GetFileExtension() const;
167  static void SetGlobalDefaultDebug( const bool dbg );
168  static bool GetGlobalDefaultDebug();
169 
170  static void SetGlobalDefaultDebugOn();
171  static void SetGlobalDefaultDebugOff();
180  static void SetProcessDelay( const unsigned int delay);
181  static unsigned int GetProcessDelay();
187  void SetTitle( const std::string & t );
188  const std::string & GetTitle() const;
193  void Execute ( const Image &image );
194 
197  std::string ToString() const;
198 
199 
200 private:
201 
202  // hidden, no accessors
205 
206  // global only
207  static std::vector<std::string> m_GlobalDefaultSearchPath;
208  static std::vector<std::string> m_GlobalDefaultExecutableNames;
209  static unsigned int m_GlobalProcessDelay;
210 
211  static std::string m_GlobalDefaultViewCommand;
212  static std::string m_GlobalDefaultFileExtension;
213  static std::string m_GlobalDefaultApplication;
214 
215 
216  static bool m_GlobalDefaultDebug;
217 
218  std::string m_ViewCommand;
219  std::string m_CustomCommand;
220 
221  std::string m_Application;
222 
223  std::string m_FileExtension;
224 
225  std::string m_Title;
226 
227  static void initializeDefaults();
228 
229  static std::string FindViewingApplication();
230 };
231 
232 }
233 }
234 #endif
static std::string m_GlobalDefaultViewCommand
Display an image in an external viewer (Fiji by default)
static std::vector< std::string > m_GlobalDefaultExecutableNames
static bool m_GlobalAreDefaultsInitialized
static std::vector< std::string > m_GlobalDefaultSearchPath
static std::string m_GlobalDefaultFileExtension
#define SITKIO_EXPORT
Definition: sitkIO.h:33
static unsigned int m_GlobalProcessDelay
static std::string m_GlobalDefaultApplication
The Image class for SimpleITK.
Definition: sitkImage.h:78
virtual std::string GetName() const