1M-INTF(4)                  Kernel Interfaces Manual                  M-INTF(4)
2
3
4

NAME

6       m-intf - InterFile 3.3 medical image format (MedCon)
7

DESCRIPTION

9  The  file  consists  of  two parts, the administrative data in ASCII and the
10  binary image data. It is possible to put both in one file, but we prefer  to
11  separate  the  data  into  two files. The administrative data in a file with
12  extension `.h33' and the binary data in a file with extension `.i33'.
13
14  This is a wonderful feature! Because of the separate  header  in  ASCII  you
15  could write your own header for any raw image data you may have. I regularly
16  use InterFile for turning unsupported formats into a supported  format.  Try
17  to extract the raw image data from the unknown format and add an appropriate
18  header with all information you know about.
19
20  The basic defines for the format:
21
22  ---------------------------------------------------------------------------
23
24  #define MDC_INTF_MAXKEYCHARS 256
25
26  char keystr[MDC_INTF_MAXKEYCHARS];
27
28  /* the  data type */
29  #define MDC_INTF_STATIC      1
30  #define MDC_INTF_DYNAMIC     2
31  #define MDC_INTF_GATED       3
32  #define MDC_INTF_TOMOGRAPH   4
33  #define MDC_INTF_CURVE       5
34  #define MDC_INTF_ROI         6
35
36  /* the process status */
37  #define MDC_INTF_ACQUIRED      1
38  #define MDC_INTF_RECONSTRUCTED 2
39
40  /* gated spect nesting outer level */
41  #define MDC_INTF_NESTING_SPECT 1
42  #define MDC_INTF_NESTING_GATED 2
43
44  typedef struct MdcInterFile_t {
45
46    int data_type, process_status, pixel_type, gspect_nesting;
47    Uint32 width, height, images_per_dimension, time_slots;
48    Uint32 data_offset, data_blocks, imagesize, number_images;
49    Uint32 energy_windows, frame_groups, time_windows, detector_heads;
50    float pixel_xsize, pixel_ysize, slice_thickness, centre_centre_separation;
51    float study_duration, image_duration, image_pause, group_pause, ext_rot;
52    Int8 patient_rot, patient_orient, slice_orient;
53    double version;
54
55  } MDC_INTERFILE;
56
57  ---------------------------------------------------------------------------
58
59  What does the format support or not support:
60
61  ===========================================================================
62  Item            Supported                             Not Supported
63  ===========================================================================
64  Color Map     : grayscale                                  -
65  File Endian   : little or big                              -
66  Pixeltypes    : 1-bit, all intergers                       -
67                  float, double, ASCII
68  ===========================================================================
69  Scaling factors  : quantify & calibrate factors/image  are NOT supported,
70                     unless you define your own key-value pairs
71  ---------------------------------------------------------------------------
72  Dimensions/Image : different dimensions for each image are supported
73  ---------------------------------------------------------------------------
74  Pixeltypes/Image : different pixeltypes for each image are supported, but
75                     decoders are not required to be able to read.
76                     MedCon does support different pixeltypes per image.
77  ===========================================================================
78
79  Underneath you will find a description of the format.
80
81  1. ADMINISTRATIVE DATA
82     ===================
83
84       a)   The administrative data are only composed of key-value  pairs  and
85            exist in the form of ASCII text. The administrative data should be
86            terminated with a <Ctrl-Z).
87
88       b)   All administrative data are to be supplied in  the  form  of  key-
89            value  pairs  in  ASCII  with delimiters. A `key' is the name of a
90            parameter taking a specific `value', an example being:
91
92                     patient name := Elvis Presley <cr><lf>
93
94       c)   The maximum permitted number of characters for a key or a value or
95            a comment is 255 characters.
96
97       d)   Neither  keys  nor values are to be treated as case sensitive. The
98            characters <space> <tab> <underscore> <!> may all  be  treated  as
99            white space and ignored.
100
101       e)   All  relevant  keys should be included in the intermediate file. A
102            null value is permitted which will invoke the default where speci‐
103            fied. The required keys are preceded by an exclamation mark.
104
105       f)   A  hole line or key-value pairs may have comments appended to them
106            by preceding the comment with a semicolon <;>.
107
108       g)   A required key ("name of data file") is included to point  to  the
109            image  data  file,  even if the binary data is in the same file of
110            the administrative data.
111
112       h)   The two alternate keys ("data starting block") or ("data offset in
113            bytes")  are used to indicate the offset of the binary data in the
114            file as specified by the key ("name of  data  file").  The  ("data
115            starting  block")   represents  the  offset in number of blocks or
116            2048 bytes. The use of the key ("data offset  in  bytes")  permits
117            the offset to the binary data to be freely specified.
118
119  2. IMAGE DATA
120     ==========
121
122       a)   The order of the pixel data shall increment by column from left to
123            right, and then by row, from top to bottom.
124
125       b)   Image data shall be in either bit, signed or unsigned integer for‐
126            mat,  IEEE  floating point format (float or double) or ASCII. When
127            the data pixels are written in  ASCII,  the  text  line  must  not
128            exceed 255 characters.
129
130       c)   The  default  value for the key ("imagedata byte order") is BIGEN‐
131            DIAN,  but  LITTLEENDIAN  is  allowed.  The  byte  order  must  be
132            respected for integer and floating point numbers.
133
134       d)   Bit data will stored in a single byte, representing 8 pixel values
135            and ordered such that the most significant bit corresponds to  the
136            leftmost pixel.
137
138  3. LIST OF KEYS - VERSION 3.3    (Updated for Gated SPECT)
139     ==========================
140
141  !INTERFILE  := <NULL>
142  ;to indicate that this is an Interfile file
143
144  !imaging modality := <ASCII> nucmed
145  ;only nucmed is defined for the purpose of this document
146
147  !originating system := <ASCII>
148  ;eg.GAMMA-11, MDS, ADAC, etc.
149
150  !version of keys := <Numeric> 3.3
151  ;future versions shall increment
152
153  date of keys := <DateFormat> 1996:09:26
154  ;date of version 3.3 in date format
155
156  conversion program := <ASCII>
157  ;name of program used
158
159  program author := <ASCII>
160  ;your chance of fame and fortune
161
162  program version := <Numeric>
163  ;to keep track of conversion programs
164
165  program date := <DateFormat>
166  ;date of program
167
168  !GENERAL DATA := <NULL>
169  ;required but can be treated as comment
170
171  original institution := <ASCII>
172  ;name of hospital etc.
173
174  contact person := <ASCII>
175  ;another chance of fame (and fortune?)
176
177  data description := <ASCII>
178  ;whatever you want
179
180  !data starting block := <Numeric> 0
181  ;the value is the offset in blocks of 2048 bytes in either the
182  ;administrative or the data file depending on the key value for
183  ;name of data file (see below)
184  |      ;OR
185  !data offset in bytes:= <Numeric> 0
186  ;as above but the offset may be specified freely in bytes
187
188  !name of data file := <ASCII> <NULL>
189  ;<NULL> if no image data exists
190  ;key is a name of the file where the data are present, either when
191  ;in a separate binary data file, or when in a combined
192  ;administrative/binary data file
193
194  patient name := <ASCII>
195  ;last name, first name (recommended)
196
197  !patient ID := <ASCII>
198  ;as used in your hospital
199
200  patient dob := <DateFormat>
201  ;date of birth
202
203  patient sex := <ASCIIlist> Unknown M|F|Unknown
204  ;default is Unknown!
205
206  !study ID := <ASCII>
207  ;as local conditions dictate
208
209  exam type := <ASCII>
210  ;description of procedure as above
211
212  data compression := <ASCII> none
213  ;name of algorithm if present- e.g. JPEG, etc.
214
215  data encode := <ASCII> none
216  ;name of method of encoding if present- e.g. uuencode etc.
217
218  organ := <ASCII> none
219  ;ENLF: for mapping with DICOM tag (0018,0015) BodyPartExamined
220
221  isotope := <ASCII> | <ASCII>/<ASCII> none
222  ;ENLF: for mapping with DICOM radionuclide/radiopharmaceutical entries.
223
224  dose := <Numeric> 0
225  ;ENLF: for mapping with DICOM tag (0018,1074) RadionuclideTotalDose [MBq]
226
227  !GENERAL IMAGE DATA := <NULL>
228  ;again required but treated as comment
229
230  !type of data := <ASCIIlist>  Other
231     Static|Dynamic|Gated|Tomographic|Curve|ROI|GSPECT|Other
232  ;important - this key is used for many conditionals
233
234  !total number of images := <Numeric>
235  ;how many images are there altogether in total in the associated
236  ;data file (for all windows etc.). This overrides any other way of
237  ;calculating the total number of images.
238
239  study date := <DateFormat>
240  ;date of the first image included in the data file
241
242  study time := <TimeFormat>
243  ;time for the start of first image specified
244
245  imagedata byte order := <ASCIIlist> BIGENDIAN
246          BIGENDIAN|LITTLEENDIAN
247  ;BIGENDIAN is the default if unspecified
248
249  process label := <ASCII> none
250  ;ENLF: for mapping with DICOM tag (0008,103E) SeriesDescription
251
252  quantification units := +1.696265e-05
253  ;ENLF: global scale factor for mediman dialect
254
255  NUD/rescale slope := +1.696265e-05
256  ;ENLF: global scale factor for NUD systems
257
258  NUD/rescale intercept := +0.000000e+00
259  ;ENLF: global scale intercept for NUD systems
260
261  number of energy windows := <Numeric> 1
262  ;defaulted to one if unspecified
263
264  for ( number of energy windows, energy window)
265  {
266        energy window[<energy window>] := <ASCII>
267        ;ASCII text- for example "Tc99m"
268        ;this starts as "energy window [1]" and then increments to
269        ;energy window[2]:= <ASCII>
270        ;and then on to
271        ;energy window[3]:= <ASCII>
272        ;etc. etc.
273
274        energy window lower level [<energy window>] := <Numeric>
275        ;value of lower energy level in keV for the corresponding window
276        ;starts off as "energy window lower level [1]"
277        ;and continues [2],[3] .. as above
278
279        energy window upper level [<energy window>] := <Numeric>
280        ;value of upper energy level in keV for the corresponding window
281        ;starts off as "energy window upper level [1]"
282        ;and continues [2],[3] .. as above
283
284
285        flood corrected := <ASCIIlist> Y Y|N
286        ;corrected if unspecified
287
288        decay corrected := <ASCIIlist> N Y|N
289        ;not corrected if unspecified
290
291        if( type of data = "Static"|"ROI")
292        {
293        !STATIC STUDY (General) := <NULL>
294        ;label to indicate that this is the static definition
295
296        number of images/energy window := <Numeric> 1
297        ;number of images in THIS energy window
298
299        for ( number of images/energy window )
300        {
301              !Static Study (each frame) := <NULL>
302              ;included at the beginning of the definition of
303              ;each new static frame
304
305              !image number := <Numeric>
306              ;starting from 1 [see above]
307              ;- must be specified!!
308              ;starts from 1 and increments though all
309              ;windows to its maximum value which equals the
310              ;total number of images in the file!!
311
312              !matrix size [1] :=< Numeric>
313              ;matrix size across (number of columns)- previously x
314              ;32, 64, 128 etc. but not necessarily powers of 2
315
316              !matrix size [2] := <Numeric>
317              ;matrix size down (number of rows)- previously y
318              ;32, 64, 128 etc. but not necessarily powers of 2
319
320              !number format := <ASCIIlist> unsigned integer
321                  signed integer|unsigned integer
322                  |long float|short float|bit|ASCII
323              ;as specified
324
325              !number of bytes per pixel := <Numeric>
326              ;e.g. 1|2|4.. [this key ignored for bit data]
327
328              scaling factor (mm/pixel) [1]:= <Numeric>
329              ;size of pixel across- previously x
330
331              scaling factor (mm/pixel) [2] := <Numeric>
332              ;size of pixel down- previously y
333
334              image duration (sec) := <Numeric>
335              ;eg. 120.0  i.e. normally a float, for each image
336
337              image start time := <TimeFormat>
338              ;time for each image
339
340              label := <ASCII>
341              ;eg Anterior
342
343              maximum pixel count := <Numeric>
344              ;for scaling purposes, for each image
345
346              total counts := <Numeric>
347              ;either an integer or a float, for each image
348
349              }
350              ;End of frame loop -Repeat for each subsequent frame
351          }
352          ;End of static definitions
353
354
355          if( type of data = "Dynamic")
356          {
357              !DYNAMIC STUDY (general) := <NULL>
358              ;label to indicate that this is a dynamic study
359
360              !number of frame groups := <Numeric> 1
361              ;defaults to 1
362
363              for( number of frame groups, frame group number)
364              {
365                    !Dynamic Study (each frame group) := <NULL>
366                    ;Repeated for each group of frames as
367
368                    ;indication of  the start of the
369                    ;definition of the new group
370
371                    !frame group number := <Numeric>
372                    ;numbering starts from 1 (must be specified)
373
374
375                    !matrix size [1] := <Numeric>
376                    ;matrix size across (number of columns)
377                    ;-previously matrix size x
378                    ;32, 64, 128 etc. but not necessarily powers of 2
379
380                    !matrix size [2] := <Numeric>
381                    ;matrix size down (number of rows)- previously y
382                    ;32, 64, 128 etc. but not necessarily powers of 2
383
384                    !number format := <ASCIIlist> unsigned integer
385                       signed integer|unsigned integer|
386                       long float|short float|bit|ASCII
387                    ;as specified
388
389                    !number of bytes per pixel := <Numeric>
390                    ;e.g. 1|2|4.. [this key ignored for bit data]
391
392                    scaling factor (mm/pixel) [1]:= <Numeric>
393                    ;size of pixel across- previously x
394
395                    scaling factor (mm/pixel) [2] := <Numeric>
396                    ;size of pixel down- previously y
397
398                    !number of images this frame group := <Numeric>
399                    ;for each frame group
400                    ;(for each energy window)
401
402                    !image duration (sec) := <Numeric>
403                    ;eg 0.2, for each frame group
404                    ;(for each energy window)
405
406                    pause between images (sec) := <Numeric> 0.0
407                    ;eg 0.0, default is 0.0
408
409                    pause between frame groups (sec) := <Numeric> 0.0
410                    ;eg 5.0 default 0.0, time between last
411                    ;frame group (or start of study) and this frame group
412
413                    !maximum pixel count in group := <Numeric>
414                    ;eg 1234 (for scaling purposes)
415                    ;maximum pixel for all frames in this
416                    ;group and this window!!
417
418              }
419              ;Repeat for each subsequent frame group
420          }
421
422          ; End of dynamic definitions
423
424
425          if( type of data = "Gated")
426          {
427          !GATED STUDY (general) := <NULL>
428          ;again a flag to indicate a gated study
429
430          !matrix size [1] := <Numeric>
431          ;matrix size across (number of columns)- previously x
432          ;32, 64, 128 etc. but not necessarily powers of 2
433
434          !matrix size [2] := <Numeric>
435          ;matrix size down (number of rows)- previously y
436          ;32, 64, 128 etc. but not necessarily powers of 2
437
438          !number format := <ASCIIlist> unsigned integer
439             signed integer|unsigned integer|
440             long float|short float|bit|ASCII
441          ;as specified
442
443          !number of bytes per pixel := <Numeric>
444          ;e.g. 1|2|4|..> [this key ignored for bit data]
445
446          scaling factor (mm/pixel) [1]:= <Numeric>
447          ;size of pixel across- previously x
448
449          scaling factor (mm/pixel) [2] := <Numeric>
450          ;size of pixel down- previously y
451
452          study duration (elapsed) sec := <Numeric>
453          ;eg 300, total elapsed time for whole study
454
455          number of cardiac cycles (observed) := <Numeric>
456          ;total number of cycles if known, for this
457          ;energy window
458
459          number of time windows := <Numeric> 1
460          ;defaults to 1 if unspecified- number of different
461          ;sets of time intervals
462
463          for ( number of time windows, time window number)
464          {
465              !Gated Study (each time window) := <NULL>
466
467              !time window number := <Numeric>
468              ;starting from 1
469
470              !number of images in time window := <Numeric>
471              ;eg 24
472
473              !image duration (sec) := <Numeric>
474              ;eg 0.04  for each frame in THIS time window
475
476              framing method := <ASCIIlist> Forward
477                      Forward|Backward|Mixed|Other
478              ;default is forward
479
480              time window lower limit (sec) := <Numeric>
481              ;float normally expected, for THIS time window
482
483              time window upper limit (sec) := <Numeric>
484              ;float normally expected
485
486              % R-R cycles acquired this window := <Numeric>
487              ;if known
488
489              number of cardiac cycles (acquired) := <Numeric>
490              ;eg 356 , if known
491
492              study duration (acquired) sec := <Numeric>
493              ;total  acquisition time duration for
494              ;this window only (if it can be computed!!) as
495              ;opposed to total acquisition time (when different)
496
497              !maximum pixel count := <Numeric>
498              ;for scaling purposes for all images in this
499              ;time window (and energy window) only
500
501              R-R histogram := <ASCIIlist> N Y|N
502              ;flag to indicate that one exists!!
503
504              }
505              ;Repeat for each subsequent time window.
506
507          }
508          ;end of gated definitions
509
510
511          if( type of data = "Tomographic")
512          {
513
514          !SPECT STUDY (general) := <NULL>
515          ;flag to indicate tomographic data with no effect as such
516
517          number of detector heads := <Numeric> 1
518          ;default=1 if unspecified
519
520          for ( number of detector heads )
521          {
522
523              !number of images/energy window := <Numeric>
524              ;total number of images (for all heads) for
525              ;THIS energy window!!
526
527              !process status := Reconstructed Acquired|Reconstructed
528              ;used below in conditional- MUST be defined
529
530              !matrix size [1] := <Numeric>
531              ;matrix size across (number of columns)- previously x
532              ;32, 64, 128 etc. but not necessarily powers of 2
533
534              !matrix size [2] := <Numeric>
535              ;matrix size down (number of rows)- previously y
536              ;32, 64, 128 etc. but not necessarily powers of 2
537
538              !number format := <ASCIIlist> unsigned integer
539                 signed integer|unsigned integer|
540                 long float|short float|bit|ASCII
541              ;as specified
542
543              !number of bytes per pixel := <Numeric>
544              ;e.g. 1|2|4|.. [this key ignored for bit data]
545
546              scaling factor (mm/pixel) [1]:= <Numeric>
547              ;size of pixel across- previously x
548
549              scaling factor (mm/pixel) [2] := <Numeric>
550              ;size of pixel down- previously y
551
552              !number of projections := <Numeric>
553              ;for example- 64
554              ;note this is the actual number of images per
555              ;head per energy window if
556              ;the data are acquired, but NOT if the data are
557              ;reconstructed where the number of images is
558              ;specified separately as number of slices
559
560              !extent of rotation := <Numeric>
561              ;e.g 180, 360
562
563              !time per projection (sec) := <Numeric>
564              ;important for Acquired data
565
566              study duration (sec) := <Numeric>
567              ;eg 1280.0, for acquired data should be equal
568              ;to the product of number of projections and
569              ;time per projection, but could be different!!
570
571              !maximum pixel count := <Numeric>
572              ;for scaling- in THIS image series( this head
573              ;and this energy window)
574
575              patient orientation := <ASCIIlist> head_in
576                   head_in|feet_in|other
577
578              patient rotation :=  <ASCIIlist> supine
579                   prone|supine|other
580
581              if( process status = "acquired")
582              {
583                 !SPECT STUDY (acquired data):= <NULL>
584
585                 !direction of rotation := <ASCIIlist> CW CW|CCW
586                 ;CW = clockwise, CCW = counter clockwise
587
588                 start angle := <Numeric>
589                 ;0 is top-dead-centre, in degrees
590                 ;in orientation as specified above
591
592                 first projection angle in data set := <Numeric>
593                 ;in degrees expressed with respect to
594                 ;anterior-  angles in direction as
595                 ;specified CW or CCW
596
597                 acquisition mode := <ASCIIlist> stepped
598                 stepped|continuous
599
600                 Centre_of_rotation :=  <ASCIIlist> Corrected
601                 Corrected|Single_value|For_every_angle
602                 ;default is "Corrected"
603                 ;"Corrected" corresponds to a null centre of rotation
604                 ;correction, as previous required by Interfile, that
605                 ;is, no centre of rotation information is to be
606                 ;passed. The key "Single value" indicates the
607                 ;conventional definition of the centre of rotation
608                 ;offset to be a single value specified for all angles,
609                 ;specified for each head given a multiple head
610                 ;acquisition.
611                 ;The key "For_every_angle" indicates that the centre
612                 ;of rotation offset will be  specified for each head
613                 ;and every angle. This is not currently implemented in
614                 ;this Interfile definition, but will be introduced in
615                 ;V4.
616                 ;The mathematical centre of rotation is assumed to be
617                 ;in the exact middle of the projection for example at
618                 ;x= 32.5 y=32.5 for a 64x64 image where the count
619                 ;starts from 1. Note that the choice of coordinates
620                 ;does not matter, the only constraint being the
621                 ;assumption that all projections have a length which
622                 ;is an even number of pixels. The centre of rotation
623                 ;is specified as the offset from that position to the
624                 ;perpendicular dropped from a point on the axis of
625                 ;rotation onto the head.
626
627             if( Centre_of_rotation = "Single_value" )
628             {
629
630                 !X_offset := <Numeric>
631                 ;x offset for all angles in mm.
632                 ;x_offset is the x offset between the perpendicular
633                 ;dropped from the centre of rotation and the dead
634                 ;centre of the matrix,
635                 ;The positive direction for the offset is considered
636                 ;to be that of the increasing projection index, e.g.
637                 ;for a projection with pixels of size 6mm, which
638                 ;should be centred at 32.5, an offset of +6mm
639                 ;indicates that the centre of rotation is at 33.5
640                 ;Note that since offset is specified in mm, the pixel
641                 ;size must be known.
642
643
644                 Y_offset := <Numeric>
645                 ;y offset for all angles in mm
646                 ;y_offset is the y offset between that perpendicular
647                 ;dropped from the centre of rotation from that point
648                 ;on the axis of rotation where the y_offset is
649                 ;considered to be zero, and the centre of the camera's
650                 ;field of view. Thus y_offset is the RELATIVE shift of
651                 ;the y-axis with respect to some arbitrary position,
652                 ;normally that from the centre of the filed of view of
653                 ;the first at the top dead centre position. Thus for
654                 ;a single head, this value would normally be expected
655                 ;to be equal to zero.
656
657                 Radius := <Numeric>
658                 ;radial distance to centre of rotation in mm,
659                 ;for this head.
660
661
662                 }
663                 ;end of centre of rotation specification
664
665                 orbit := <ASCIIlist> Circular Circular|non-circular
666
667                 preprocessed := <ASCII>
668                 ;preprocessing method
669
670              }
671              ; end of process status acquired
672
673              if( process status = "reconstructed")
674              {
675                 !SPECT STUDY (reconstructed data) := <NULL>
676
677                 method of reconstruction := <ASCII>
678
679                 !number of slices := <Numeric>
680                 ;i.e. number of images in this set for this
681                 ;head and this energy window
682
683                 number of reference frame := <Numeric> 0
684                 ;if unspecified the frame number
685                 ;originally used for defining slice positions
686                 ;0=default [Note- not a very useful key]
687
688                 slice orientation := <ASCIIlist> Transverse
689                     Transverse|Coronal|Sagittal|Other
690                 ;default is transverse if unspecified
691
692                 slice thickness (pixels) := <Numeric> 1
693                 ;if unspecified 1=default
694
695                 centre-centre slice separation (pixels):=<Numeric> 1
696                 ;e.g.1,2,3,4...  as distinct from slice thickness
697                 ;the word centre can also be spelt as center
698
699                 filter name :=  <ASCII>
700                 ;e.g. Hann, Hamming, Butterworth
701
702                 filter parameters := <ASCII>
703                 ;Nyquist freq etc.
704
705                 z-axis filter := <ASCII>
706                 ;method [1,2,1] etc.
707
708                 attenuation correction coefficient/cm := <Numeric> 0.0
709                 ;default 0 means not done if unspecified
710
711                 method of attenuation correction :=  <ASCII>  none
712
713                 scatter corrected := <ASCIIlist> N Y|N
714
715                 method of scatter correction := <ASCII> none
716
717                 oblique reconstruction := <ASCIIlist> N Y|N
718
719                 oblique orientation := <ASCII>
720                 ;free text [Note ACR-NEMA convention preferred]
721              }
722              ;end of reconstructed tomo
723         }
724        ;End of tomo
725
726
727  *      if( type of data = "GSPECT")
728         {
729  *      !GATED SPECT STUDY (general) := <NULL>
730         ;again a flag to indicate a gated SPECT study
731         ;MIXTURE OF GATED & TOMO
732
733         !matrix size [1] := <Numeric>
734         ;matrix size across (number of columns)- previously x
735         ;32, 64, 128 etc. but not necessarily powers of 2
736
737         !matrix size [2] := <Numeric>
738         ;matrix size down (number of rows)- previously y
739         ;32, 64, 128 etc. but not necessarily powers of 2
740
741         !number format := <ASCIIlist> unsigned integer
742          signed integer|unsigned integer|
743          long float|short float|bit|ASCII
744         ;as specified
745
746         !number of bytes per pixel := <Numeric>
747         ;e.g. 1|2|4|..> [this key ignored for bit data]
748
749         !Gated SPECT nesting outer level := SPECT|Gated  Gated
750         ; key to indictae order of images, if SPECT is outer level
751         ; order is, for every angle give each gated image, if
752         ; gated is outer level, then order is, for every gated
753         ; time value, vie set of tomographic images
754
755         scaling factor (mm/pixel) [1]:= <Numeric>
756         ;size of pixel across- previously x
757
758         scaling factor (mm/pixel) [2] := <Numeric>
759         ;size of pixel down- previously y
760
761         study duration (elapsed) sec := <Numeric>
762         ;eg 300, total elapsed time for whole study
763
764         number of cardiac cycles (observed) := <Numeric>
765         ;total number of cycles if known, for this
766         ;energy window
767
768         number of time windows := <Numeric> 1
769         ;defaults to 1 if unspecified- number of different
770         ;sets of time intervals
771
772         for ( number of time windows, time window number)
773         {
774              !Gated Study (each time window) := <NULL>
775
776              !time window number := <Numeric>
777              ;starting from 1
778
779  *           !number of images in time window := <Numeric>
780              ;eg 24 NOTE that here in gated SPECT is means images/angle
781
782              !image duration (sec) := <Numeric>
783              ;eg 0.04  for each frame in THIS time window
784
785              framing method := <ASCIIlist> Forward
786                      Forward|Backward|Mixed|Other
787              ;default is forward
788
789              time window lower limit (sec) := <Numeric>
790              ;float normally expected, for THIS time window
791
792              time window upper limit (sec) := <Numeric>
793              ;float normally expected
794
795              % R-R cycles acquired this window := <Numeric>
796              ;if known
797
798              number of cardiac cycles (acquired) := <Numeric>
799              ;eg 356 , if known
800
801              study duration (acquired) sec := <Numeric>
802              ;total  acquisition time duration for
803              ;this window only (if it can be computed!!) as
804              ;opposed to total acquisition time (when different)
805
806              !maximum pixel count := <Numeric>
807              ;for scaling purposes for all images in this
808              ;time window (and energy window) only
809
810              R-R histogram := <ASCIIlist> N Y|N
811              ;flag to indicate that one exists!!
812
813          }
814          ;Repeat for each subsequent time window.
815
816
817       ;start of tomographic keys
818
819          number of detector heads := <Numeric> 1
820          ;default=1 if unspecified
821
822          for ( number of detector heads )
823          {
824
825              !number of images/energy window := <Numeric>
826              ;total number of images (for all heads) for
827              ;THIS energy window!!
828
829              !process status := Reconstructed Acquired|Reconstructed
830              ;used below in conditional- MUST be defined
831
832              !number of projections := <Numeric>
833              ;for example- 64
834              ;note this is the actual number of images per
835              ;head per energy window if
836              ;the data are acquired, but NOT if the data are
837              ;reconstructed where the number of images is
838              ;specified separately as number of slices
839
840              !extent of rotation := <Numeric>
841              ;e.g 180, 360
842
843              !time per projection (sec) := <Numeric>
844              ;important for Acquired data
845              patient orientation := <ASCIIlist> head_in
846                     head_in|feet_in|other
847
848              patient rotation :=  <ASCIIlist> supine
849                     prone|supine|other
850
851              if( process status = "acquired")
852              {
853                 !SPECT STUDY (acquired data):= <NULL>
854
855                 !direction of rotation := <ASCIIlist> CW CW|CCW
856                 ;CW = clockwise, CCW = counter clockwise
857
858                 start angle := <Numeric>
859                 ;0 is top-dead-centre, in degrees
860                 ;in orientation as specified above
861
862                 first projection angle in data set := <Numeric>
863                 ;in degrees expressed with respect to
864                 ;anterior-  angles in direction as
865                 ;specified CW or CCW
866
867                 acquisition mode := <ASCIIlist> stepped
868                      stepped|continuous
869
870                Centre_of_rotation :=  <ASCIIlist> Corrected
871                     Corrected|Single_value|For_every_angle
872                ;default is "Corrected"
873                ;"Corrected" corresponds to a null centre of rotation
874                ;correction, as previous required by Interfile, that
875                ;is, no centre of rotation information is to be
876                ;passed. The key "Single value" indicates the
877                ;conventional definition of the centre of rotation
878                ;offset to be a single value specified for all angles,
879                ;specified for each head given a multiple head
880                ;acquisition.
881                ;The key "For_every_angle" indicates that the centre
882                ;of rotation offset will be  specified for each head
883                ;and every angle. This is not currently implemented in
884                ;this Interfile definition, but will be introduced in
885                ;V4.
886                ;The mathematical centre of rotation is assumed to be
887                ;in the exact middle of the projection for example at
888                ;x= 32.5 y=32.5 for a 64x64 image where the count
889                ;starts from 1. Note that the choice of coordinates
890                ;does not matter, the only constraint being the
891                ;assumption that all projections have a length which
892                ;is an even number of pixels. The centre of rotation
893                ;is specified as the offset from that position to the
894                ;perpendicular dropped from a point on the axis of
895                ;rotation onto the head.
896
897                if( Centre_of_rotation = "Single_value" )
898                {
899
900                 !X_offset := <Numeric>
901                 ;x offset for all angles in mm.
902                ;x_offset is the x offset between the perpendicular
903                ;dropped from the centre of rotation and the dead
904                ;centre of the matrix,
905                ;The positive direction for the offset is considered
906                ;to be that of the increasing projection index, e.g.
907                ;for a projection with pixels of size 6mm, which
908                ;should be centred at 32.5, an offset of +6mm
909                ;indicates that the centre of rotation is at 33.5
910                ;Note that since offset is specified in mm, the pixel
911                ;size must be known.
912
913
914                 Y_offset := <Numeric>
915                 ;y offset for all angles in mm
916                ;y_offset is the y offset between that perpendicular
917                ;dropped from the centre of rotation from that point
918                ;on the axis of rotation where the y_offset is
919                ;considered to be zero, and the centre of the camera's
920                ;field of view. Thus y_offset is the RELATIVE shift of
921                ;the y-axis with respect to some arbitrary position,
922                ;normally that from the centre of the filed of view of
923                ;the first at the top dead centre position. Thus for
924                ;a single head, this value would normally be expected
925                ;to be equal to zero.
926
927                 Radius := <Numeric>
928                 ;radial distance to centre of rotation in mm,
929                ;for this head.
930
931
932                 }
933                ;end of centre of rotation specification
934
935                 orbit := <ASCIIlist> Circular Circular|non-circular
936
937                 preprocessed := <ASCII>
938                 ;preprocessing method
939              }
940              ; end of process status acquired
941
942              if( process status = "reconstructed")
943              {
944                 !SPECT STUDY (reconstructed data) := <NULL>
945
946                 method of reconstruction := <ASCII>
947
948                 !number of slices := <Numeric>
949                 ;i.e. number of images in this set for this
950                 ;head and this energy window
951
952                 number of reference frame := <Numeric> 0
953                 ;if unspecified the frame number
954                 ;originally used for defining slice positions
955                 ;0=default [Note- not a very useful key]
956
957                 slice orientation := <ASCIIlist> Transverse
958                     Transverse|Coronal|Sagittal|Other
959                 ;default is transverse if unspecified
960
961                 slice thickness (pixels) := <Numeric> 1
962                 ;if unspecified 1=default
963
964                 centre-centre slice separation (pixels):=<Numeric> 1
965                 ;e.g.1,2,3,4...  as distinct from slice thickness
966                 ;the word centre can also be spelt as center
967
968                 filter name :=  <ASCII>
969                 ;e.g. Hann, Hamming, Butterworth
970
971                 filter parameters := <ASCII>
972                 ;Nyquist freq etc.
973
974                 z-axis filter := <ASCII>
975                 ;method [1,2,1] etc.
976
977                 attenuation correction coefficient/cm := <Numeric> 0.0
978                 ;default 0 means not done if unspecified
979
980                 method of attenuation correction :=  <ASCII>  none
981
982                 scatter corrected := <ASCIIlist> N Y|N
983
984                 method of scatter correction := <ASCII> none
985
986                 oblique reconstruction := <ASCIIlist> N Y|N
987
988                 oblique orientation := <ASCII>
989                 ;free text [Note ACR-NEMA convention preferred]
990              }
991              ;end of reconstructed tomo
992         }
993        ;End of GATED SPECT
994
995  }
996  ;end of loop for energy windows
997
998  if( type of data = "Curve")
999        {
1000         !CURVE DATA := <NULL>
1001         ;label to indicate that this is the curve definition
1002         ;curves should always be kept in separate data files
1003         ;and not together with the administrative data
1004
1005         Curve_dimensions := <Numeric> 2
1006         ;how many dimensions- ONLY 2 is permitted in V3.3.
1007         ;Even if a single vector of values is required
1008         ;both matrix size[1] and [2] must be defined
1009         ;although one of them should take the value 1.
1010         ;A set of x,y values is 2 dimensional with normally
1011         ;matrix size[1] or matrix size[2] equal to 2.
1012         ;and the other matrix size specifying
1013         ;the number of PAIRS of values present (see Fig 1).
1014         ;Matrix sizes greater than 2 for BOTH dimensions are not
1015         ;recommended.
1016
1017         !matrix size[1] := <Numeric>
1018         ;matrix size across (number of columns)
1019
1020         !matrix size[2] := <Numeric>
1021         ;matrix size down (number of rows)
1022
1023         !number format := <ASCIIlist> unsigned integer
1024             signed integer|unsigned integer|
1025             long float|short float|bit|ASCII
1026
1027         !number of bytes per pixel := <Numeric>
1028         ;e.g. 1|2|4|.. [this key ignored for bit data]
1029
1030         Type_of_curve :=  <ASCII>
1031         ;what kind of curve is it, for example time activity curve
1032         ;ROI indicates that this is a list
1033         ;of vectors corresponding to an ROI.
1034
1035         for( Curve_dimensions, dimension)
1036         {
1037
1038            ;When matrix size[1] or matrix size[2] equals 2 (the normal
1039            ;case) such that the data comprise pairs of values,
1040            ;then Label[1],  Units[1] etc. refers to the set of first
1041            ;values for each pair, and Label[2] etc. refers the set of
1042            ;second values for each pair.
1043
1044            Label[<dimension>] :=  <ASCII>
1045            ;a text label for the corresponding axis  e.g. "counts"
1046
1047            Units[<dimension>] := <ASCII>
1048            ;units of measurement for the corresponding axis
1049            ;e.g. "units[1]:=counts/sec"
1050
1051            Min[<dimension>] := <Numeric>
1052            ;Minimum of set of values as indicated in units as defined,
1053            ;optional
1054
1055            Max[<dimension>] := <Numeric>
1056            ;Maximum value as above, optional
1057
1058        }
1059       ;End of loop for curve dimensions
1060
1061  }
1062  !END OF INTERFILE := <NULL>
1063

FILES

1065  /usr/local/xmedcon/source/m-intf.h      The header file.
1066  /usr/local/xmedcon/source/m-intf.c      The source file.
1067

SEE ALSO

1069  medcon(1), xmedcon(1), xmedcon-config(1)
1070
1071  m-acr(4), m-anlz(4), m-gif(5), m-inw(4), m-ecat(4)
1072
1073  medcon(3)
1074

AUTHOR

1076  (X)MedCon  project was originally written by Erik Nolf (eNlf) for the former
1077  PET-Centre at Ghent University (Belgium).
1078
1079  e-mail:   enlf-at-users.sourceforge.net   www:   http://xmedcon.sourceforge.net
1080
1081
1082
1083
1084                                                                     M-INTF(4)
Impressum