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
26namespace itk::simple
27{
28
52{
53
54public:
56 virtual ~ImageViewer() = default;
57
59 virtual std::string
60 GetName() const
61 {
62 return std::string("ImageViewer");
63 }
64
65
69 static void
70 SetGlobalDefaultSearchPath(const std::vector<PathType> & path);
71 static const std::vector<PathType> &
74
78 static void
79 SetGlobalDefaultExecutableNames(const std::vector<PathType> & names);
80 static const std::vector<PathType> &
83
90 static void
91 SetGlobalDefaultFileExtension(const std::string & ext);
92 static const std::string &
95
99 static void
101 static const PathType &
104
127 void
128 SetApplication(const PathType & app, const std::string & command = "%a %f");
129
131 const PathType &
133
173 void
174 SetCommand(const std::string & command);
175
176 /* \brief Get the command string used to launch the viewing application */
177 const std::string &
178 GetCommand() const;
179
188 void
189 SetFileExtension(const std::string & ext);
190 const std::string &
191 GetFileExtension() const;
193
200 static void
201 SetGlobalDefaultDebug(const bool dbg);
202 static bool
204
205 static void
207 static void
210
217 static void
218 SetProcessDelay(const unsigned int delay);
219 static unsigned int
222
226 void
227 SetTitle(const std::string & t);
228 const std::string &
229 GetTitle() const;
231
234 void
235 Execute(const Image & image);
236
239 std::string
240 ToString() const;
241
242
243private:
244 std::string m_ViewCommand;
245 std::string m_CustomCommand;
249 std::string m_FileExtension;
251 std::string m_Title;
252};
253
254} // namespace itk::simple
255#endif
static void SetGlobalDefaultDebugOff()
Set/Get Debug flag.
static void SetGlobalDefaultDebug(const bool dbg)
Set/Get Debug flag.
static void SetGlobalDefaultSearchPath(const std::vector< PathType > &path)
Set/Get the search path used to find the viewing application.
static const std::string & GetGlobalDefaultFileExtension()
Set/Get the default file extension.
static void SetGlobalDefaultDebugOn()
Set/Get Debug flag.
void SetFileExtension(const std::string &ext)
Set/Get file extension of the temporary image file (default='.nii')
static const std::vector< PathType > & GetGlobalDefaultExecutableNames()
Set/Get name list used to find the viewing application.
const std::string & GetCommand() const
const PathType & GetApplication() const
Get the full path to the viewing application used in the command string.
static void SetGlobalDefaultApplication(const PathType &app)
Set/Get the default application used in the command string.
virtual std::string GetName() const
void SetTitle(const std::string &t)
Set/Get Title string on the ImageJ window.
static void SetProcessDelay(const unsigned int delay)
Set/Get Process delay, the wait time after launching the viewing application.
static void SetGlobalDefaultExecutableNames(const std::vector< PathType > &names)
Set/Get name list used to find the viewing application.
const std::string & GetFileExtension() const
Set/Get file extension of the temporary image file (default='.nii')
static bool GetGlobalDefaultDebug()
Set/Get Debug flag.
void Execute(const Image &image)
Launch the viewing application to display the given image.
virtual ~ImageViewer()=default
static const PathType & GetGlobalDefaultApplication()
Set/Get the default application used in the command string.
const std::string & GetTitle() const
Set/Get Title string on the ImageJ window.
static unsigned int GetProcessDelay()
Set/Get Process delay, the wait time after launching the viewing application.
void SetApplication(const PathType &app, const std::string &command="%a %f")
Set the full path to the viewing application used in the command string.
void SetCommand(const std::string &command)
Set the command string used to launch the viewing application.
static const std::vector< PathType > & GetGlobalDefaultSearchPath()
Set/Get the search path used to find the viewing application.
std::string ToString() const
Print ourself out to a string.
static void SetGlobalDefaultFileExtension(const std::string &ext)
Set/Get the default file extension.
The Image class for SimpleITK.
Definition sitkImage.h:77
std::string PathType
#define SITKIO_EXPORT
Definition sitkIO.h:33