SimpleITK  2.0.0
sitkImageViewer.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright NumFOCUS
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 
53 {
54 
55 public:
56  ImageViewer();
57 
59  virtual std::string GetName() const { return std::string("ImageViewer"); }
60 
61 
65  static void SetGlobalDefaultSearchPath( const std::vector<std::string> & path );
66  static const std::vector<std::string> & GetGlobalDefaultSearchPath();
72  static void SetGlobalDefaultExecutableNames( const std::vector<std::string> & names );
73  static const std::vector<std::string> & GetGlobalDefaultExecutableNames();
82  static void SetGlobalDefaultFileExtension( const std::string & ext );
83  static const std::string & GetGlobalDefaultFileExtension();
89  static void SetGlobalDefaultApplication( const std::string & app );
90  static const std::string & GetGlobalDefaultApplication();
103  void SetApplication( const std::string & app, const std::string & command = "%a %f" );
104 
106  const std::string & GetApplication() const;
107 
147  void SetCommand( const std::string & command );
148 
149  /* \brief Get the command string used to launch the viewing application */
150  const std::string & GetCommand() const;
151 
159  void SetFileExtension( const std::string & ext );
160  const std::string & GetFileExtension() const;
169  static void SetGlobalDefaultDebug( const bool dbg );
170  static bool GetGlobalDefaultDebug();
171 
172  static void SetGlobalDefaultDebugOn();
173  static void SetGlobalDefaultDebugOff();
182  static void SetProcessDelay( const unsigned int delay);
183  static unsigned int GetProcessDelay();
189  void SetTitle( const std::string & t );
190  const std::string & GetTitle() const;
195  void Execute ( const Image &image );
196 
199  std::string ToString() const;
200 
201 
202 private:
203 
204  // hidden, no accessors
207 
208  // global only
209  static std::vector<std::string> m_GlobalDefaultSearchPath;
210  static std::vector<std::string> m_GlobalDefaultExecutableNames;
211  static unsigned int m_GlobalProcessDelay;
212 
213  static std::string m_GlobalDefaultViewCommand;
214  static std::string m_GlobalDefaultFileExtension;
215  static std::string m_GlobalDefaultApplication;
216 
217 
218  static bool m_GlobalDefaultDebug;
219 
220  std::string m_ViewCommand;
221  std::string m_CustomCommand;
222 
223  std::string m_Application;
224 
225  std::string m_FileExtension;
226 
227  std::string m_Title;
228 
229  static void initializeDefaults();
230 
231  static std::string FindViewingApplication();
232 };
233 
234 }
235 }
236 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:75
itk::simple::ImageViewer::m_GlobalAreDefaultsInitialized
static bool m_GlobalAreDefaultsInitialized
Definition: sitkImageViewer.h:206
itk::simple::ImageViewer::m_Application
std::string m_Application
Definition: sitkImageViewer.h:223
SITKIO_EXPORT
#define SITKIO_EXPORT
Definition: sitkIO.h:33
itk::simple::ImageViewer::m_GlobalDefaultApplication
static std::string m_GlobalDefaultApplication
Definition: sitkImageViewer.h:215
sitkImage.h
itk::simple::ImageViewer::m_GlobalViewerImageCount
static int m_GlobalViewerImageCount
Definition: sitkImageViewer.h:205
itk::simple::ImageViewer::m_ViewCommand
std::string m_ViewCommand
Definition: sitkImageViewer.h:220
itk::simple::ImageViewer::m_GlobalProcessDelay
static unsigned int m_GlobalProcessDelay
Definition: sitkImageViewer.h:211
sitkProcessObject.h
itk::simple::ImageViewer::m_GlobalDefaultDebug
static bool m_GlobalDefaultDebug
Definition: sitkImageViewer.h:218
itk::simple::ImageViewer::m_GlobalDefaultViewCommand
static std::string m_GlobalDefaultViewCommand
Definition: sitkImageViewer.h:213
itk::simple::ImageViewer::m_FileExtension
std::string m_FileExtension
Definition: sitkImageViewer.h:225
itk::simple::ImageViewer::m_GlobalDefaultExecutableNames
static std::vector< std::string > m_GlobalDefaultExecutableNames
Definition: sitkImageViewer.h:210
itk::simple::ImageViewer::m_Title
std::string m_Title
Definition: sitkImageViewer.h:227
itk
itk::simple::ImageViewer::m_GlobalDefaultSearchPath
static std::vector< std::string > m_GlobalDefaultSearchPath
Definition: sitkImageViewer.h:209
itk::simple::ImageViewer::m_GlobalDefaultFileExtension
static std::string m_GlobalDefaultFileExtension
Definition: sitkImageViewer.h:214
itk::simple::ImageViewer::m_CustomCommand
std::string m_CustomCommand
Definition: sitkImageViewer.h:221
sitkIO.h
itk::simple::ImageViewer::GetName
virtual std::string GetName() const
Definition: sitkImageViewer.h:59
itk::simple::ImageViewer
Display an image in an external viewer (Fiji by default)
Definition: sitkImageViewer.h:52