M-ANLZ(4)
β¨ NAME β¨
m-anlz β the Analyze (SPM) medical image format, analyzed for (X)MedCon. This page lives in the Kernel Interfaces Manual, bestie, and it's giving "actually kind of simple, don't panic" π
π¦ DESCRIPTION π¦
Okay so this format is a very simple one, no cap. The basic headers get written into one file with the extension .hdr, and the image data goes into a whole separate file with the extension .img. Two files, one vibe. π«Ά
Here are the basic defines for the format, verbatim, because I would never do you dirty like that:
typedef struct Header_Key_t{
Int32 sizeof_hdr; /* 348 or 148 */
char data_type[10]; /* "dsr" */
char db_name[18]; /* filename without extension */
Int32 extents; /* 16384 */
Int16 session_error;
char regular; /* 'r' */
char hkey_un0;
} MDC_ANLZ_HEADER_KEY;
#define MDC_ANLZ_HK_SIZE 40
typedef struct Image_Dimensions_t{
Int16 dim[8]; /* [0] = # of dimensions */
/* [1] = X-dim */
/* [2] = Y-dim */
/* [3] = Z-dim */
/* [4] = t-dim */
/* ... */
Int16 unused[7];
Int16 datatype; /* pixel type */
/* 0 = Unknown 1 = one-bit */
/* 2 = Uint8 4 = Int16 */
/* 8 = Int32 16 = float */
/* 32 = complex 64 = double */
/*128 = RGB 255 = all */
Int16 bitpix; /* bits per pixel */
Int16 dim_un0;
float pixdim[8]; /* [0] = # of dimensions */
/* [1] = X-dim (mm) */
/* [2] = Y-dim (mm) */
/* [3] = Z-dim (mm) */
/* [4] = t-dim (ms) */
/* ... */
float funused[6];
float compressed;
float verified;
Int32 glmax,glmin;
} MDC_ANLZ_IMAGE_DIMS;
#define MDC_ANLZ_IMD_SIZE 108
typedef struct Data_History_t{
char descrip[80];
char aux_file[24];
char orient; /* patient orientation */
/* 0 = transverse unflipped */
/* 1 = coronal unflipped */
/* 2 = sagittal unflipped */
/* 3 = transverse flipped */
/* 4 = coronal flipped */
/* 5 = sagittal flipped */
char originator[10];
char generated[10];
char scannum[10];
char patient_id[10];
char exp_date[10];
char exp_time[10];
char hist_un0[3];
Int32 views;
Int32 vols_added;
Int32 start_field;
Int32 field_skip;
Int32 omax, omin;
Int32 smax, smin;
} MDC_ANLZ_DATA_HIST;
#define MDC_ANLZ_DH_SIZE 200
The way that these structures are defined in the order as they should be found in the file β that part is important, don't shuffle them like a playlist. And heads up: the Data_History header is not obliged (it can just... not show up, and that's fine). Also, the SPM Analyze format β the one intended for the SPM software β differs a little from the normal Analyze format, so don't @ me if you're expecting vanilla.
π₯ What does this format support (and what does it absolutely not)
- Color Map β grayscale β β nothing else β
- File Endian β little & big β β nothing listed as unsupported β
- Pixeltypes β
1-bit,Uint8,Int16,Int32,float,double,(complex)β βInt8,Uint16,Uint32,Int64,Uint64β
- Scaling factors β quantify & calibrate factors/image are NOT supported. Periodt.
- Dimensions/Image β different dimensions for each image are NOT supported.
- Pixeltypes/Image β different pixeltypes for each image are NOT supported.
πΈ SPM remarks (iykyk)
imd.funused[0]= the offsetimd.funused[1]= one global scaling factor- The origin (X, Y, Z), read like this:
(Int16)dh.originator[0...1] \
(Int16)dh.originator[2...3] } = origin (X, Y, Z)
(Int16)dh.originator[4...5] /
π NOTES π
A note about the image (patient) orientation in SPM, because axes are lowkey the whole plot:
- X-axis β increases from leftside (hand) to rightside (hand).
- Y-axis β increases from posterior (back) to anterior (front).
- Z-axis β increases from inferior (feet) to superior (head).
Like, feet to head, back to front, left hand to right hand. Iconic. π
π FILES π
/usr/local/xmedcon/source/m-anlz.hβ The header file./usr/local/xmedcon/source/m-anlz.cβ The source file.
π SEE ALSO π
medcon(1), xmedcon(1), xmedcon-config(1)
m-acr(4), m-gif(4), m-inw(4), m-intf(4), m-ecat(4)
π AUTHOR π
The (X)MedCon project was originally written by Erik Nolf (eNlf) for the former PET-Centre at Ghent University (Belgium). Absolute legend behavior. π«Ά
e-mail: enlf-at-users.sourceforge.net www: http://xmedcon.sourceforge.net
And that's the whole page, bestie! β¨ This was M-ANLZ(4) from the Kernel Interfaces Manual β go forth and read those .hdr and .img files, you got this π
π
π¦ where this page comes from
- debian trixie: libmdc-dev 0.25.1-gtk3+dfsg-1 Β· GPL-2.0-or-later
- fedora 43: xmedcon-devel 0.25.3-1.fc43 Β· LGPL-2.1-or-later AND LicenseRef-Callaway-Copyright-only AND LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD and libtiff
- fedora 44: xmedcon-devel 0.25.3-2.fc44 Β· LGPL-2.1-or-later AND LicenseRef-Callaway-Copyright-only AND LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD and libtiff
- nixos 26.05: xmedcon 0.26.2
- nixpkgs unstable: xmedcon 0.26.2
- ubuntu questing: libmdc-dev 0.25.1-gtk3+dfsg-1
- ubuntu resolute: libmdc-dev 0.25.1-gtk3+dfsg-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: libmdc-dev 0.26.1-gtk3+dfsg-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms