M-INW(4)

πŸ“¦
version 0.26.1-gtk3 Β· 2 versions
, in debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

m-inw β€” the RUG INW1.0 medical image format, but make it work for (X)MedCon. She's a Kernel Interfaces Manual girlie (section 4, iykyk) πŸŽ€


🌸 DESCRIPTION 🌸

okay so first things first bestie: this is a local file format used at the RUG (Ghent, Belgium). The headers and the image data get written into one single file, and that file has the extension .im. one file, everything in it, no scattered chaos. periodt. πŸ’…

Here are the basic defines for the format, take notes:

typedef struct Head_start_t {

        Int32 mark;           /* should be HEADER_MARK                */
        Int16 version;        /* high*256 + low                       */
        Int16 size_header;    /* whole header (in bytes)              */
        Int16 size_start;     /* sizeof(Head_start_t)                 */
        Int16 size_gen;       /* sizeof(Head_gen_t)                   */
        Int16 size_spec;      /* sizeof(Head_spec_t)                  */
        char  reserved[10];

} MDC_INW_HEAD_START;         /* current size: 24                     */

#define MDC_INW_HEAD_START_SIZE 24

next up, the general header β€” she's the big one, 72 bytes of main character energy πŸ‘‘

typedef struct Head_gen_t {

        Int16 no;             /* number of planes                     */
        Int16 sizeX;          /* number of columns                    */
        Int16 sizeY;          /* number of rows                       */
        Int16 pixel_type;     /* sizeof(pixel)                        */
                              /* for compatibility only 2 is allowed  */
        Int16 init_trans;     /* initial translation (mm)             */
        Int16 dummy1;         /* for alignment reasons only           */

        /* Note: We take the positive axis into the gantry !
                 This means, if the patient lies with his head into
                 the gantry, the head has higher translation offset
                 than his feet                                        */

        char  day[12];        /* day of first scan eg. 04-AUG-89      */
        Int32 time;           /* seconds after midnight               */
                              /* first scan or time activity measured */
        float decay_cst;      /* NOT half_life ! (discards log(2))    */
                              /* decay_cst = half_life / log(2)       */
        float pixel_size;     /* sampling distance (mm)               */
        float max;            /* scaled maximum of all images         */
        float min;
        Int16 scanner;        /* EcatII, EcatIV                       */
        char  reconstruction; /* reconFBP, reconMaxLik,...            */
        char  recon_version;  /* reconstruction version (0-99)        */
        char  reserved[24];

} MDC_INW_HEAD_GEN;           /* current size: 72                     */

#define MDC_INW_HEAD_GEN_SIZE 72

and finally the per-image spec header, the little one that carries the receipts ✨

typedef struct Head_spec_t {

        Int32 time;           /* time relative to gen.time (secs)     */
        float cal_cst;        /* abs_activ(uCU/ml) = cal_cst*pix_val  */
                              /* cal_cst = calibr_cst * decay_comp    */
                              /* decay_comp = exp(time/decay_cst)     */
        Int32 max;            /* maximum in plane                     */
        Int32 min;            /* minimum in plane                     */
        Int16 trans;          /* translation relative to gen.trans mm */
        char  reserved[6];

} MDC_INW_HEAD_SPEC;          /* current size: 24                     */

#define MDC_INW_HEAD_SPEC_SIZE 24

πŸ¦‹ what does the format support (and what does it absolutely NOT support) πŸ¦‹

vibe check time:

  • Color Map β€” supported: grayscale. not supported: -. (so… nothing else is banned here, she's fine 🌈)
  • File Endian β€” supported: little. not supported: big πŸ’€
  • Pixeltypes β€” supported: Int16. not supported: -

and the fine print, because there's always fine print:

  • Scaling factors β€” quantify or calibrate factors/image are supported ✨
  • Dimensions/Image β€” different dimensions for each image are NOT supported 🚫
  • Pixeltypes/Image β€” different pixeltypes for each image are NOT supported 🚫

πŸ“ NOTES πŸ“

The first two structures hanging out in the file are HEAD_START and HEAD_GEN. After those data structures come a bunch of HEAD_SPEC structures β€” as many as there are images in the file, one per image, matching set 🫢

⚠️ the float values in the headers are stored as VAX floats! yes, really. not a drill. 😭

After the headers comes the binary image data. The images are stored left to right and top to bottom. The pixel values are Int16, little endian. she's consistent, we love that πŸ’œ


πŸ“ FILES πŸ“

  • /usr/local/xmedcon/source/m-inw.h β€” The header file.
  • /usr/local/xmedcon/source/m-inw.c β€” The source file.

πŸ‘‘ SEE ALSO πŸ‘‘

medcon(1), xmedcon(1), xmedcon-config(1)

m-acr(4), m-anlz(4), m-gif(4), m-intf(4), m-ecat(4)

medcon(3)

go read those too bestie, the whole cinematic universe is connected 🌈


πŸŽ€ AUTHOR πŸŽ€

The (X)MedCon project was originally written by Erik Nolf (eNlf) for the former PET-Centre at Ghent University (Belgium). iconic behavior, no cap πŸ’–


and that's the page!! filed under M-INW(4) in the Kernel Interfaces Manual β€” no extra version or date to report, that's just how she's catalogued. go off, format. πŸ’…βœ¨

πŸ“¦ where this page comes from