head 1.1; branch 1.1.1; access; symbols perseant-exfatfs-base-20261102:1.1.1.1 netbsd-11-1-RELEASE:1.1.1.1 netbsd-10-2-RELEASE:1.1.1.1 netbsd-11-0-RELEASE:1.1.1.1 netbsd-11-0-RC7:1.1.1.1 netbsd-11-0-RC6:1.1.1.1 netbsd-11-0-RC5:1.1.1.1 FILE5_48:1.1.1.1 netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.6 netbsd-11-base:1.1.1.1 netbsd-10-1-RELEASE:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.4 perseant-exfatfs-base:1.1.1.1 netbsd-10-0-RELEASE:1.1.1.1 netbsd-10-0-RC6:1.1.1.1 netbsd-10-0-RC5:1.1.1.1 netbsd-10-0-RC4:1.1.1.1 netbsd-10-0-RC3:1.1.1.1 netbsd-10-0-RC2:1.1.1.1 netbsd-10-0-RC1:1.1.1.1 FILE5_45:1.1.1.1 netbsd-10:1.1.1.1.0.2 netbsd-10-base:1.1.1.1 FILE5_43:1.1.1.1 CHRISTOS:1.1.1; locks; strict; comment @# @; 1.1 date 2022.09.24.20.07.54; author christos; state Exp; branches 1.1.1.1; next ; commitid Nf6F9kcpc0EPC9VD; 1.1.1.1 date 2022.09.24.20.07.54; author christos; state Exp; branches; next ; commitid Nf6F9kcpc0EPC9VD; desc @@ 1.1 log @Initial revision @ text @ #------------------------------------------------------------------------------ # $File: nifty,v 1.1 2022/02/14 16:51:15 christos Exp $ # file(1) magic for the NIfTI file format # Type: NIfTI, Neuroimaging file format # URL: https://nifti.nimh.nih.gov/ # From: Yann Leprince , 2022 344 string n+1\0 NIfTI-1 neuroimaging data, !:mime image/x.nifti !:ext nii >0 use nifti1 344 string ni1\0 NIfTI-1 neuroimaging data header, !:mime image/x.nifti !:ext hdr >0 use nifti1 4 string n+2\0\r\n\032\n NIfTI-2 neuroimaging data, !:mime image/x.nifti !:ext nii >0 use nifti2 4 string ni2\0\r\n\032\n NIfTI-2 neuroimaging data header, !:mime image/x.nifti !:ext hdr >0 use nifti2 # Main subroutine for NIfTI-1 0 name nifti1 >0 clear x >0 lelong =348 little endian >>70 use nifti-datatype-le >>112 lefloat !0 with scaling >>0 use nifti1-dim-le >>252 leshort >0 \b, with qform >>>252 use xform-code-nifti1-le >>254 leshort >0 \b, with sform >>>254 use xform-code-nifti1-le >>136 string >\0 \b, description: %s >0 belong =348 big endian >>70 use \^nifti-datatype-le >>112 befloat !0 with scaling >>0 use \^nifti1-dim-le >>252 beshort >0 \b, with qform >>>252 use \^xform-code-nifti1-le >>254 beshort >0 \b, with sform >>>254 use \^xform-code-nifti1-le >>136 string >\0 \b, description: %s >0 default x >>0 long x invalid sizeof_hdr=%d # Main subroutine for NIfTI-2 0 name nifti2 >0 clear x >0 lelong =540 little endian >>12 use nifti-datatype-le >>176 lefloat !0 with scaling >>0 use nifti2-dim-le >>344 lelong >0 \b, with qform >>>344 use xform-code-nifti2-le >>348 lelong >0 \b, with sform >>>348 use xform-code-nifti2-le >>240 string >\0 \b, description: %s >0 belong =540 big endian >>12 use \^nifti-datatype-le >>176 befloat !0 with scaling >>0 use \^nifti2-dim-le >>344 lelong >0 \b, with qform >>>344 use \^xform-code-nifti2-le >>348 lelong >0 \b, with sform >>>348 use \^xform-code-nifti2-le >>240 string >\0 \b, description: %s >0 default x >>0 long x invalid sizeof_hdr=%d # Other subroutines for details of NIfTI files 0 name nifti-datatype-le >0 clear x >0 leshort =1 \b, binary datatype >0 leshort =2 \b, uint8 datatype >0 leshort =4 \b, int16 datatype >0 leshort =8 \b, int32 datatype >0 leshort =16 \b, float32 datatype >0 leshort =32 \b, complex64 datatype >0 leshort =64 \b, float64 datatype >0 leshort =128 \b, RGB24 datatype >0 leshort =256 \b, int8 datatype >0 leshort =512 \b, uint16 datatype >0 leshort =768 \b, uint32 datatype >0 leshort =1024 \b, int64 datatype >0 leshort =1280 \b, uint64 datatype >0 leshort =1536 \b, float128 datatype >0 leshort =1792 \b, complex128 datatype >0 leshort =2048 \b, complex256 datatype >0 leshort =2304 \b, RGBA32 datatype >0 default x >>0 leshort x \b, unknown datatype 0x%x >>2 leshort x (%d bits/pixel) 0 name nifti1-dim-le >0 clear x >40 leshort <0 \b, INVALID dim[0]=%d >40 leshort >7 \b, INVALID dim[0]=%d >0 default x >>40 leshort x \b, %d-dimensional (size >>42 leshort x %d >>40 leshort >1 >>>44 leshort x \bx%d >>40 leshort >2 >>>46 leshort x \bx%d >>40 leshort >3 >>>48 leshort x \bx%d >>40 leshort >4 >>>50 leshort x \bx%d >>40 leshort >5 >>>52 leshort x \bx%d >>40 leshort >6 >>>54 leshort x \bx%d >>80 lefloat x \b, voxel size %f >>40 leshort >1 >>>84 lefloat x x %f >>40 leshort >2 >>>88 lefloat x x %f >>123 use nifti1-xyz-unit >>40 leshort >3 >>>92 lefloat x x %f >>>123 use nifti1-t-unit >>40 leshort x \b) 0 name nifti2-dim-le >0 clear x >16 lequad <0 \b, INVALID dim[0]=%lld >16 lequad >7 \b, INVALID dim[0]=%lld >0 default x >>16 lequad x \b, %lld-dimensional (size >>24 lequad x %lld >>16 lequad >1 >>>32 lequad x \bx%lld >>16 lequad >2 >>>40 lequad x \bx%lld >>16 lequad >3 >>>48 lequad x \bx%lld >>16 lequad >4 >>>56 lequad x \bx%lld >>16 lequad >5 >>>64 lequad x \bx%lld >>16 lequad >6 >>>72 lequad x \bx%lld, >>112 ledouble x \b, voxel size %f >>16 lequad >1 >>>120 ledouble x x %f >>16 lequad >2 >>>128 ledouble x x %f >>500 use nifti2-xyz-unit >>16 lequad >3 >>>136 ledouble x x %f >>>500 use nifti2-t-unit >>16 lequad x \b) 0 name xform-code-nifti1-le >0 leshort =1 to scanner-based coordinates >0 leshort =2 to aligned coordinates >0 leshort =3 to Talairach coordinates >0 leshort =4 to MNI152 coordinates >0 leshort =5 to template coordinates 0 name xform-code-nifti2-le >0 lelong =1 to scanner-based coordinates >0 lelong =2 to aligned coordinates >0 lelong =3 to Talairach coordinates >0 lelong =4 to MNI152 coordinates >0 lelong =5 to template coordinates 0 name nifti1-xyz-unit >0 byte &0x01 >>0 byte ^0x02 m >>0 byte &0x02 micron >0 byte ^0x01 >>0 byte &0x02 mm 0 name nifti1-t-unit >0 byte &0x08 >>0 byte ^0x10 s >>0 byte &0x10 ms >0 byte ^0x08 >>0 byte &0x10 microsecond 0 name nifti2-xyz-unit >0 lelong &0x01 >>0 lelong ^0x02 m >>0 lelong &0x02 micron >0 lelong ^0x01 >>0 lelong &0x02 mm 0 name nifti2-t-unit >0 lelong &0x08 >>0 lelong ^0x10 s >>0 lelong &0x10 ms >0 lelong ^0x08 >>0 lelong &0x10 microsecond @ 1.1.1.1 log @Import file-5.43+; last was file-5.40 2022-09-20 17:12 Christos Zoulas * fixed various clustefuzz issues 2022-09-19 15:54 Christos Zoulas * Fix error detection for decompression code (Vincent Mihalkovic) 2022-09-15 13:50 Christos Zoulas * Add MAGIC_NO_COMPRESS_FORK and use it to produce a more meaningful error message if we are sandboxing. 2022-09-15 10:45 Christos Zoulas * Add built-in lzip decompression support (Michal Gorny) 2022-09-14 10:35 Christos Zoulas * Add built-in zstd decompression support (Martin Rodriguez Reboredo) 2022-09-13 14:55 Christos Zoulas * release 5.43 2022-09-10 9:17 Christos Zoulas * Add octal indirect magic (Michal Gorny) 2022-08-17 11:43 Christos Zoulas * PR/374: avoid infinite loop in non-wide code (piru) * PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli) 2022-07-26 11:10 Christos Zoulas * Fix bug with large flist (Florian Weimer) 2022-07-07 13:21 Christos Zoulas * PR/364: Detect non-nul-terminated core filenames from QEMU (mam-ableton) 2022-07-04 15:45 Christos Zoulas * PR/359: Add support for http://ndjson.org/ (darose) * PR/362: Fix wide printing (ro-ee) * PR/358: Fix width for -f - (jpalus) * PR/356: Fix JSON constant parsing (davewhite) 2022-06-10 9:40 Christos Zoulas * release 5.42 2022-05-31 14:50 Christos Zoulas * PR/348: add missing cases to prevent file from aborting on random magic files. 2022-05-27 21:05 Christos Zoulas * PR/351: octalify filenames when not raw before printing. 2022-04-18 17:51 Christos Zoulas * fix regex cacheing bug (Dirk Mueller) * merge file_regcomp and file_regerror() to simplify the code and reduce memory requirements for storing regexes (Dirk Mueller) 2022-03-19 12:56 Christos Zoulas * cache regex (Dirk Mueller) * detect filesystem full by flushing output (Dirk Mueller) 2021-11-19 12:36 Christos Zoulas * implement running decompressor programs using posix_spawnp(2) instead of vfork(2) 2021-10-24 11:51 Christos Zoulas * Add support for msdos dates and times 2021-10-20 9:55 Christos Zoulas * use the system byte swapping functions if available (Werner Fink) 2021-10-18 11:57 Christos Zoulas * release 5.41 2021-09-23 03:51 Christos Zoulas * Avinash Sonawane: Fix tzname detection 2021-09-03 09:17 Christos Zoulas * Fix relationship tests with "search" magic, don't short circuit logic 2021-07-13 01:06 Christos Zoulas * Fix memory leak in compile mode 2021-07-01 03:51 Christos Zoulas * PR/272: kiefermat: Only set returnval = 1 when we printed something (in all cases print or !print). This simplifies the logic and fixes the issue in the PR with -k and --mime-type there was no continuation printed before the default case. 2021-06-30 13:07 Christos Zoulas * PR/270: Don't translate unprintable characters in %s magic formats when -r * PR/269: Avoid undefined behavior with clang (adding offset to NULL) 2021-05-09 18:38 Christos Zoulas * Add a new flag (f) that requires that the match is a full word, not a partial word match. * Add varint types (unused) 2021-04-19 17:17 Christos Zoulas * PR/256: mutableVoid: If the file is less than 3 bytes, use the file length to determine type * PR/259: aleksandr.v.novichkov: mime printing through indirect magic is not taken into account, use match directly so that it does. 2021-04-04 17:02 Christos Zoulas * count the total bytes found not the total byte positions in order to determine encoding (Anatol Belski) @ text @@