SMILX  1.01
milxQtAliases.h
Go to the documentation of this file.
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
27 #ifndef MILXQTALIASES_H_INCLUDED
28 #define MILXQTALIASES_H_INCLUDED
29 
43 #include <limits>
44 #include <stdexcept>
45 #include <sstream>
46 #include <iostream>
47 #include <vnl/vnl_vector_fixed.h>
48 #include "milxGlobal.h"
49 
50 using namespace std;
51 using milx::coordinate; //allow to enable cleaner looking code
52 using milx::coordinateType; //allow to enable cleaner looking code
53 
54 #ifdef WIN32
55 #define WIN32_LEAN_AND_MEAN
56 #include <windows.h>
57 #else
58 #include <unistd.h>
59 #endif
60 
62 #if defined(WIN32)
63 #ifdef MILXQT_DLL
64 /*
65 Used for DLL generation purposes (Windows Specific) Import/Export.
66 Templates classes cannot be imported hence its own variable.
67 The export command is
68 */
69 #if defined(MILXQT_MAKEDLL) // create a MILXQT DLL library
70 #define MILXQT_EXPORT __declspec(dllexport)
71 #define MILXQT_TEMPLATEDLL __declspec(dllexport)
72 #else // use a MILXQT DLL library
73 #define MILXQT_EXPORT __declspec(dllimport)
74 #define MILXQT_TEMPLATEDLL
75 #endif
76 #endif // MILXQT_DLL
77 #endif // WIN32
78 
79 #ifndef MILXQT_EXPORT
80 #define MILXQT_EXPORT
81 #define MILXQT_TEMPLATEDLL
82 #endif
83 
85 #if defined(WIN32)
86 #ifdef MILXQT_PLUGIN_DLL
87 /*
88 Used for DLL generation purposes (Windows Specific) Import/Export.
89 Templates classes cannot be imported hence its own variable.
90 The export command is
91 */
92 #if defined(MILXQT_PLUGIN_MAKEDLL) // create a MILXQT DLL library
93 #define MILXQT_PLUGIN_EXPORT __declspec(dllexport)
94 #define MILXQT_PLUGIN_TEMPLATEDLL __declspec(dllexport)
95 #else // use a MILXQT DLL library
96 #define MILXQT_PLUGIN_EXPORT __declspec(dllimport)
97 #define MILXQT_PLUGIN_TEMPLATEDLL
98 #endif
99 #endif // MILXQT_PLUGIN_DLL
100 #endif // WIN32
101 
102 #ifndef MILXQT_PLUGIN_EXPORT
103 #define MILXQT_PLUGIN_EXPORT
104 #define MILXQT_PLUGIN_TEMPLATEDLL
105 #endif
106 
107 static const float milxQtVersion = static_cast<float>(1.01);
108 static const int minWindowSize = 256;
109 static const int maxAASamples = 2; //Anti-Aliasing
110 
111 #ifndef DEF_EXTS
112 #define DEF_EXTS
113 
116 //Opens
117 static string openImageExts = "Images (*.png *.jpeg *.jpg *.bmp *.tiff *.tif *.pbm *.pgm *.ppm)";
118 static string openSeriesImageExts = "Image Series (*.ima *.dcm *.dicom *.gz)";
119 static string openMedImageExts = "Medical Images (*.nii *.gz *.ima *.dcm *.dicom *.mha *.mhd *.img *.hdr *.gipl *.spr)";
120 static string openOtherImageExts = "Other Images (*.vti)";
121 static string openOtherExts = "Text Delimited Files (*.csv *.dat *.txt)";
122 static string openModelExts = "Model or Polygonal Files (*.vtp *.vtk *.ply *.obj *.stl)";
123 static string extensionsOpen = "*.png *.jpeg *.jpg *.bmp *.tiff *.tif *.pbm *.pgm *.ppm *.nii *.gz *.ima *.dcm *.dicom *.mha *.mhd *.img *.hdr *.gipl *.spr *.vti *.vtp *.vtk *.ply *.obj *.stl *.csv *.dat *.txt";
124 static string allFileExts = "All Files (*.*)";
125 static string openSupportedExts = "Images and Model Files (*.png *.jpeg *.jpg *.bmp *.tiff *.tif *.pbm *.pgm *.ppm *.nii *.gz *.ima *.dcm *.dicom *.mhd *.img *.hdr *.vti *.mrc *.rec *.vtp *.vtk *.ply *.obj *.stl)";
126 static string openExts = openSupportedExts + ";;" + openModelExts + ";;" + openMedImageExts + ";;" + openImageExts + ";;" + openOtherImageExts + ";;" + openOtherExts + ";;" + allFileExts;
127 //Saves
128 static string saveImageExts = "Images (*.png *.jpeg *.jpg *.bmp *.tiff *.tif)";
129 static string saveMedImageExts = "Medical Images (*.nii *.gz *.ima *.dcm *.dicom *.mha *.mhd *.img *.hdr)";
130 static string saveOtherExts = "Text Delimited Files (*.csv *.dat *.txt)";
131 static string saveOtherImageExts = "Other Images (*.vti)";
132 static string saveModelExts = "Model or Polygonal File (*.vtp *.vtk *.ply *.obj *.stl)";
133 static string extensionsSave = "*.png *.jpeg *.jpg *.bmp *.tiff *.tif *.nii *.gz *.ima *.dcm *.dicom *.mhd *.img *.hdr *.vti *.vtp *.vtk *.ply *.obj *.stl";
134 static string saveExtsForImages = saveMedImageExts + ";;" + saveImageExts + ";;" + saveOtherImageExts;
135 static string saveExtsForScreens = saveImageExts;
136 static string saveExtsForModels = saveModelExts;
137 #endif //DEF_EXTS
138 
139 #endif // MILXQTALIASES_H_INCLUDED
Include stdexcept to handle conversion exceptions.