SimpleITK  
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::simple
26 {
27 
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();
109  void SetApplication( const std::string & app, const std::string & command = "%a %f" );
110 
112  const std::string & GetApplication() const;
113 
153  void SetCommand( const std::string & command );
154 
155  /* \brief Get the command string used to launch the viewing application */
156  const std::string & GetCommand() const;
157 
165  void SetFileExtension( const std::string & ext );
166  const std::string & GetFileExtension() const;
175  static void SetGlobalDefaultDebug( const bool dbg );
176  static bool GetGlobalDefaultDebug();
177 
178  static void SetGlobalDefaultDebugOn();
179  static void SetGlobalDefaultDebugOff();
188  static void SetProcessDelay( const unsigned int delay);
189  static unsigned int GetProcessDelay();
195  void SetTitle( const std::string & t );
196  const std::string & GetTitle() const;
201  void Execute ( const Image &image );
202 
205  std::string ToString() const;
206 
207 
208 private:
209 
210  // hidden, no accessors
213 
214  // global only
215  static std::vector<std::string> m_GlobalDefaultSearchPath;
216  static std::vector<std::string> m_GlobalDefaultExecutableNames;
217  static unsigned int m_GlobalProcessDelay;
218 
219  static std::string m_GlobalDefaultViewCommand;
220  static std::string m_GlobalDefaultFileExtension;
221  static std::string m_GlobalDefaultApplication;
222 
223 
224  static bool m_GlobalDefaultDebug;
225 
226  std::string m_ViewCommand;
227  std::string m_CustomCommand;
228 
229  std::string m_Application;
230 
231  std::string m_FileExtension;
232 
233  std::string m_Title;
234 
235  static void initializeDefaults();
236 
237  static std::string FindViewingApplication();
238 };
239 
240 }
241 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::ImageViewer::m_GlobalAreDefaultsInitialized
static bool m_GlobalAreDefaultsInitialized
Definition: sitkImageViewer.h:212
itk::simple::ImageViewer::m_Application
std::string m_Application
Definition: sitkImageViewer.h:229
SITKIO_EXPORT
#define SITKIO_EXPORT
Definition: sitkIO.h:33
itk::simple::ImageViewer::m_GlobalDefaultApplication
static std::string m_GlobalDefaultApplication
Definition: sitkImageViewer.h:221
sitkImage.h
itk::simple::ImageViewer::m_GlobalViewerImageCount
static int m_GlobalViewerImageCount
Definition: sitkImageViewer.h:211
itk::simple::ImageViewer::m_ViewCommand
std::string m_ViewCommand
Definition: sitkImageViewer.h:226
itk::simple::ImageViewer::m_GlobalProcessDelay
static unsigned int m_GlobalProcessDelay
Definition: sitkImageViewer.h:217
sitkProcessObject.h
itk::simple::ImageViewer::m_GlobalDefaultDebug
static bool m_GlobalDefaultDebug
Definition: sitkImageViewer.h:224
itk::simple::ImageViewer::m_GlobalDefaultViewCommand
static std::string m_GlobalDefaultViewCommand
Definition: sitkImageViewer.h:219
itk::simple::ImageViewer::m_FileExtension
std::string m_FileExtension
Definition: sitkImageViewer.h:231
itk::simple::ImageViewer::m_GlobalDefaultExecutableNames
static std::vector< std::string > m_GlobalDefaultExecutableNames
Definition: sitkImageViewer.h:216
itk::simple::ImageViewer::m_Title
std::string m_Title
Definition: sitkImageViewer.h:233
itk::simple::ImageViewer::m_GlobalDefaultSearchPath
static std::vector< std::string > m_GlobalDefaultSearchPath
Definition: sitkImageViewer.h:215
itk::simple::ImageViewer::m_GlobalDefaultFileExtension
static std::string m_GlobalDefaultFileExtension
Definition: sitkImageViewer.h:220
itk::simple::ImageViewer::m_CustomCommand
std::string m_CustomCommand
Definition: sitkImageViewer.h:227
sitkIO.h
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::ImageViewer::GetName
virtual std::string GetName() const
Definition: sitkImageViewer.h:57
itk::simple::ImageViewer
Display an image in an external viewer (Fiji by default)
Definition: sitkImageViewer.h:50