1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
|
/*
NrrdIO: stand-alone code for basic nrrd functionality
Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "NrrdIO.h"
/*
** Rules of thumb for editing these things. The airEnum definitions are
** unfortunately EXTREMELY sensitive to small typo errors, and there is
** no good way to detect the errors. So:
**
** 1) Be awake and undistracted. Turn down the music.
** 2) When editing the char arrays, make sure that you put commas
** where you mean them to be. C's automatic string concatenation
** is not your friend here. In fact, EXPLOIT the fact that you can have
** a comma after the last element of a list (of strings)- it decreases
** the chances that adding a new element at the end will be thwarted by
** the lack of a comma at the end of the previous (and previously last)
** string.
** 3) When editing the *StrEqv and *ValEqv arrays, make absolutely
** sure that both are changed in parallel. Use only one enum value
** per line; putting all equivalents on that line, and make sure that
** there is one line in both *StrEqv and *ValEqv for all the possible
** enum values, and that there are as many elements in each line.
** 4) Make sure that additions here are reflected in nrrdEnums.h and
** vice versa.
*/
/* ------------------------ nrrdFormat ------------------------- */
const char *
_nrrdFormatTypeStr[NRRD_FORMAT_TYPE_MAX+1] = {
"(unknown_format)",
"nrrd",
"pnm",
"png",
"vtk",
"text",
"eps",
};
const char *
_nrrdFormatTypeDesc[NRRD_FORMAT_TYPE_MAX+1] = {
"unknown_format",
"native format for nearly raw raster data",
"Portable aNy Map: includes PGM for grayscale and PPM for color",
"Portable Network Graphics: lossless compression of 8- and 16-bit data",
"Visualization ToolKit STRUCTURED_POINTS data",
"white-space-delimited plain text encoding of 2-D float array",
"Encapsulated PostScript images",
};
const char *
_nrrdFormatTypeStrEqv[] = {
"nrrd",
"pnm",
"png",
"vtk",
"table", "text", "txt",
"eps",
""
};
const int
_nrrdFormatTypeValEqv[] = {
nrrdFormatTypeNRRD,
nrrdFormatTypePNM,
nrrdFormatTypePNG,
nrrdFormatTypeVTK,
nrrdFormatTypeText, nrrdFormatTypeText, nrrdFormatTypeText,
nrrdFormatTypeEPS,
};
airEnum
_nrrdFormatType = {
"format",
NRRD_FORMAT_TYPE_MAX,
_nrrdFormatTypeStr, NULL,
_nrrdFormatTypeDesc,
_nrrdFormatTypeStrEqv, _nrrdFormatTypeValEqv,
AIR_FALSE
};
const airEnum *const
nrrdFormatType = &_nrrdFormatType;
/* ------------------------ nrrdType ------------------------- */
const char *
_nrrdTypeStr[NRRD_TYPE_MAX+1] = {
"(unknown_type)",
"signed char",
"unsigned char",
"short",
"unsigned short",
"int",
"unsigned int",
"long long int",
"unsigned long long int",
"float",
"double",
"block",
};
const char *
_nrrdTypeDesc[NRRD_TYPE_MAX+1] = {
"unknown type",
"signed 1-byte integer",
"unsigned 1-byte integer",
"signed 2-byte integer",
"unsigned 2-byte integer",
"signed 4-byte integer",
"unsigned 4-byte integer",
"signed 8-byte integer",
"unsigned 8-byte integer",
"4-byte floating point",
"8-byte floating point",
"size user-defined at run-time",
};
#define ntCH nrrdTypeChar
#define ntUC nrrdTypeUChar
#define ntSH nrrdTypeShort
#define ntUS nrrdTypeUShort
#define ntIN nrrdTypeInt
#define ntUI nrrdTypeUInt
#define ntLL nrrdTypeLLong
#define ntUL nrrdTypeULLong
#define ntFL nrrdTypeFloat
#define ntDB nrrdTypeDouble
#define ntBL nrrdTypeBlock
const char *
_nrrdTypeStrEqv[] = {
"signed char", /* but NOT just "char" */ "int8", "int8_t",
"uchar", "unsigned char", "uint8", "uint8_t",
"short", "short int", "signed short", "signed short int", "int16", "int16_t",
"ushort", "unsigned short", "unsigned short int", "uint16", "uint16_t",
"int", "signed int", "int32", "int32_t",
"uint", "unsigned int", "uint32", "uint32_t",
"longlong", "long long", "long long int", "signed long long",
"signed long long int", "int64", "int64_t",
"ulonglong", "unsigned long long", "unsigned long long int",
"uint64", "uint64_t",
"float",
"double",
"block",
""
};
const int
_nrrdTypeValEqv[] = {
ntCH, ntCH, ntCH,
ntUC, ntUC, ntUC, ntUC,
ntSH, ntSH, ntSH, ntSH, ntSH, ntSH,
ntUS, ntUS, ntUS, ntUS, ntUS,
ntIN, ntIN, ntIN, ntIN,
ntUI, ntUI, ntUI, ntUI,
ntLL, ntLL, ntLL, ntLL, ntLL, ntLL, ntLL,
ntUL, ntUL, ntUL, ntUL, ntUL,
ntFL,
ntDB,
ntBL,
};
airEnum
_nrrdType = {
"type",
NRRD_TYPE_MAX,
_nrrdTypeStr, NULL,
_nrrdTypeDesc,
_nrrdTypeStrEqv, _nrrdTypeValEqv,
AIR_FALSE
};
const airEnum *const
nrrdType = &_nrrdType;
/* ------------------------ nrrdEncodingType ------------------------- */
const char *
_nrrdEncodingTypeStr[NRRD_ENCODING_TYPE_MAX+1] = {
"(unknown_encoding)",
"raw",
"ascii",
"hex",
"gz",
"bz2",
};
const char *
_nrrdEncodingTypeDesc[NRRD_ENCODING_TYPE_MAX+1] = {
"unknown encoding",
"file is byte-for-byte same as memory representation",
"values written out in ASCII",
"case-insenstive hexadecimal encoding (2 chars / byte)",
"gzip compression of binary encoding",
"bzip2 compression of binary encoding",
};
const char *
_nrrdEncodingTypeStrEqv[] = {
"(unknown_encoding)",
"raw",
"txt", "text", "ascii",
"hex",
"gz", "gzip",
"bz2", "bzip2",
""
};
const int
_nrrdEncodingTypeValEqv[] = {
nrrdEncodingTypeUnknown,
nrrdEncodingTypeRaw,
nrrdEncodingTypeAscii, nrrdEncodingTypeAscii, nrrdEncodingTypeAscii,
nrrdEncodingTypeHex,
nrrdEncodingTypeGzip, nrrdEncodingTypeGzip,
nrrdEncodingTypeBzip2, nrrdEncodingTypeBzip2,
};
airEnum
_nrrdEncodingType = {
"encoding",
NRRD_ENCODING_TYPE_MAX,
_nrrdEncodingTypeStr, NULL,
_nrrdEncodingTypeDesc,
_nrrdEncodingTypeStrEqv, _nrrdEncodingTypeValEqv,
AIR_FALSE
};
const airEnum *const
nrrdEncodingType = &_nrrdEncodingType;
/* ------------------------ nrrdCenter ------------------------- */
const char *
_nrrdCenterStr[NRRD_CENTER_MAX+1] = {
"(unknown_center)",
"node",
"cell",
};
const char *
_nrrdCenterDesc[NRRD_CENTER_MAX+1] = {
"unknown centering",
"samples are at boundaries between elements along axis",
"samples are at centers of elements along axis",
};
airEnum
_nrrdCenter_enum = {
"centering",
NRRD_CENTER_MAX,
_nrrdCenterStr, NULL,
_nrrdCenterDesc,
NULL, NULL,
AIR_FALSE
};
const airEnum *const
nrrdCenter = &_nrrdCenter_enum;
/* ------------------------ nrrdKind ------------------------- */
/*
nrrdKindUnknown,
nrrdKindDomain, * 1: any image domain *
nrrdKindSpace, * 2: a spatial domain *
nrrdKindTime, * 3: a temporal domain *
* -------------------------- end domain kinds *
* -------------------------- begin range kinds *
nrrdKindList, * 4: any list of values, non-resample-able *
nrrdKindPoint, * 5: coords of a point *
nrrdKindVector, * 6: coeffs of (contravariant) vector *
nrrdKindCovariantVector, * 7: coeffs of covariant vector (eg gradient) *
nrrdKindNormal, * 8: coeffs of unit-length covariant vector *
* -------------------------- end arbitrary size kinds *
* -------------------------- begin size-specific kinds *
nrrdKindStub, * 9: axis with one sample (a placeholder) *
nrrdKindScalar, * 10: effectively, same as a stub *
nrrdKindComplex, * 11: real and imaginary components *
nrrdKind2Vector, * 12: 2 component vector *
nrrdKind3Color, * 13: ANY 3-component color value *
nrrdKindRGBColor, * 14: RGB, no colorimetry *
nrrdKindHSVColor, * 15: HSV, no colorimetry *
nrrdKindXYZColor, * 16: perceptual primary colors *
nrrdKind4Color, * 17: ANY 4-component color value *
nrrdKindRGBAColor, * 18: RGBA, no colorimetry *
nrrdKind3Vector, * 19: 3-component vector *
nrrdKind3Gradient, * 20: 3-component covariant vector *
nrrdKind3Normal, * 21: 3-component covector, assumed normalized *
nrrdKind4Vector, * 22: 4-component vector *
nrrdKindQuaternion, * 23: (w,x,y,z), not necessarily normalized *
nrrdKind2DSymMatrix, * 24: Mxx Mxy Myy *
nrrdKind2DMaskedSymMatrix, * 25: mask Mxx Mxy Myy *
nrrdKind2DMatrix, * 26: Mxx Mxy Myx Myy *
nrrdKind2DMaskedMatrix, * 27: mask Mxx Mxy Myx Myy *
nrrdKind3DSymMatrix, * 28: Mxx Mxy Mxz Myy Myz Mzz *
nrrdKind3DMaskedSymMatrix, * 29: mask Mxx Mxy Mxz Myy Myz Mzz *
nrrdKind3DMatrix, * 30: Mxx Mxy Mxz Myx Myy Myz Mzx Mzy Mzz *
nrrdKind3DMaskedMatrix, * 31: mask Mxx Mxy Mxz Myx Myy Myz Mzx Mzy Mzz *
*/
const char *
_nrrdKindStr[NRRD_KIND_MAX+1] = {
"(unknown_kind)",
"domain",
"space",
"time",
"list",
"point",
"vector",
"covariant-vector",
"normal",
"stub",
"scalar",
"complex",
"2-vector",
"3-color",
"RGB-color",
"HSV-color",
"XYZ-color",
"4-color",
"RGBA-color",
"3-vector",
"3-gradient",
"3-normal",
"4-vector",
"quaternion",
"2D-symmetric-matrix",
"2D-masked-symmetric-matrix",
"2D-matrix",
"2D-masked-matrix",
"3D-symmetric-matrix",
"3D-masked-symmetric-matrix",
"3D-matrix",
"3D-masked-matrix",
};
const char *
_nrrdKindDesc[NRRD_KIND_MAX+1] = {
"unknown kind",
"a domain variable of the function which the nrrd samples",
"a spatial domain, like the axes of a measured volume image",
"a temporal domain, as from time-varying measurements",
"some list of attributes; it makes no sense to resample along these",
"coordinates of a point",
"coefficients of a (contravariant) vector",
"coefficients of a covariant vector, such as a gradient",
"coefficients of a normalized covariant vector",
"a place-holder axis with a single sample",
"axis used to indicate that the nrrd contains a scalar value",
"real and imaginary parts of a value",
"a 2-component vector",
"any 3-component color value",
"red-green-blue color",
"hue-saturation-value single hexcone color",
"perceptual primaries color",
"any 4-component color value",
"red-green-blue-alpha color",
"a 3-element (contravariant) vector",
"a 3-element gradient (covariant) vector",
"a 3-element (covariant) vector which is assumed normalized",
"a 4-element (contravariant) vector",
"quaternion: x y z w",
"3 elements of 2D symmetric matrix: Mxx Mxy Myy",
"mask plus 3 elements of 2D symmetric matrix: mask Mxx Mxy Myy",
"4 elements of general 2D matrix: Mxx Mxy Myx Myy",
"mask plus 4 elements of general 2D matrix: mask Mxx Mxy Myx Myy",
"6 elements of 3D symmetric matrix: Mxx Mxy Mxz Myy Myz Mzz",
"mask plus 6 elements of 3D symmetric matrix: mask Mxx Mxy Mxz Myy Myz Mzz",
"9 elements of general 3D matrix: Mxx Mxy Mxz Myx Myy Myz Mzx Mzy Mzz",
"mask plus 9 elements of general 3D matrix: mask Mxx Mxy Mxz Myx Myy Myz Mzx Mzy Mzz",
};
const char *
_nrrdKindStr_Eqv[] = {
"domain",
"space",
"time",
"list",
"point",
"vector", "contravariant-vector",
"covariant-vector",
"normal",
"stub",
"scalar",
"complex",
"2-vector",
"3-color",
"RGB-color", "RGBcolor", "RGB",
"HSV-color", "HSVcolor", "HSV",
"XYZ-color",
"4-color",
"RGBA-color", "RGBAcolor", "RGBA",
"3-vector",
"3-gradient",
"3-normal",
"4-vector",
"quaternion",
"2D-symmetric-matrix", "2D-sym-matrix",
"2D-symmetric-tensor", "2D-sym-tensor",
"2D-masked-symmetric-matrix", "2D-masked-sym-matrix",
"2D-masked-symmetric-tensor", "2D-masked-sym-tensor",
"2D-matrix",
"2D-tensor",
"2D-masked-matrix",
"2D-masked-tensor",
"3D-symmetric-matrix", "3D-sym-matrix",
"3D-symmetric-tensor", "3D-sym-tensor",
"3D-masked-symmetric-matrix", "3D-masked-sym-matrix",
"3D-masked-symmetric-tensor", "3D-masked-sym-tensor",
"3D-matrix",
"3D-tensor",
"3D-masked-matrix",
"3D-masked-tensor",
""
};
int
_nrrdKindVal_Eqv[] = {
nrrdKindDomain,
nrrdKindSpace,
nrrdKindTime,
nrrdKindList,
nrrdKindPoint,
nrrdKindVector, nrrdKindVector,
nrrdKindCovariantVector,
nrrdKindNormal,
nrrdKindStub,
nrrdKindScalar,
nrrdKindComplex,
nrrdKind2Vector,
nrrdKind3Color,
nrrdKindRGBColor, nrrdKindRGBColor, nrrdKindRGBColor,
nrrdKindHSVColor, nrrdKindHSVColor, nrrdKindHSVColor,
nrrdKindXYZColor,
nrrdKind4Color,
nrrdKindRGBAColor, nrrdKindRGBAColor, nrrdKindRGBAColor,
nrrdKind3Vector,
nrrdKind3Gradient,
nrrdKind3Normal,
nrrdKind4Vector,
nrrdKindQuaternion,
nrrdKind2DSymMatrix, nrrdKind2DSymMatrix,
nrrdKind2DSymMatrix, nrrdKind2DSymMatrix,
nrrdKind2DMaskedSymMatrix, nrrdKind2DMaskedSymMatrix,
nrrdKind2DMaskedSymMatrix, nrrdKind2DMaskedSymMatrix,
nrrdKind2DMatrix,
nrrdKind2DMatrix,
nrrdKind2DMaskedMatrix,
nrrdKind2DMaskedMatrix,
nrrdKind3DSymMatrix, nrrdKind3DSymMatrix,
nrrdKind3DSymMatrix, nrrdKind3DSymMatrix,
nrrdKind3DMaskedSymMatrix, nrrdKind3DMaskedSymMatrix,
nrrdKind3DMaskedSymMatrix, nrrdKind3DMaskedSymMatrix,
nrrdKind3DMatrix,
nrrdKind3DMatrix,
nrrdKind3DMaskedMatrix,
nrrdKind3DMaskedMatrix,
};
airEnum
_nrrdKind_enum = {
"kind",
NRRD_KIND_MAX,
_nrrdKindStr, NULL,
_nrrdKindDesc,
_nrrdKindStr_Eqv, _nrrdKindVal_Eqv,
AIR_FALSE
};
const airEnum *const
nrrdKind = &_nrrdKind_enum;
/* ------------------------ nrrdField ------------------------- */
const char *
_nrrdFieldStr[NRRD_FIELD_MAX+1] = {
"Ernesto \"Che\" Guevara",
"#",
"content",
"number",
"type",
"block size",
"dimension",
"space",
"space dimension",
"sizes",
"spacings",
"thicknesses",
"axis mins",
"axis maxs",
"space directions",
"centerings",
"kinds",
"labels",
"units",
"min",
"max",
"old min",
"old max",
"endian",
"encoding",
"line skip",
"byte skip",
"key/value",
"sample units",
"space units",
"space origin",
"measurement frame",
"data file",
};
const char *
_nrrdFieldDesc[NRRD_FIELD_MAX+1] = {
"unknown field identifier",
"comment",
"short description of whole array and/or its provenance",
"total number of samples in array",
"type of sample value",
"number of bytes in one block (for block-type)",
"number of axes in array",
"identifier for space in which array grid lies",
"dimension of space in which array grid lies",
"list of number of samples along each axis, aka \"dimensions\" of the array",
"list of sample spacings along each axis",
"list of sample thicknesses along each axis",
"list of minimum positions associated with each axis",
"list of maximum positions associated with each axis",
"list of direction inter-sample vectors for each axis",
"list of sample centerings for each axis",
"list of kinds for each axis",
"list of short descriptions for each axis",
"list of units in which each axes' spacing and thickness is measured",
"supposed minimum array value",
"supposed maximum array value",
"minimum array value prior to quantization",
"maximum array value prior to quantization",
"endiannes of data as written in file",
"encoding of data written in file",
"number of lines to skip prior to byte skip and reading data",
"number of bytes to skip after line skip and prior to reading data",
"string-based key/value pairs",
"units of measurement of (scalar) values inside array itself",
"list of units for measuring origin and direct vectors' coefficients",
"location in space of center of first (lowest memory address) sample",
"maps coords of (non-scalar) values to coords of surrounding space",
"with detached headers, where is data to be found",
};
const char *
_nrrdFieldStrEqv[] = {
"#",
"content",
"number",
"type",
"block size", "blocksize",
"dimension",
"space",
"space dimension", "spacedimension",
"sizes",
"spacings",
"thicknesses",
"axis mins", "axismins",
"axis maxs", "axismaxs",
"space directions", "spacedirections",
"centers", "centerings",
"kinds",
"labels",
"units",
"min",
"max",
"old min", "oldmin",
"old max", "oldmax",
"endian",
"encoding",
"line skip", "lineskip",
"byte skip", "byteskip",
/* nothing for keyvalue */
"sample units", "sampleunits",
"space units", "spaceunits",
"space origin", "spaceorigin",
"measurement frame", "measurementframe",
"data file", "datafile",
""
};
const int
_nrrdFieldValEqv[] = {
nrrdField_comment,
nrrdField_content,
nrrdField_number,
nrrdField_type,
nrrdField_block_size, nrrdField_block_size,
nrrdField_dimension,
nrrdField_space,
nrrdField_space_dimension, nrrdField_space_dimension,
nrrdField_sizes,
nrrdField_spacings,
nrrdField_thicknesses,
nrrdField_axis_mins, nrrdField_axis_mins,
nrrdField_axis_maxs, nrrdField_axis_maxs,
nrrdField_space_directions, nrrdField_space_directions,
nrrdField_centers, nrrdField_centers,
nrrdField_kinds,
nrrdField_labels,
nrrdField_units,
nrrdField_min,
nrrdField_max,
nrrdField_old_min, nrrdField_old_min,
nrrdField_old_max, nrrdField_old_max,
nrrdField_endian,
nrrdField_encoding,
nrrdField_line_skip, nrrdField_line_skip,
nrrdField_byte_skip, nrrdField_byte_skip,
/* nothing for keyvalue */
nrrdField_sample_units, nrrdField_sample_units,
nrrdField_space_units, nrrdField_space_units,
nrrdField_space_origin, nrrdField_space_origin,
nrrdField_measurement_frame, nrrdField_measurement_frame,
nrrdField_data_file, nrrdField_data_file,
};
airEnum
_nrrdField = {
"nrrd_field",
NRRD_FIELD_MAX,
_nrrdFieldStr, NULL,
_nrrdFieldDesc,
_nrrdFieldStrEqv, _nrrdFieldValEqv,
AIR_FALSE /* field identifiers not case sensitive */
};
const airEnum *const
nrrdField = &_nrrdField;
/* ------------------------ nrrdSpace ------------------------- */
/*
nrrdSpaceUnknown,
nrrdSpaceRightAnteriorSuperior, * 1: NIFTI-1 (right-handed) *
nrrdSpaceLeftAnteriorSuperior, * 2: standard Analyze (left-handed) *
nrrdSpaceLeftPosteriorSuperior, * 3: DICOM 3.0 (right-handed) *
nrrdSpaceRightAnteriorSuperiorTime, * 4: *
nrrdSpaceLeftAnteriorSuperiorTime, * 5: *
nrrdSpaceLeftPosteriorSuperiorTime, * 6: *
nrrdSpaceScannerXYZ, * 7: ACR/NEMA 2.0 (pre-DICOM 3.0) *
nrrdSpaceScannerXYZTime, * 8: *
nrrdSpace3DRightHanded, * 9: *
nrrdSpace3DLeftHanded, * 10: *
nrrdSpace3DRightHandedTime, * 11: *
nrrdSpace3DLeftHandedTime, * 12: *
nrrdSpaceLast
*/
const char *
_nrrdSpaceStr[NRRD_SPACE_MAX+1] = {
"(unknown_space)",
"right-anterior-superior",
"left-anterior-superior",
"left-posterior-superior",
"right-anterior-superior-time",
"left-anterior-superior-time",
"left-posterior-superior-time",
"scanner-xyz",
"scanner-xyz-time",
"3D-right-handed",
"3D-left-handed",
"3D-right-handed-time",
"3D-left-handed-time",
};
const char *
_nrrdSpaceDesc[NRRD_SPACE_MAX+1] = {
"unknown space",
"right-anterior-superior (used in NIFTI-1 and SPL's 3D Slicer)",
"left-anterior-superior (used in Analyze 7.5)",
"left-posterior-superior (used in DICOM 3)",
"right-anterior-superior-time",
"left-anterior-superior-time",
"left-posterior-superior-time",
"scanner-xyz (used in ACR/NEMA 2.0)",
"scanner-xyz-time",
"3D-right-handed",
"3D-left-handed",
"3D-right-handed-time",
"3D-left-handed-time",
};
const char *
_nrrdSpaceStrEqv[] = {
"(unknown_space)",
"right-anterior-superior", "right anterior superior",
"rightanteriorsuperior", "RAS",
"left-anterior-superior", "left anterior superior",
"leftanteriorsuperior", "LAS",
"left-posterior-superior", "left posterior superior",
"leftposteriorsuperior", "LPS",
"right-anterior-superior-time", "right anterior superior time",
"rightanteriorsuperiortime", "RAST",
"left-anterior-superior-time", "left anterior superior time",
"leftanteriorsuperiortime", "LAST",
"left-posterior-superior-time", "left posterior superior time",
"leftposteriorsuperiortime", "LPST",
"scanner-xyz",
"scanner-xyz-time", "scanner-xyzt",
"3D-right-handed", "3D right handed", "3Drighthanded"
"3D-left-handed", "3D left handed", "3Dlefthanded",
"3D-right-handed-time", "3D right handed time",
"3Drighthandedtime",
"3D-left-handed-time", "3D left handed time",
"3Dlefthandedtime",
""
};
const int
_nrrdSpaceValEqv[] = {
nrrdSpaceUnknown,
nrrdSpaceRightAnteriorSuperior, nrrdSpaceRightAnteriorSuperior,
nrrdSpaceRightAnteriorSuperior, nrrdSpaceRightAnteriorSuperior,
nrrdSpaceLeftAnteriorSuperior, nrrdSpaceLeftAnteriorSuperior,
nrrdSpaceLeftAnteriorSuperior, nrrdSpaceLeftAnteriorSuperior,
nrrdSpaceLeftPosteriorSuperior, nrrdSpaceLeftPosteriorSuperior,
nrrdSpaceLeftPosteriorSuperior, nrrdSpaceLeftPosteriorSuperior,
nrrdSpaceRightAnteriorSuperiorTime, nrrdSpaceRightAnteriorSuperiorTime,
nrrdSpaceRightAnteriorSuperiorTime, nrrdSpaceRightAnteriorSuperiorTime,
nrrdSpaceLeftAnteriorSuperiorTime, nrrdSpaceLeftAnteriorSuperiorTime,
nrrdSpaceLeftAnteriorSuperiorTime, nrrdSpaceLeftAnteriorSuperiorTime,
nrrdSpaceLeftPosteriorSuperiorTime, nrrdSpaceLeftPosteriorSuperiorTime,
nrrdSpaceLeftPosteriorSuperiorTime, nrrdSpaceLeftPosteriorSuperiorTime,
nrrdSpaceScannerXYZ,
nrrdSpaceScannerXYZTime, nrrdSpaceScannerXYZTime,
nrrdSpace3DRightHanded, nrrdSpace3DRightHanded, nrrdSpace3DRightHanded,
nrrdSpace3DLeftHanded, nrrdSpace3DLeftHanded, nrrdSpace3DLeftHanded,
nrrdSpace3DRightHandedTime, nrrdSpace3DRightHandedTime,
nrrdSpace3DRightHandedTime,
nrrdSpace3DLeftHandedTime, nrrdSpace3DLeftHandedTime,
nrrdSpace3DLeftHandedTime
};
airEnum
_nrrdSpace = {
"space",
NRRD_SPACE_MAX,
_nrrdSpaceStr, NULL,
_nrrdSpaceDesc,
_nrrdSpaceStrEqv, _nrrdSpaceValEqv,
AIR_FALSE
};
const airEnum *const
nrrdSpace = &_nrrdSpace;
/* ------------------------ nrrdSpacingStatus ------------------------- */
const char *
_nrrdSpacingStatusStr[NRRD_SPACING_STATUS_MAX+1] = {
"(unknown_status)",
"none",
"scalarNoSpace",
"scalarWithSpace",
"direction",
};
const char *
_nrrdSpacingStatusDesc[NRRD_BOUNDARY_MAX+1] = {
"unknown spacing status behavior",
"neither axis->spacing nor axis->spaceDirection set",
"axis->spacing set normally",
"axis->spacing set, with surround space (?)",
"axis->spaceDirection set normally",
};
airEnum
_nrrdSpacingStatus = {
"spacing status",
NRRD_SPACING_STATUS_MAX,
_nrrdSpacingStatusStr, NULL,
_nrrdSpacingStatusDesc,
NULL, NULL,
AIR_FALSE
};
const airEnum *const
nrrdSpacingStatus = &_nrrdSpacingStatus;
|