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 "sitkPathType.h"
23 #include "sitkIO.h"
24 #include "sitkProcessObject.h"
25 
26 namespace itk::simple
27 {
28 
52 {
53 
54 public:
55  ImageViewer();
56 
58  virtual std::string
59  GetName() const
60  {
61  return std::string("ImageViewer");
62  }
63 
64 
68  static void
69  SetGlobalDefaultSearchPath(const std::vector<PathType> & path);
70  static const std::vector<PathType> &
71  GetGlobalDefaultSearchPath();
77  static void
78  SetGlobalDefaultExecutableNames(const std::vector<PathType> & names);
79  static const std::vector<PathType> &
80  GetGlobalDefaultExecutableNames();
89  static void
90  SetGlobalDefaultFileExtension(const std::string & ext);
91  static const std::string &
92  GetGlobalDefaultFileExtension();
98  static void
99  SetGlobalDefaultApplication(const PathType & app);
100  static const PathType &
101  GetGlobalDefaultApplication();
122  void
123  SetApplication(const PathType & app, const std::string & command = "%a %f");
124 
126  const PathType &
127  GetApplication() const;
128 
168  void
169  SetCommand(const std::string & command);
170 
171  /* \brief Get the command string used to launch the viewing application */
172  const std::string &
173  GetCommand() const;
174 
183  void
184  SetFileExtension(const std::string & ext);
185  const std::string &
186  GetFileExtension() const;
195  static void
196  SetGlobalDefaultDebug(const bool dbg);
197  static bool
198  GetGlobalDefaultDebug();
199 
200  static void
201  SetGlobalDefaultDebugOn();
202  static void
203  SetGlobalDefaultDebugOff();
212  static void
213  SetProcessDelay(const unsigned int delay);
214  static unsigned int
215  GetProcessDelay();
221  void
222  SetTitle(const std::string & t);
223  const std::string &
224  GetTitle() const;
229  void
230  Execute(const Image & image);
231 
234  std::string
235  ToString() const;
236 
237 
238 private:
239  std::string m_ViewCommand;
240  std::string m_CustomCommand;
241 
243 
244  std::string m_FileExtension;
245 
246  std::string m_Title;
247 };
248 
249 } // namespace itk::simple
250 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
SITKIO_EXPORT
#define SITKIO_EXPORT
Definition: sitkIO.h:33
sitkImage.h
sitkPathType.h
itk::simple::ImageViewer::m_ViewCommand
std::string m_ViewCommand
Definition: sitkImageViewer.h:239
sitkProcessObject.h
itk::simple::ImageViewer::m_Application
PathType m_Application
Definition: sitkImageViewer.h:242
itk::simple::ImageViewer::m_FileExtension
std::string m_FileExtension
Definition: sitkImageViewer.h:244
itk::simple::ImageViewer::m_Title
std::string m_Title
Definition: sitkImageViewer.h:246
itk::simple::ImageViewer::m_CustomCommand
std::string m_CustomCommand
Definition: sitkImageViewer.h:240
sitkIO.h
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::PathType
std::string PathType
Definition: sitkPathType.h:25
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:51