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