00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMINC.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*========================================================================= 00016 00017 Copyright (c) 2006 Atamai, Inc. 00018 00019 Use, modification and redistribution of the software, in source or 00020 binary forms, are permitted provided that the following terms and 00021 conditions are met: 00022 00023 1) Redistribution of the source code, in verbatim or modified 00024 form, must retain the above copyright notice, this license, 00025 the following disclaimer, and any notices that refer to this 00026 license and/or the following disclaimer. 00027 00028 2) Redistribution in binary form must include the above copyright 00029 notice, a copy of this license and the following disclaimer 00030 in the documentation or with other materials provided with the 00031 distribution. 00032 00033 3) Modified copies of the source code must be clearly marked as such, 00034 and must not be misrepresented as verbatim copies of the source code. 00035 00036 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" 00037 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO, 00038 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00039 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY 00040 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE 00041 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES 00042 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE 00043 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF 00044 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE 00045 POSSIBILITY OF SUCH DAMAGES. 00046 00047 =========================================================================*/ 00048 00049 /* 00050 This file has been modified from the original "minc.h" that was 00051 distributed with minc version 1.4. All of the prototype 00052 declarations have been removed. This modification was made in 00053 support of the use of this file with the vtkMINCReader 00054 and vtkMINCWriter. 00055 00056 David Gobbi, Atamai Inc.. 00057 */ 00058 00059 #ifndef vtkMINC_h 00060 #define vtkMINC_h 00061 00062 /* Added since the file moved to VTK */ 00063 #define MIident "ident" 00064 00065 /* Internally, attributes are stored as named arrays where 00066 * the format of the name is "/minc/variable/attribute" rather 00067 * than the typical NetCDF format "variable:attribute". 00068 */ 00069 #define MI_GRPNAME "/minc" 00070 #define MI_GRP_SEP "/" 00071 #define MI_ATT_SEP "/" 00072 00073 /* ----------------------------- MNI Header ----------------------------------- 00074 @NAME : minc.h 00075 @DESCRIPTION: Header file for minc (Medical Image NetCDF) file format 00076 standard. 00077 @METHOD : Includes name definitions for NetCDF dimensions, attributes 00078 and variables for the following : 00079 NetCDF standard attributes 00080 MI general variable attributes 00081 MI dimensions and associated variables 00082 MI dimension variable attributes 00083 MI root variable 00084 MI image variable 00085 MI patient variable 00086 MI study variable 00087 MI acquisition variable 00088 @CREATED : July 24, 1992. (Peter Neelin, Montreal Neurological Institute) 00089 @MODIFIED : 00090 * Log: vtkMINC.h 00091 * Revision 1.1 2006/09/03 01:01:21 dgobbi 00092 * ENH: move the MINC attributes into a separate file to make it easy to copy from the reader to the writer 00093 * 00094 * Revision 1.1 2006/08/30 16:03:22 dgobbi 00095 * ENH: Add a vtkMINC.h that contains all the MINC constants. Make the MINCReader and MINCWriter use it. 00096 * 00097 * Revision 6.11.2.2 2004/09/28 20:23:40 bert 00098 * Minor portability fixes for Windows 00099 * 00100 * Revision 6.11.2.1 2004/08/11 21:03:06 bert 00101 * Fix MI_MAX_IMGDIMS at 100 to avoid netCDF 3.5.1 problem 00102 * 00103 * Revision 6.11 2004/04/15 21:13:21 bert 00104 * Add C++ linkage specifier 00105 * 00106 * Revision 6.10 2004/02/02 18:22:34 bert 00107 * Added miget_version() and miappend_history() 00108 * 00109 * Revision 6.9 2003/03/17 16:03:28 bert 00110 * Added declaration of micreate_tempfile() 00111 * 00112 * Revision 6.8 2001/11/13 14:15:17 neelin 00113 * Added functions miget_image_range and mivar_exists 00114 * 00115 * Revision 6.7 2001/08/20 13:19:14 neelin 00116 * Added function miattget_with_sign to allow the caller to specify the sign 00117 * of the input attribute since this information is ambiguous. This is 00118 * necessary for the valid_range attribute which should have the same sign 00119 * as the image data. Modified miget_valid_range to make use of this function. 00120 * 00121 * Revision 6.6 2001/08/16 16:41:31 neelin 00122 * Added library functions to handle reading of datatype, sign and valid range, 00123 * plus writing of valid range and setting of default ranges. These functions 00124 * properly handle differences between valid_range type and image type. Such 00125 * difference can cause valid data to appear as invalid when double to float 00126 * conversion causes rounding in the wrong direction (out of range). 00127 * Modified voxel_loop, volume_io and programs to use these functions. 00128 * 00129 * Revision 6.5 2001/08/16 13:32:18 neelin 00130 * Partial fix for valid_range of different type from image (problems 00131 * arising from double to float conversion/rounding). NOT COMPLETE. 00132 * 00133 * Revision 6.4 2001/04/24 13:38:40 neelin 00134 * Replaced NC_NAT with MI_ORIGINAL_TYPE. 00135 * 00136 * Revision 6.3 2001/04/17 18:40:13 neelin 00137 * Modifications to work with NetCDF 3.x 00138 * In particular, changed NC_LONG to NC_INT (and corresponding longs to ints). 00139 * Changed NC_UNSPECIFIED to NC_NAT. 00140 * A few fixes to the configure script. 00141 * 00142 * Revision 6.2 2001/04/10 22:05:30 neelin 00143 * Start of modifications to get minc working with netcdf 3.5. 00144 * 00145 * Revision 6.1 1999/10/19 14:45:08 neelin 00146 * Fixed Log subsitutions for CVS 00147 * 00148 * Revision 6.0 1997/09/12 13:24:54 neelin 00149 * Release of minc version 0.6 00150 * 00151 * Revision 5.0 1997/08/21 13:25:53 neelin 00152 * Release of minc version 0.5 00153 * 00154 * Revision 4.0 1997/05/07 20:07:52 neelin 00155 * Release of minc version 0.4 00156 * 00157 * Revision 3.1 1995/06/12 17:37:05 neelin 00158 * Added MI_LABEL modality. 00159 * 00160 * Revision 3.0 1995/05/15 19:33:12 neelin 00161 * Release of minc version 0.3 00162 * 00163 * Revision 2.4 1995/01/24 08:34:30 neelin 00164 * Added optional tempfile argument to miexpand_file. 00165 * 00166 * Revision 2.3 95/01/23 08:28:31 neelin 00167 * Changed name of midecompress_file to miexpand_file. 00168 * 00169 * Revision 2.2 95/01/20 15:21:16 neelin 00170 * Added midecompress_file with ability to decompress only the header of a file. 00171 * 00172 * Revision 2.1 94/11/25 15:32:32 neelin 00173 * Added #undef for public if it wasn't previously defined so that C++ 00174 * code won't get upset. 00175 * 00176 * Revision 2.0 94/09/28 10:38:00 neelin 00177 * Release of minc version 0.2 00178 * 00179 * Revision 1.29 94/09/28 10:37:24 neelin 00180 * Pre-release 00181 * 00182 * Revision 1.28 93/11/03 13:08:37 neelin 00183 * Added prototypes for miopen, miclose, micreate. 00184 * 00185 * Revision 1.27 93/11/03 12:29:11 neelin 00186 * Added error code for failure to uncompress a file. 00187 * 00188 * Revision 1.26 93/08/11 12:06:34 neelin 00189 * Added RCS logging in source. 00190 * 00191 July 15, 1993 (P.N.) 00192 - added MI_ICV_DO_FILLVALUE and MI_FILLVALUE 00193 @COPYRIGHT : 00194 Copyright 1993 Peter Neelin, McConnell Brain Imaging Centre, 00195 Montreal Neurological Institute, McGill University. 00196 Permission to use, copy, modify, and distribute this 00197 software and its documentation for any purpose and without 00198 fee is hereby granted, provided that the above copyright 00199 notice appear in all copies. The author and McGill University 00200 make no representations about the suitability of this 00201 software for any purpose. It is provided "as is" without 00202 express or implied warranty. 00203 @RCSID : Header MINC (MNI) 00204 ---------------------------------------------------------------------------- */ 00205 00206 /* Some useful constants */ 00207 #define MI_EMPTY_STRING "" 00208 /* Error flags */ 00209 #define MI_ERROR (-1) 00210 #define MI_NOERROR 0 00211 /* Maximum length of standard attributes */ 00212 #define MI_MAX_ATTSTR_LEN 64 00213 /* Number of spatial dimensions */ 00214 #define MI_NUM_SPACE_DIMS 3 00215 /* Maximum number of image dimensions for image conversion */ 00216 00217 /* Bert 10-Aug-2004 - MI_MAX_IMGDIMS used to be defined to be MAX_VAR_DIMS, 00218 * a constant defined in netcdf.h. For many years MAX_VAR_DIMS was 100, 00219 * but in netCDF 3.5.1 the value was changed to 512. 00220 * Unfortunately, the definitions of MI_ICV_DIM_SIZE, MI_ICV_DIM_STEP, 00221 * and MI_ICV_DIM_START assume that MI_MAX_IMGDIMS is less than or 00222 * equal to 100. To avoid changing the MINC API, we have to define 00223 * MI_MAX_IMGDIMS to 100 here. Otherwise the miicv_inqdbl() function 00224 * will return bogus values for these ICV properties. 00225 */ 00226 #define MI_MAX_IMGDIMS 100 00227 00228 /* NetCDF standard attributes */ 00229 #define MIunits "units" 00230 #define MIlong_name "long_name" 00231 #define MIvalid_range "valid_range" 00232 #define MIvalid_max "valid_max" 00233 #define MIvalid_min "valid_min" 00234 #define MI_FillValue "_FillValue" 00235 #define MItitle "title" 00236 #define MIhistory "history" 00237 00238 /* General variable attributes */ 00239 #define MIvartype "vartype" 00240 #define MIvarid "varid" 00241 #define MIsigntype "signtype" 00242 #define MIparent "parent" 00243 #define MIchildren "children" 00244 #define MIcomments "comments" 00245 #define MIversion "version" 00246 00247 /* General attribute constants */ 00248 /* Prefix for identifying a variable attribute pointer */ 00249 #define MI_VARATT_POINTER_PREFIX "--->" 00250 /* Separator for elements of MIchildren */ 00251 #define MI_CHILD_SEPARATOR "\n" 00252 /* MIvartype values */ 00253 #define MI_GROUP "group________" 00254 #define MI_DIMENSION "dimension____" 00255 #define MI_DIM_WIDTH "dim-width____" 00256 #define MI_VARATT "var_attribute" 00257 /* MIvarid value */ 00258 #define MI_STDVAR "MINC standard variable" 00259 /* MIsigntype values */ 00260 #define MI_SIGNED "signed__" 00261 #define MI_UNSIGNED "unsigned" 00262 /* MIversion value */ 00263 #define MI_VERSION_1_0 "MINC Version 1.0" 00264 #define MI_CURRENT_VERSION MI_VERSION_1_0 00265 /* Generally useful values for boolean attributes */ 00266 #define MI_TRUE "true_" 00267 #define MI_FALSE "false" 00268 00269 /* Dimension names and names of associated variables */ 00270 #define MIxspace "xspace" 00271 #define MIyspace "yspace" 00272 #define MIzspace "zspace" 00273 #define MItime "time" 00274 #define MItfrequency "tfrequency" 00275 #define MIxfrequency "xfrequency" 00276 #define MIyfrequency "yfrequency" 00277 #define MIzfrequency "zfrequency" 00278 #define MIvector_dimension "vector_dimension" 00279 #define MIxspace_width "xspace-width" 00280 #define MIyspace_width "yspace-width" 00281 #define MIzspace_width "zspace-width" 00282 #define MItime_width "time-width" 00283 #define MItfrequency_width "tfrequency-width" 00284 #define MIxfrequency_width "xfrequency-width" 00285 #define MIyfrequency_width "yfrequency-width" 00286 #define MIzfrequency_width "zfrequency-width" 00287 00288 /* Dimension variable attribute names */ 00289 /* For dimension variables (MIspacing is also for dimension width vars) */ 00290 #define MIspacing "spacing" 00291 #define MIstep "step" 00292 #define MIstart "start" 00293 #define MIspacetype "spacetype" 00294 #define MIalignment "alignment" 00295 #define MIdirection_cosines "direction_cosines" 00296 /* For dimension width variables */ 00297 #define MIwidth "width" 00298 #define MIfiltertype "filtertype" 00299 00300 /* Dimension attribute constants */ 00301 /* MIgridtype values */ 00302 #define MI_REGULAR "regular__" 00303 #define MI_IRREGULAR "irregular" 00304 /* MIspacetype values */ 00305 #define MI_NATIVE "native____" 00306 #define MI_TALAIRACH "talairach_" 00307 #define MI_CALLOSAL "callosal__" 00308 /* MIalignment values */ 00309 #define MI_START "start_" 00310 #define MI_CENTRE "centre" 00311 #define MI_END "end___" 00312 #define MI_CENTER MI_CENTRE 00313 /* MIfiltertype values */ 00314 #define MI_SQUARE "square____" 00315 #define MI_GAUSSIAN "gaussian__" 00316 #define MI_TRIANGULAR "triangular" 00317 00318 /* The root variable */ 00319 #define MIrootvariable "rootvariable" 00320 00321 /* The image variable and its attributes */ 00322 #define MIimage "image" 00323 #define MIimagemax "image-max" 00324 #define MIimagemin "image-min" 00325 #define MIcomplete "complete" 00326 00327 /* The patient variable and its attributes */ 00328 #define MIpatient "patient" 00329 #define MIfull_name "full_name" 00330 #define MIother_names "other_names" 00331 #define MIidentification "identification" 00332 #define MIother_ids "other_ids" 00333 #define MIbirthdate "birthdate" 00334 #define MIsex "sex" 00335 #define MIage "age" 00336 #define MIweight "weight" 00337 #define MIsize "size" 00338 #define MIaddress "address" 00339 #define MIinsurance_id "insurance_id" 00340 00341 /* Patient attribute constants */ 00342 #define MI_MALE "male__" 00343 #define MI_FEMALE "female" 00344 #define MI_OTHER "other_" 00345 00346 /* The study variable and its attributes */ 00347 #define MIstudy "study" 00348 #define MIstart_time "start_time" 00349 #define MIstart_year "start_year" 00350 #define MIstart_month "start_month" 00351 #define MIstart_day "start_day" 00352 #define MIstart_hour "start_hour" 00353 #define MIstart_minute "start_minute" 00354 #define MIstart_seconds "start_seconds" 00355 #define MImodality "modality" 00356 #define MImanufacturer "manufacturer" 00357 #define MIdevice_model "device_model" 00358 #define MIinstitution "institution" 00359 #define MIdepartment "department" 00360 #define MIstation_id "station_id" 00361 #define MIreferring_physician "referring_physician" 00362 #define MIattending_physician "attending_physician" 00363 #define MIradiologist "radiologist" 00364 #define MIoperator "operator" 00365 #define MIadmitting_diagnosis "admitting_diagnosis" 00366 #define MIprocedure "procedure" 00367 #define MIstudy_id "study_id" 00368 00369 /* Study attribute constants */ 00370 #define MI_PET "PET__" 00371 #define MI_SPECT "SPECT" 00372 #define MI_GAMMA "GAMMA" 00373 #define MI_MRI "MRI__" 00374 #define MI_MRS "MRS__" 00375 #define MI_MRA "MRA__" 00376 #define MI_CT "CT___" 00377 #define MI_DSA "DSA__" 00378 #define MI_DR "DR___" 00379 #define MI_LABEL "label" 00380 00381 /* The acquisition variable and its attributes */ 00382 #define MIacquisition "acquisition" 00383 #define MIprotocol "protocol" 00384 #define MIscanning_sequence "scanning_sequence" 00385 #define MIrepetition_time "repetition_time" 00386 #define MIecho_time "echo_time" 00387 #define MIinversion_time "inversion_time" 00388 #define MInum_averages "num_averages" 00389 #define MIimaging_frequency "imaging_frequency" 00390 #define MIimaged_nucleus "imaged_nucleus" 00391 #define MIradionuclide "radionuclide" 00392 #define MIcontrast_agent "contrast_agent" 00393 #define MIradionuclide_halflife "radionuclide_halflife" 00394 #define MItracer "tracer" 00395 #define MIinjection_time "injection_time" 00396 #define MIinjection_year "injection_year" 00397 #define MIinjection_month "injection_month" 00398 #define MIinjection_day "injection_day" 00399 #define MIinjection_hour "injection_hour" 00400 #define MIinjection_minute "injection_minute" 00401 #define MIinjection_seconds "injection_seconds" 00402 #define MIinjection_length "injection_length" 00403 #define MIinjection_dose "injection_dose" 00404 #define MIdose_units "dose_units" 00405 #define MIinjection_volume "injection_volume" 00406 #define MIinjection_route "injection_route" 00407 00408 /* End ifndef vtkMINC_h */ 00409 #endif