SimpleITK  2.1.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();
111  void SetApplication( const std::string & app, const std::string & command = "%a %f" );
112 
114  const std::string & GetApplication() const;
115 
155  void SetCommand( const std::string & command );
156 
157  /* \brief Get the command string used to launch the viewing application */
158  const std::string & GetCommand() const;
159 
167  void SetFileExtension( const std::string & ext );
168  const std::string & GetFileExtension() const;
177  static void SetGlobalDefaultDebug( const bool dbg );
178  static bool GetGlobalDefaultDebug();
179 
180  static void SetGlobalDefaultDebugOn();
181  static void SetGlobalDefaultDebugOff();
190  static void SetProcessDelay( const unsigned int delay);
191  static unsigned int GetProcessDelay();
197  void SetTitle( const std::string & t );
198  const std::string & GetTitle() const;
203  void Execute ( const Image &image );
204 
207  std::string ToString() const;
208 
209 
210 private:
211 
212  // hidden, no accessors
215 
216  // global only
217  static std::vector<std::string> m_GlobalDefaultSearchPath;
218  static std::vector<std::string> m_GlobalDefaultExecutableNames;
219  static unsigned int m_GlobalProcessDelay;
220 
221  static std::string m_GlobalDefaultViewCommand;
222  static std::string m_GlobalDefaultFileExtension;
223  static std::string m_GlobalDefaultApplication;
224 
225 
226  static bool m_GlobalDefaultDebug;
227 
228  std::string m_ViewCommand;
229  std::string m_CustomCommand;
230 
231  std::string m_Application;
232 
233  std::string m_FileExtension;
234 
235  std::string m_Title;
236 
237  static void initializeDefaults();
238 
239  static std::string FindViewingApplication();
240 };
241 
242 }
243 }
244 #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:214
itk::simple::ImageViewer::m_Application
std::string m_Application
Definition: sitkImageViewer.h:231
SITKIO_EXPORT
#define SITKIO_EXPORT
Definition: sitkIO.h:33
itk::simple::ImageViewer::m_GlobalDefaultApplication
static std::string m_GlobalDefaultApplication
Definition: sitkImageViewer.h:223
sitkImage.h
itk::simple::ImageViewer::m_GlobalViewerImageCount
static int m_GlobalViewerImageCount
Definition: sitkImageViewer.h:213
itk::simple::ImageViewer::m_ViewCommand
std::string m_ViewCommand
Definition: sitkImageViewer.h:228
itk::simple::ImageViewer::m_GlobalProcessDelay
static unsigned int m_GlobalProcessDelay
Definition: sitkImageViewer.h:219
sitkProcessObject.h
itk::simple::ImageViewer::m_GlobalDefaultDebug
static bool m_GlobalDefaultDebug
Definition: sitkImageViewer.h:226
itk::simple::ImageViewer::m_GlobalDefaultViewCommand
static std::string m_GlobalDefaultViewCommand
Definition: sitkImageViewer.h:221
itk::simple::ImageViewer::m_FileExtension
std::string m_FileExtension
Definition: sitkImageViewer.h:233
itk::simple::ImageViewer::m_GlobalDefaultExecutableNames
static std::vector< std::string > m_GlobalDefaultExecutableNames
Definition: sitkImageViewer.h:218
itk::simple::ImageViewer::m_Title
std::string m_Title
Definition: sitkImageViewer.h:235
itk
itk::simple::ImageViewer::m_GlobalDefaultSearchPath
static std::vector< std::string > m_GlobalDefaultSearchPath
Definition: sitkImageViewer.h:217
itk::simple::ImageViewer::m_GlobalDefaultFileExtension
static std::string m_GlobalDefaultFileExtension
Definition: sitkImageViewer.h:222
itk::simple::ImageViewer::m_CustomCommand
std::string m_CustomCommand
Definition: sitkImageViewer.h:229
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