VTK  9.1.0
vtkMINC.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMINC.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*=========================================================================
16
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) Redistribution of the source code, in verbatim or modified
24 form, must retain the above copyright notice, this license,
25 the following disclaimer, and any notices that refer to this
26 license and/or the following disclaimer.
27
282) Redistribution in binary form must include the above copyright
29 notice, a copy of this license and the following disclaimer
30 in the documentation or with other materials provided with the
31 distribution.
32
333) Modified copies of the source code must be clearly marked as such,
34 and must not be misrepresented as verbatim copies of the source code.
35
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
48
49/*
50 This file has been modified from the original "minc.h" that was
51 distributed with minc version 1.4. All of the prototype
52 declarations have been removed. This modification was made in
53 support of the use of this file with the vtkMINCReader
54 and vtkMINCWriter.
55
56 David Gobbi, Atamai Inc..
57*/
58
59#ifndef vtkMINC_h
60#define vtkMINC_h
61
62/* Added since the file moved to VTK */
63#define MIident "ident"
64
65/* Internally, attributes are stored as named arrays where
66 * the format of the name is "/minc/variable/attribute" rather
67 * than the typical NetCDF format "variable:attribute".
68 */
69#define MI_GRPNAME "/minc"
70#define MI_GRP_SEP "/"
71#define MI_ATT_SEP "/"
72
73/* ----------------------------- MNI Header -----------------------------------
74@NAME : minc.h
75@DESCRIPTION: Header file for minc (Medical Image NetCDF) file format
76 standard.
77@METHOD : Includes name definitions for NetCDF dimensions, attributes
78 and variables for the following :
79 NetCDF standard attributes
80 MI general variable attributes
81 MI dimensions and associated variables
82 MI dimension variable attributes
83 MI root variable
84 MI image variable
85 MI patient variable
86 MI study variable
87 MI acquisition variable
88@CREATED : July 24, 1992. (Peter Neelin, Montreal Neurological Institute)
89@MODIFIED :
90 * Log: vtkMINC.h
91 * Revision 1.1 2006/09/03 01:01:21 dgobbi
92 * ENH: move the MINC attributes into a separate file to make it easy to copy from the reader to the
93writer
94 *
95 * Revision 1.1 2006/08/30 16:03:22 dgobbi
96 * ENH: Add a vtkMINC.h that contains all the MINC constants. Make the MINCReader and MINCWriter
97use it.
98 *
99 * Revision 6.11.2.2 2004/09/28 20:23:40 bert
100 * Minor portability fixes for Windows
101 *
102 * Revision 6.11.2.1 2004/08/11 21:03:06 bert
103 * Fix MI_MAX_IMGDIMS at 100 to avoid netCDF 3.5.1 problem
104 *
105 * Revision 6.11 2004/04/15 21:13:21 bert
106 * Add C++ linkage specifier
107 *
108 * Revision 6.10 2004/02/02 18:22:34 bert
109 * Added miget_version() and miappend_history()
110 *
111 * Revision 6.9 2003/03/17 16:03:28 bert
112 * Added declaration of micreate_tempfile()
113 *
114 * Revision 6.8 2001/11/13 14:15:17 neelin
115 * Added functions miget_image_range and mivar_exists
116 *
117 * Revision 6.7 2001/08/20 13:19:14 neelin
118 * Added function miattget_with_sign to allow the caller to specify the sign
119 * of the input attribute since this information is ambiguous. This is
120 * necessary for the valid_range attribute which should have the same sign
121 * as the image data. Modified miget_valid_range to make use of this function.
122 *
123 * Revision 6.6 2001/08/16 16:41:31 neelin
124 * Added library functions to handle reading of datatype, sign and valid range,
125 * plus writing of valid range and setting of default ranges. These functions
126 * properly handle differences between valid_range type and image type. Such
127 * difference can cause valid data to appear as invalid when double to float
128 * conversion causes rounding in the wrong direction (out of range).
129 * Modified voxel_loop, volume_io and programs to use these functions.
130 *
131 * Revision 6.5 2001/08/16 13:32:18 neelin
132 * Partial fix for valid_range of different type from image (problems
133 * arising from double to float conversion/rounding). NOT COMPLETE.
134 *
135 * Revision 6.4 2001/04/24 13:38:40 neelin
136 * Replaced NC_NAT with MI_ORIGINAL_TYPE.
137 *
138 * Revision 6.3 2001/04/17 18:40:13 neelin
139 * Modifications to work with NetCDF 3.x
140 * In particular, changed NC_LONG to NC_INT (and corresponding longs to ints).
141 * Changed NC_UNSPECIFIED to NC_NAT.
142 * A few fixes to the configure script.
143 *
144 * Revision 6.2 2001/04/10 22:05:30 neelin
145 * Start of modifications to get minc working with netcdf 3.5.
146 *
147 * Revision 6.1 1999/10/19 14:45:08 neelin
148 * Fixed Log subsitutions for CVS
149 *
150 * Revision 6.0 1997/09/12 13:24:54 neelin
151 * Release of minc version 0.6
152 *
153 * Revision 5.0 1997/08/21 13:25:53 neelin
154 * Release of minc version 0.5
155 *
156 * Revision 4.0 1997/05/07 20:07:52 neelin
157 * Release of minc version 0.4
158 *
159 * Revision 3.1 1995/06/12 17:37:05 neelin
160 * Added MI_LABEL modality.
161 *
162 * Revision 3.0 1995/05/15 19:33:12 neelin
163 * Release of minc version 0.3
164 *
165 * Revision 2.4 1995/01/24 08:34:30 neelin
166 * Added optional tempfile argument to miexpand_file.
167 *
168 * Revision 2.3 95/01/23 08:28:31 neelin
169 * Changed name of midecompress_file to miexpand_file.
170 *
171 * Revision 2.2 95/01/20 15:21:16 neelin
172 * Added midecompress_file with ability to decompress only the header of a file.
173 *
174 * Revision 2.1 94/11/25 15:32:32 neelin
175 * Added #undef for public if it wasn't previously defined so that C++
176 * code won't get upset.
177 *
178 * Revision 2.0 94/09/28 10:38:00 neelin
179 * Release of minc version 0.2
180 *
181 * Revision 1.29 94/09/28 10:37:24 neelin
182 * Pre-release
183 *
184 * Revision 1.28 93/11/03 13:08:37 neelin
185 * Added prototypes for miopen, miclose, micreate.
186 *
187 * Revision 1.27 93/11/03 12:29:11 neelin
188 * Added error code for failure to uncompress a file.
189 *
190 * Revision 1.26 93/08/11 12:06:34 neelin
191 * Added RCS logging in source.
192 *
193 July 15, 1993 (P.N.)
194 - added MI_ICV_DO_FILLVALUE and MI_FILLVALUE
195@COPYRIGHT :
196 Copyright 1993 Peter Neelin, McConnell Brain Imaging Centre,
197 Montreal Neurological Institute, McGill University.
198 Permission to use, copy, modify, and distribute this
199 software and its documentation for any purpose and without
200 fee is hereby granted, provided that the above copyright
201 notice appear in all copies. The author and McGill University
202 make no representations about the suitability of this
203 software for any purpose. It is provided "as is" without
204 express or implied warranty.
205@RCSID : Header MINC (MNI)
206---------------------------------------------------------------------------- */
207
208/* Some useful constants */
209#define MI_EMPTY_STRING ""
210/* Error flags */
211#define MI_ERROR (-1)
212#define MI_NOERROR 0
213/* Maximum length of standard attributes */
214#define MI_MAX_ATTSTR_LEN 64
215/* Number of spatial dimensions */
216#define MI_NUM_SPACE_DIMS 3
217/* Maximum number of image dimensions for image conversion */
218
219/* Bert 10-Aug-2004 - MI_MAX_IMGDIMS used to be defined to be MAX_VAR_DIMS,
220 * a constant defined in netcdf.h. For many years MAX_VAR_DIMS was 100,
221 * but in netCDF 3.5.1 the value was changed to 512.
222 * Unfortunately, the definitions of MI_ICV_DIM_SIZE, MI_ICV_DIM_STEP,
223 * and MI_ICV_DIM_START assume that MI_MAX_IMGDIMS is less than or
224 * equal to 100. To avoid changing the MINC API, we have to define
225 * MI_MAX_IMGDIMS to 100 here. Otherwise the miicv_inqdbl() function
226 * will return bogus values for these ICV properties.
227 */
228#define MI_MAX_IMGDIMS 100
229
230/* NetCDF standard attributes */
231#define MIunits "units"
232#define MIlong_name "long_name"
233#define MIvalid_range "valid_range"
234#define MIvalid_max "valid_max"
235#define MIvalid_min "valid_min"
236#define MI_FillValue "_FillValue"
237#define MItitle "title"
238#define MIhistory "history"
239
240/* General variable attributes */
241#define MIvartype "vartype"
242#define MIvarid "varid"
243#define MIsigntype "signtype"
244#define MIparent "parent"
245#define MIchildren "children"
246#define MIcomments "comments"
247#define MIversion "version"
248
249/* General attribute constants */
250/* Prefix for identifying a variable attribute pointer */
251#define MI_VARATT_POINTER_PREFIX "--->"
252/* Separator for elements of MIchildren */
253#define MI_CHILD_SEPARATOR "\n"
254/* MIvartype values */
255#define MI_GROUP "group________"
256#define MI_DIMENSION "dimension____"
257#define MI_DIM_WIDTH "dim-width____"
258#define MI_VARATT "var_attribute"
259/* MIvarid value */
260#define MI_STDVAR "MINC standard variable"
261/* MIsigntype values */
262#define MI_SIGNED "signed__"
263#define MI_UNSIGNED "unsigned"
264/* MIversion value */
265#define MI_VERSION_1_0 "MINC Version 1.0"
266#define MI_CURRENT_VERSION MI_VERSION_1_0
267/* Generally useful values for boolean attributes */
268#define MI_TRUE "true_"
269#define MI_FALSE "false"
270
271/* Dimension names and names of associated variables */
272#define MIxspace "xspace"
273#define MIyspace "yspace"
274#define MIzspace "zspace"
275#define MItime "time"
276#define MItfrequency "tfrequency"
277#define MIxfrequency "xfrequency"
278#define MIyfrequency "yfrequency"
279#define MIzfrequency "zfrequency"
280#define MIvector_dimension "vector_dimension"
281#define MIxspace_width "xspace-width"
282#define MIyspace_width "yspace-width"
283#define MIzspace_width "zspace-width"
284#define MItime_width "time-width"
285#define MItfrequency_width "tfrequency-width"
286#define MIxfrequency_width "xfrequency-width"
287#define MIyfrequency_width "yfrequency-width"
288#define MIzfrequency_width "zfrequency-width"
289
290/* Dimension variable attribute names */
291/* For dimension variables (MIspacing is also for dimension width vars) */
292#define MIspacing "spacing"
293#define MIstep "step"
294#define MIstart "start"
295#define MIspacetype "spacetype"
296#define MIalignment "alignment"
297#define MIdirection_cosines "direction_cosines"
298/* For dimension width variables */
299#define MIwidth "width"
300#define MIfiltertype "filtertype"
301
302/* Dimension attribute constants */
303/* MIgridtype values */
304#define MI_REGULAR "regular__"
305#define MI_IRREGULAR "irregular"
306/* MIspacetype values */
307#define MI_NATIVE "native____"
308#define MI_TALAIRACH "talairach_"
309#define MI_CALLOSAL "callosal__"
310/* MIalignment values */
311#define MI_START "start_"
312#define MI_CENTRE "centre"
313#define MI_END "end___"
314#define MI_CENTER MI_CENTRE
315/* MIfiltertype values */
316#define MI_SQUARE "square____"
317#define MI_GAUSSIAN "gaussian__"
318#define MI_TRIANGULAR "triangular"
319
320/* The root variable */
321#define MIrootvariable "rootvariable"
322
323/* The image variable and its attributes */
324#define MIimage "image"
325#define MIimagemax "image-max"
326#define MIimagemin "image-min"
327#define MIcomplete "complete"
328
329/* The patient variable and its attributes */
330#define MIpatient "patient"
331#define MIfull_name "full_name"
332#define MIother_names "other_names"
333#define MIidentification "identification"
334#define MIother_ids "other_ids"
335#define MIbirthdate "birthdate"
336#define MIsex "sex"
337#define MIage "age"
338#define MIweight "weight"
339#define MIsize "size"
340#define MIaddress "address"
341#define MIinsurance_id "insurance_id"
342
343/* Patient attribute constants */
344#define MI_MALE "male__"
345#define MI_FEMALE "female"
346#define MI_OTHER "other_"
347
348/* The study variable and its attributes */
349#define MIstudy "study"
350#define MIstart_time "start_time"
351#define MIstart_year "start_year"
352#define MIstart_month "start_month"
353#define MIstart_day "start_day"
354#define MIstart_hour "start_hour"
355#define MIstart_minute "start_minute"
356#define MIstart_seconds "start_seconds"
357#define MImodality "modality"
358#define MImanufacturer "manufacturer"
359#define MIdevice_model "device_model"
360#define MIinstitution "institution"
361#define MIdepartment "department"
362#define MIstation_id "station_id"
363#define MIreferring_physician "referring_physician"
364#define MIattending_physician "attending_physician"
365#define MIradiologist "radiologist"
366#define MIoperator "operator"
367#define MIadmitting_diagnosis "admitting_diagnosis"
368#define MIprocedure "procedure"
369#define MIstudy_id "study_id"
370
371/* Study attribute constants */
372#define MI_PET "PET__"
373#define MI_SPECT "SPECT"
374#define MI_GAMMA "GAMMA"
375#define MI_MRI "MRI__"
376#define MI_MRS "MRS__"
377#define MI_MRA "MRA__"
378#define MI_CT "CT___"
379#define MI_DSA "DSA__"
380#define MI_DR "DR___"
381#define MI_LABEL "label"
382
383/* The acquisition variable and its attributes */
384#define MIacquisition "acquisition"
385#define MIprotocol "protocol"
386#define MIscanning_sequence "scanning_sequence"
387#define MIrepetition_time "repetition_time"
388#define MIecho_time "echo_time"
389#define MIinversion_time "inversion_time"
390#define MInum_averages "num_averages"
391#define MIimaging_frequency "imaging_frequency"
392#define MIimaged_nucleus "imaged_nucleus"
393#define MIradionuclide "radionuclide"
394#define MIcontrast_agent "contrast_agent"
395#define MIradionuclide_halflife "radionuclide_halflife"
396#define MItracer "tracer"
397#define MIinjection_time "injection_time"
398#define MIinjection_year "injection_year"
399#define MIinjection_month "injection_month"
400#define MIinjection_day "injection_day"
401#define MIinjection_hour "injection_hour"
402#define MIinjection_minute "injection_minute"
403#define MIinjection_seconds "injection_seconds"
404#define MIinjection_length "injection_length"
405#define MIinjection_dose "injection_dose"
406#define MIdose_units "dose_units"
407#define MIinjection_volume "injection_volume"
408#define MIinjection_route "injection_route"
409
410/* End ifndef vtkMINC_h */
411#endif
412// VTK-HeaderTest-Exclude: vtkMINC.h