File: m-intf.4

package info (click to toggle)
xmedcon 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,928 kB
  • ctags: 5,004
  • sloc: ansic: 47,536; sh: 13,052; makefile: 383
file content (1089 lines) | stat: -rw-r--r-- 38,899 bytes parent folder | download | duplicates (3)
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
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
'\" t
.TH M-INTF 4
.SH NAME
m-intf - InterFile 3.3 medical image format (MedCon)
.SH DESCRIPTION
.PP
.in 0.2i
The file consists of two parts, the administrative data in ASCII and the binary image data. It is possible to put both in one file, but we prefer to separate the data into two files. The administrative data in a file with extension `.h33' and the binary data in a file with extension `.i33'.
.PP
.in 0.2i
This is a wonderful feature! Because of the separate header in ASCII you could write your own header for any raw image data you may have. I regularly use InterFile for turning unsupported formats into a supported format. Try to extract the raw image data from the unknown format and add an appropriate header with all information you know about.
.PP
.in 0.2i
The basic defines for the format:
.PP
.in 0.2i
.nf
---------------------------------------------------------------------------

#define MDC_INTF_MAXKEYCHARS 256

char keystr[MDC_INTF_MAXKEYCHARS];

/* the  data type */
#define MDC_INTF_STATIC      1
#define MDC_INTF_DYNAMIC     2
#define MDC_INTF_GATED       3
#define MDC_INTF_TOMOGRAPH   4
#define MDC_INTF_CURVE       5
#define MDC_INTF_ROI         6

/* the process status */
#define MDC_INTF_ACQUIRED      1
#define MDC_INTF_RECONSTRUCTED 2

/* gated spect nesting outer level */
#define MDC_INTF_NESTING_SPECT 1
#define MDC_INTF_NESTING_GATED 2

typedef struct MdcInterFile_t {

  int data_type, process_status, pixel_type, gspect_nesting;
  Uint32 width, height, images_per_dimension, time_slots;
  Uint32 data_offset, data_blocks, imagesize, number_images;
  Uint32 energy_windows, frame_groups, time_windows, detector_heads;
  float pixel_xsize, pixel_ysize, slice_thickness, centre_centre_separation;
  float study_duration, image_duration, image_pause, group_pause, ext_rot;
  Int8 patient_rot, patient_orient, slice_orient;
  double version;

} MDC_INTERFILE;

---------------------------------------------------------------------------
.fi
.PP
.in 0.2i
What does the format support or not support:
.PP
.in 0.2i
.nf
===========================================================================
Item            Supported                             Not Supported
===========================================================================
Color Map     : grayscale                                  -
File Endian   : little or big                              -
Pixeltypes    : 1-bit, all intergers                       -
                float, double, ASCII
===========================================================================
Scaling factors  : quantify & calibrate factors/image  are NOT supported,
                   unless you define your own key-value pairs
---------------------------------------------------------------------------
Dimensions/Image : different dimensions for each image are supported
---------------------------------------------------------------------------
Pixeltypes/Image : different pixeltypes for each image are supported, but
                   decoders are not required to be able to read.
                   MedCon does support different pixeltypes per image.
===========================================================================
.fi
.PP
.in 0.2i
Underneath you will find a description of the format.
.PP
.in 0.2i
1. ADMINISTRATIVE DATA
.br
   ===================
.PP
.in 0.2i
.IP a) 5
The administrative data are only composed of key-value pairs and exist in the form of ASCII text. The administrative data should be terminated with a <Ctrl-Z).
.IP b) 5
All administrative data are to be supplied in the form of key-value pairs in ASCII with delimiters. A `key' is the name of a parameter taking a specific `value', an example being:
.PP
.in 0.2i
.ce 1
patient name := Elvis Presley <cr><lf>
.IP c) 5
The maximum permitted number of characters for a key or a value or a comment is 255 characters.
.IP d) 5
Neither keys nor values are to be treated as case sensitive. The characters <space> <tab> <underscore> <!> may all be treated as white space and ignored.
.IP e) 5
All relevant keys should be included in the intermediate file. A null value is permitted which will invoke the default where specified. The required keys are preceded by an exclamation mark.
.IP f) 5
A hole line or key-value pairs may have comments appended to them by preceding the comment with a semicolon <;>.
.IP g) 5
A required key ("name of data file") is included to point to the image data file, even if the binary data is in the same file of the administrative data.
.IP h) 5
The two alternate keys ("data starting block") or ("data offset in bytes") are used to indicate the offset of the binary data in the file as specified by the key ("name of data file"). The ("data starting block")  represents the offset in number of blocks or 2048 bytes. The use of the key ("data offset in bytes") permits the offset to the binary data to be freely specified.
.PP
.in 0.2i
2. IMAGE DATA
.br
   ==========
.PP
.in 0.2i
.IP a) 5
The order of the pixel data shall increment by column from left to right, and then by row, from top to bottom.
.IP b) 5
Image data shall be in either bit, signed or unsigned integer format, IEEE floating point format (float or double) or ASCII. When the data pixels are written in ASCII, the text line must not exceed 255 characters.
.IP c) 5
The default value for the key ("imagedata byte order") is BIGENDIAN, but LITTLEENDIAN is allowed. The byte order must be respected for integer and floating point numbers.
.IP d) 5
Bit data will stored in a single byte, representing 8 pixel values and ordered such that the most significant bit corresponds to the leftmost pixel.
.PP
.in 0.2i
3. LIST OF KEYS - VERSION 3.3    (Updated for Gated SPECT)
.br
   ==========================
.PP
.in 0.2i
.nf
!INTERFILE  := <NULL>
;to indicate that this is an Interfile file

!imaging modality := <ASCII> nucmed
;only nucmed is defined for the purpose of this document

!originating system := <ASCII>
;eg.GAMMA-11, MDS, ADAC, etc.

!version of keys := <Numeric> 3.3
;future versions shall increment

date of keys := <DateFormat> 1996:09:26
;date of version 3.3 in date format

conversion program := <ASCII>
;name of program used

program author := <ASCII>
;your chance of fame and fortune

program version := <Numeric>
;to keep track of conversion programs

program date := <DateFormat>
;date of program

!GENERAL DATA := <NULL>
;required but can be treated as comment

original institution := <ASCII>
;name of hospital etc.

contact person := <ASCII>
;another chance of fame (and fortune?)

data description := <ASCII>
;whatever you want

!data starting block := <Numeric> 0
;the value is the offset in blocks of 2048 bytes in either the
;administrative or the data file depending on the key value for
;name of data file (see below)
|      ;OR
!data offset in bytes:= <Numeric> 0
;as above but the offset may be specified freely in bytes

!name of data file := <ASCII> <NULL>
;<NULL> if no image data exists
;key is a name of the file where the data are present, either when
;in a separate binary data file, or when in a combined
;administrative/binary data file

patient name := <ASCII>
;last name, first name (recommended)

!patient ID := <ASCII>
;as used in your hospital

patient dob := <DateFormat>
;date of birth

patient sex := <ASCIIlist> Unknown M|F|Unknown
;default is Unknown!

!study ID := <ASCII>
;as local conditions dictate

exam type := <ASCII>
;description of procedure as above

data compression := <ASCII> none
;name of algorithm if present- e.g. JPEG, etc.

data encode := <ASCII> none
;name of method of encoding if present- e.g. uuencode etc.

organ := <ASCII> none
;ENLF: for mapping with DICOM tag (0018,0015) BodyPartExamined

isotope := <ASCII> | <ASCII>/<ASCII> none
;ENLF: for mapping with DICOM radionuclide/radiopharmaceutical entries.

dose := <Numeric> 0
;ENLF: for mapping with DICOM tag (0018,1074) RadionuclideTotalDose [MBq]

!GENERAL IMAGE DATA := <NULL>
;again required but treated as comment

!type of data := <ASCIIlist>  Other
   Static|Dynamic|Gated|Tomographic|Curve|ROI|GSPECT|Other
;important - this key is used for many conditionals

!total number of images := <Numeric>
;how many images are there altogether in total in the associated 
;data file (for all windows etc.). This overrides any other way of
;calculating the total number of images.

study date := <DateFormat>
;date of the first image included in the data file

study time := <TimeFormat>
;time for the start of first image specified

imagedata byte order := <ASCIIlist> BIGENDIAN
        BIGENDIAN|LITTLEENDIAN
;BIGENDIAN is the default if unspecified

process label := <ASCII> none
;ENLF: for mapping with DICOM tag (0008,103E) SeriesDescription

quantification units := +1.696265e-05
;ENLF: global scale factor for mediman dialect

NUD/rescale slope := +1.696265e-05
;ENLF: global scale factor for NUD systems

NUD/rescale intercept := +0.000000e+00
;ENLF: global scale intercept for NUD systems

number of energy windows := <Numeric> 1
;defaulted to one if unspecified

for ( number of energy windows, energy window)
{
      energy window[<energy window>] := <ASCII>
      ;ASCII text- for example "Tc99m"
      ;this starts as "energy window [1]" and then increments to
      ;energy window[2]:= <ASCII>
      ;and then on to
      ;energy window[3]:= <ASCII>
      ;etc. etc.

      energy window lower level [<energy window>] := <Numeric>
      ;value of lower energy level in keV for the corresponding window
      ;starts off as "energy window lower level [1]"
      ;and continues [2],[3] .. as above

      energy window upper level [<energy window>] := <Numeric>
      ;value of upper energy level in keV for the corresponding window
      ;starts off as "energy window upper level [1]"
      ;and continues [2],[3] .. as above


      flood corrected := <ASCIIlist> Y Y|N
      ;corrected if unspecified

      decay corrected := <ASCIIlist> N Y|N
      ;not corrected if unspecified

      if( type of data = "Static"|"ROI")
      {
      !STATIC STUDY (General) := <NULL>
      ;label to indicate that this is the static definition

      number of images/energy window := <Numeric> 1
      ;number of images in THIS energy window

      for ( number of images/energy window )
      {
            !Static Study (each frame) := <NULL>
            ;included at the beginning of the definition of
            ;each new static frame

            !image number := <Numeric>
            ;starting from 1 [see above]
            ;- must be specified!!
            ;starts from 1 and increments though all
            ;windows to its maximum value which equals the
            ;total number of images in the file!!

            !matrix size [1] :=< Numeric>
            ;matrix size across (number of columns)- previously x
            ;32, 64, 128 etc. but not necessarily powers of 2

            !matrix size [2] := <Numeric>
            ;matrix size down (number of rows)- previously y
            ;32, 64, 128 etc. but not necessarily powers of 2

            !number format := <ASCIIlist> unsigned integer
                signed integer|unsigned integer
                |long float|short float|bit|ASCII
            ;as specified

            !number of bytes per pixel := <Numeric>
            ;e.g. 1|2|4.. [this key ignored for bit data]

            scaling factor (mm/pixel) [1]:= <Numeric>
            ;size of pixel across- previously x

            scaling factor (mm/pixel) [2] := <Numeric>
            ;size of pixel down- previously y

            image duration (sec) := <Numeric>
            ;eg. 120.0  i.e. normally a float, for each image

            image start time := <TimeFormat>
            ;time for each image

            label := <ASCII>
            ;eg Anterior

            maximum pixel count := <Numeric>
            ;for scaling purposes, for each image

            total counts := <Numeric>
            ;either an integer or a float, for each image

            }
            ;End of frame loop - Repeat for each subsequent frame
        }
        ;End of static definitions


        if( type of data = "Dynamic")
        {
            !DYNAMIC STUDY (general) := <NULL>
            ;label to indicate that this is a dynamic study

            !number of frame groups := <Numeric> 1
            ;defaults to 1

            for( number of frame groups, frame group number)
            {
                  !Dynamic Study (each frame group) := <NULL>
                  ;Repeated for each group of frames as

                  ;indication of  the start of the
                  ;definition of the new group

                  !frame group number := <Numeric>
                  ;numbering starts from 1 (must be specified)


                  !matrix size [1] := <Numeric>
                  ;matrix size across (number of columns)
                  ;-previously matrix size x
                  ;32, 64, 128 etc. but not necessarily powers of 2

                  !matrix size [2] := <Numeric>
                  ;matrix size down (number of rows)- previously y
                  ;32, 64, 128 etc. but not necessarily powers of 2

                  !number format := <ASCIIlist> unsigned integer
                     signed integer|unsigned integer|
                     long float|short float|bit|ASCII
                  ;as specified

                  !number of bytes per pixel := <Numeric>
                  ;e.g. 1|2|4.. [this key ignored for bit data]

                  scaling factor (mm/pixel) [1]:= <Numeric>
                  ;size of pixel across- previously x

                  scaling factor (mm/pixel) [2] := <Numeric>
                  ;size of pixel down- previously y

                  !number of images this frame group := <Numeric>
                  ;for each frame group
                  ;(for each energy window)

                  !image duration (sec) := <Numeric>
                  ;eg 0.2, for each frame group
                  ;(for each energy window)

                  pause between images (sec) := <Numeric> 0.0
                  ;eg 0.0, default is 0.0

                  pause between frame groups (sec) := <Numeric> 0.0
                  ;eg 5.0 default 0.0, time between last
                  ;frame group (or start of study) and this frame group

                  !maximum pixel count in group := <Numeric>
                  ;eg 1234 (for scaling purposes)
                  ;maximum pixel for all frames in this
                  ;group and this window!!

            }
            ;Repeat for each subsequent frame group
        }

        ; End of dynamic definitions


        if( type of data = "Gated")
        {
        !GATED STUDY (general) := <NULL>
        ;again a flag to indicate a gated study

        !matrix size [1] := <Numeric>
        ;matrix size across (number of columns)- previously x
        ;32, 64, 128 etc. but not necessarily powers of 2

        !matrix size [2] := <Numeric>
        ;matrix size down (number of rows)- previously y
        ;32, 64, 128 etc. but not necessarily powers of 2

        !number format := <ASCIIlist> unsigned integer
           signed integer|unsigned integer|
           long float|short float|bit|ASCII
        ;as specified

        !number of bytes per pixel := <Numeric>
        ;e.g. 1|2|4|..> [this key ignored for bit data]

        scaling factor (mm/pixel) [1]:= <Numeric>
        ;size of pixel across- previously x

        scaling factor (mm/pixel) [2] := <Numeric>
        ;size of pixel down- previously y

        study duration (elapsed) sec := <Numeric>
        ;eg 300, total elapsed time for whole study

        number of cardiac cycles (observed) := <Numeric>
        ;total number of cycles if known, for this
        ;energy window

        number of time windows := <Numeric> 1
        ;defaults to 1 if unspecified- number of different
        ;sets of time intervals

        for ( number of time windows, time window number)
        {
            !Gated Study (each time window) := <NULL>

            !time window number := <Numeric>
            ;starting from 1

            !number of images in time window := <Numeric>
            ;eg 24

            !image duration (sec) := <Numeric>
            ;eg 0.04  for each frame in THIS time window

            framing method := <ASCIIlist> Forward
                    Forward|Backward|Mixed|Other
            ;default is forward

            time window lower limit (sec) := <Numeric>
            ;float normally expected, for THIS time window

            time window upper limit (sec) := <Numeric>
            ;float normally expected

            % R-R cycles acquired this window := <Numeric>
            ;if known

            number of cardiac cycles (acquired) := <Numeric>
            ;eg 356 , if known

            study duration (acquired) sec := <Numeric>
            ;total  acquisition time duration for
            ;this window only (if it can be computed!!) as
            ;opposed to total acquisition time (when different)

            !maximum pixel count := <Numeric>
            ;for scaling purposes for all images in this
            ;time window (and energy window) only

            R-R histogram := <ASCIIlist> N Y|N
            ;flag to indicate that one exists!!

            }
            ;Repeat for each subsequent time window.

        }
        ;end of gated definitions


        if( type of data = "Tomographic")
        {

        !SPECT STUDY (general) := <NULL>
        ;flag to indicate tomographic data with no effect as such

        number of detector heads := <Numeric> 1
        ;default=1 if unspecified

        for ( number of detector heads )
        {

            !number of images/energy window := <Numeric>
            ;total number of images (for all heads) for
            ;THIS energy window!!

            !process status := Reconstructed Acquired|Reconstructed
            ;used below in conditional- MUST be defined

            !matrix size [1] := <Numeric>
            ;matrix size across (number of columns)- previously x
            ;32, 64, 128 etc. but not necessarily powers of 2

            !matrix size [2] := <Numeric>
            ;matrix size down (number of rows)- previously y
            ;32, 64, 128 etc. but not necessarily powers of 2

            !number format := <ASCIIlist> unsigned integer
               signed integer|unsigned integer|
               long float|short float|bit|ASCII
            ;as specified

            !number of bytes per pixel := <Numeric>
            ;e.g. 1|2|4|.. [this key ignored for bit data]

            scaling factor (mm/pixel) [1]:= <Numeric>
            ;size of pixel across- previously x

            scaling factor (mm/pixel) [2] := <Numeric>
            ;size of pixel down- previously y

            !number of projections := <Numeric>
            ;for example- 64
            ;note this is the actual number of images per
            ;head per energy window if
            ;the data are acquired, but NOT if the data are
            ;reconstructed where the number of images is
            ;specified separately as number of slices

            !extent of rotation := <Numeric>
            ;e.g 180, 360

            !time per projection (sec) := <Numeric>
            ;important for Acquired data

            study duration (sec) := <Numeric>
            ;eg 1280.0, for acquired data should be equal
            ;to the product of number of projections and
            ;time per projection, but could be different!!

            !maximum pixel count := <Numeric>
            ;for scaling- in THIS image series( this head
            ;and this energy window)

            patient orientation := <ASCIIlist> head_in
                 head_in|feet_in|other

            patient rotation :=  <ASCIIlist> supine
                 prone|supine|other

            if( process status = "acquired")
            {
               !SPECT STUDY (acquired data):= <NULL>

               !direction of rotation := <ASCIIlist> CW CW|CCW
               ;CW = clockwise, CCW = counter clockwise

               start angle := <Numeric>
               ;0 is top-dead-centre, in degrees
               ;in orientation as specified above

               first projection angle in data set := <Numeric>
               ;in degrees expressed with respect to
               ;anterior-  angles in direction as
               ;specified CW or CCW

               acquisition mode := <ASCIIlist> stepped
               stepped|continuous

               Centre_of_rotation :=  <ASCIIlist> Corrected
               Corrected|Single_value|For_every_angle
               ;default is "Corrected"
               ;"Corrected" corresponds to a null centre of rotation
               ;correction, as previous required by Interfile, that
               ;is, no centre of rotation information is to be
               ;passed. The key "Single value" indicates the
               ;conventional definition of the centre of rotation
               ;offset to be a single value specified for all angles,
               ;specified for each head given a multiple head
               ;acquisition.
               ;The key "For_every_angle" indicates that the centre
               ;of rotation offset will be  specified for each head
               ;and every angle. This is not currently implemented in
               ;this Interfile definition, but will be introduced in
               ;V4.
               ;The mathematical centre of rotation is assumed to be
               ;in the exact middle of the projection for example at
               ;x= 32.5 y=32.5 for a 64x64 image where the count
               ;starts from 1. Note that the choice of coordinates
               ;does not matter, the only constraint being the
               ;assumption that all projections have a length which
               ;is an even number of pixels. The centre of rotation
               ;is specified as the offset from that position to the
               ;perpendicular dropped from a point on the axis of
               ;rotation onto the head.

           if( Centre_of_rotation = "Single_value" )
           {

               !X_offset := <Numeric>
               ;x offset for all angles in mm.
               ;x_offset is the x offset between the perpendicular
               ;dropped from the centre of rotation and the dead
               ;centre of the matrix,
               ;The positive direction for the offset is considered
               ;to be that of the increasing projection index, e.g.
               ;for a projection with pixels of size 6mm, which
               ;should be centred at 32.5, an offset of +6mm
               ;indicates that the centre of rotation is at 33.5
               ;Note that since offset is specified in mm, the pixel
               ;size must be known.


               Y_offset := <Numeric>
               ;y offset for all angles in mm
               ;y_offset is the y offset between that perpendicular
               ;dropped from the centre of rotation from that point
               ;on the axis of rotation where the y_offset is
               ;considered to be zero, and the centre of the camera's
               ;field of view. Thus y_offset is the RELATIVE shift of
               ;the y-axis with respect to some arbitrary position,
               ;normally that from the centre of the filed of view of
               ;the first at the top dead centre position. Thus for
               ;a single head, this value would normally be expected
               ;to be equal to zero.

               Radius := <Numeric>
               ;radial distance to centre of rotation in mm,
               ;for this head.


               }
               ;end of centre of rotation specification

               orbit := <ASCIIlist> Circular Circular|non-circular

               preprocessed := <ASCII>
               ;preprocessing method

            }
            ; end of process status acquired

            if( process status = "reconstructed")
            {
               !SPECT STUDY (reconstructed data) := <NULL>

               method of reconstruction := <ASCII>

               !number of slices := <Numeric>
               ;i.e. number of images in this set for this
               ;head and this energy window

               number of reference frame := <Numeric> 0
               ;if unspecified the frame number
               ;originally used for defining slice positions
               ;0=default [Note- not a very useful key]

               slice orientation := <ASCIIlist> Transverse
                   Transverse|Coronal|Sagittal|Other
               ;default is transverse if unspecified

               slice thickness (pixels) := <Numeric> 1
               ;if unspecified 1=default

               centre-centre slice separation (pixels):=<Numeric> 1
               ;e.g.1,2,3,4...  as distinct from slice thickness
               ;the word centre can also be spelt as center

               filter name :=  <ASCII>
               ;e.g. Hann, Hamming, Butterworth

               filter parameters := <ASCII>
               ;Nyquist freq etc.

               z-axis filter := <ASCII>
               ;method [1,2,1] etc.

               attenuation correction coefficient/cm := <Numeric> 0.0
               ;default 0 means not done if unspecified

               method of attenuation correction :=  <ASCII>  none

               scatter corrected := <ASCIIlist> N Y|N

               method of scatter correction := <ASCII> none

               oblique reconstruction := <ASCIIlist> N Y|N

               oblique orientation := <ASCII>
               ;free text [Note ACR-NEMA convention preferred]
            }
            ;end of reconstructed tomo
       }
      ;End of tomo


*      if( type of data = "GSPECT")
       {
*      !GATED SPECT STUDY (general) := <NULL>
       ;again a flag to indicate a gated SPECT study
       ;MIXTURE OF GATED & TOMO

       !matrix size [1] := <Numeric>
       ;matrix size across (number of columns)- previously x
       ;32, 64, 128 etc. but not necessarily powers of 2

       !matrix size [2] := <Numeric>
       ;matrix size down (number of rows)- previously y
       ;32, 64, 128 etc. but not necessarily powers of 2

       !number format := <ASCIIlist> unsigned integer
        signed integer|unsigned integer|
        long float|short float|bit|ASCII
       ;as specified

       !number of bytes per pixel := <Numeric>
       ;e.g. 1|2|4|..> [this key ignored for bit data]

       !Gated SPECT nesting outer level := SPECT|Gated  Gated
       ; key to indictae order of images, if SPECT is outer level
       ; order is, for every angle give each gated image, if
       ; gated is outer level, then order is, for every gated
       ; time value, vie set of tomographic images

       scaling factor (mm/pixel) [1]:= <Numeric>
       ;size of pixel across- previously x

       scaling factor (mm/pixel) [2] := <Numeric>
       ;size of pixel down- previously y

       study duration (elapsed) sec := <Numeric>
       ;eg 300, total elapsed time for whole study

       number of cardiac cycles (observed) := <Numeric>
       ;total number of cycles if known, for this
       ;energy window

       number of time windows := <Numeric> 1
       ;defaults to 1 if unspecified- number of different
       ;sets of time intervals

       for ( number of time windows, time window number)
       {
            !Gated Study (each time window) := <NULL>

            !time window number := <Numeric>
            ;starting from 1

*           !number of images in time window := <Numeric>
            ;eg 24 NOTE that here in gated SPECT is means images/angle

            !image duration (sec) := <Numeric>
            ;eg 0.04  for each frame in THIS time window

            framing method := <ASCIIlist> Forward
                    Forward|Backward|Mixed|Other
            ;default is forward

            time window lower limit (sec) := <Numeric>
            ;float normally expected, for THIS time window

            time window upper limit (sec) := <Numeric>
            ;float normally expected

            % R-R cycles acquired this window := <Numeric>
            ;if known

            number of cardiac cycles (acquired) := <Numeric>
            ;eg 356 , if known

            study duration (acquired) sec := <Numeric>
            ;total  acquisition time duration for
            ;this window only (if it can be computed!!) as
            ;opposed to total acquisition time (when different)

            !maximum pixel count := <Numeric>
            ;for scaling purposes for all images in this
            ;time window (and energy window) only

            R-R histogram := <ASCIIlist> N Y|N
            ;flag to indicate that one exists!!

        }
        ;Repeat for each subsequent time window.


	;start of tomographic keys

        number of detector heads := <Numeric> 1
        ;default=1 if unspecified

        for ( number of detector heads )
        {

            !number of images/energy window := <Numeric>
            ;total number of images (for all heads) for
            ;THIS energy window!!

            !process status := Reconstructed Acquired|Reconstructed
            ;used below in conditional- MUST be defined

            !number of projections := <Numeric>
            ;for example- 64
            ;note this is the actual number of images per
            ;head per energy window if
            ;the data are acquired, but NOT if the data are
            ;reconstructed where the number of images is
            ;specified separately as number of slices

            !extent of rotation := <Numeric>
            ;e.g 180, 360

            !time per projection (sec) := <Numeric>
            ;important for Acquired data
            patient orientation := <ASCIIlist> head_in
                   head_in|feet_in|other

            patient rotation :=  <ASCIIlist> supine
                   prone|supine|other

            if( process status = "acquired")
            {
               !SPECT STUDY (acquired data):= <NULL>

               !direction of rotation := <ASCIIlist> CW CW|CCW
               ;CW = clockwise, CCW = counter clockwise

               start angle := <Numeric>
               ;0 is top-dead-centre, in degrees
               ;in orientation as specified above

               first projection angle in data set := <Numeric>
               ;in degrees expressed with respect to
               ;anterior-  angles in direction as
               ;specified CW or CCW

               acquisition mode := <ASCIIlist> stepped
                    stepped|continuous

              Centre_of_rotation :=  <ASCIIlist> Corrected
                   Corrected|Single_value|For_every_angle
              ;default is "Corrected"
              ;"Corrected" corresponds to a null centre of rotation
              ;correction, as previous required by Interfile, that
              ;is, no centre of rotation information is to be
              ;passed. The key "Single value" indicates the
              ;conventional definition of the centre of rotation
              ;offset to be a single value specified for all angles,
              ;specified for each head given a multiple head
              ;acquisition.
              ;The key "For_every_angle" indicates that the centre
              ;of rotation offset will be  specified for each head
              ;and every angle. This is not currently implemented in
              ;this Interfile definition, but will be introduced in
              ;V4.
              ;The mathematical centre of rotation is assumed to be
              ;in the exact middle of the projection for example at
              ;x= 32.5 y=32.5 for a 64x64 image where the count
              ;starts from 1. Note that the choice of coordinates
              ;does not matter, the only constraint being the
              ;assumption that all projections have a length which
              ;is an even number of pixels. The centre of rotation
              ;is specified as the offset from that position to the
              ;perpendicular dropped from a point on the axis of
              ;rotation onto the head.

              if( Centre_of_rotation = "Single_value" )
              {

               !X_offset := <Numeric>
               ;x offset for all angles in mm.
              ;x_offset is the x offset between the perpendicular
              ;dropped from the centre of rotation and the dead
              ;centre of the matrix,
              ;The positive direction for the offset is considered
              ;to be that of the increasing projection index, e.g.
              ;for a projection with pixels of size 6mm, which
              ;should be centred at 32.5, an offset of +6mm
              ;indicates that the centre of rotation is at 33.5
              ;Note that since offset is specified in mm, the pixel
              ;size must be known.


               Y_offset := <Numeric>
               ;y offset for all angles in mm
              ;y_offset is the y offset between that perpendicular
              ;dropped from the centre of rotation from that point
              ;on the axis of rotation where the y_offset is
              ;considered to be zero, and the centre of the camera's
              ;field of view. Thus y_offset is the RELATIVE shift of
              ;the y-axis with respect to some arbitrary position,
              ;normally that from the centre of the filed of view of
              ;the first at the top dead centre position. Thus for
              ;a single head, this value would normally be expected
              ;to be equal to zero.

               Radius := <Numeric>
               ;radial distance to centre of rotation in mm,
              ;for this head.


               }
              ;end of centre of rotation specification

               orbit := <ASCIIlist> Circular Circular|non-circular

               preprocessed := <ASCII>
               ;preprocessing method
            }
            ; end of process status acquired

            if( process status = "reconstructed")
            {
               !SPECT STUDY (reconstructed data) := <NULL>

               method of reconstruction := <ASCII>

               !number of slices := <Numeric>
               ;i.e. number of images in this set for this
               ;head and this energy window

               number of reference frame := <Numeric> 0
               ;if unspecified the frame number
               ;originally used for defining slice positions
               ;0=default [Note- not a very useful key]

               slice orientation := <ASCIIlist> Transverse
                   Transverse|Coronal|Sagittal|Other
               ;default is transverse if unspecified

               slice thickness (pixels) := <Numeric> 1
               ;if unspecified 1=default

               centre-centre slice separation (pixels):=<Numeric> 1
               ;e.g.1,2,3,4...  as distinct from slice thickness
               ;the word centre can also be spelt as center

               filter name :=  <ASCII>
               ;e.g. Hann, Hamming, Butterworth

               filter parameters := <ASCII>
               ;Nyquist freq etc.

               z-axis filter := <ASCII>
               ;method [1,2,1] etc.

               attenuation correction coefficient/cm := <Numeric> 0.0
               ;default 0 means not done if unspecified

               method of attenuation correction :=  <ASCII>  none

               scatter corrected := <ASCIIlist> N Y|N

               method of scatter correction := <ASCII> none

               oblique reconstruction := <ASCIIlist> N Y|N

               oblique orientation := <ASCII>
               ;free text [Note ACR-NEMA convention preferred]
            }
            ;end of reconstructed tomo
       }
      ;End of GATED SPECT

}
;end of loop for energy windows

if( type of data = "Curve")
      {
       !CURVE DATA := <NULL>
       ;label to indicate that this is the curve definition
       ;curves should always be kept in separate data files
       ;and not together with the administrative data

       Curve_dimensions := <Numeric> 2
       ;how many dimensions- ONLY 2 is permitted in V3.3.
       ;Even if a single vector of values is required
       ;both matrix size[1] and [2] must be defined
       ;although one of them should take the value 1.
       ;A set of x,y values is 2 dimensional with normally
       ;matrix size[1] or matrix size[2] equal to 2.
       ;and the other matrix size specifying
       ;the number of PAIRS of values present (see Fig 1).
       ;Matrix sizes greater than 2 for BOTH dimensions are not
       ;recommended.

       !matrix size[1] := <Numeric>
       ;matrix size across (number of columns)

       !matrix size[2] := <Numeric>
       ;matrix size down (number of rows)

       !number format := <ASCIIlist> unsigned integer
           signed integer|unsigned integer|
           long float|short float|bit|ASCII

       !number of bytes per pixel := <Numeric>
       ;e.g. 1|2|4|.. [this key ignored for bit data]

       Type_of_curve :=  <ASCII>
       ;what kind of curve is it, for example time activity curve
       ;ROI indicates that this is a list
       ;of vectors corresponding to an ROI.

       for( Curve_dimensions, dimension)
       {

          ;When matrix size[1] or matrix size[2] equals 2 (the normal
          ;case) such that the data comprise pairs of values,
          ;then Label[1],  Units[1] etc. refers to the set of first
          ;values for each pair, and Label[2] etc. refers the set of
          ;second values for each pair.

          Label[<dimension>] :=  <ASCII>
          ;a text label for the corresponding axis  e.g. "counts"

          Units[<dimension>] := <ASCII>
          ;units of measurement for the corresponding axis
          ;e.g. "units[1]:=counts/sec"

          Min[<dimension>] := <Numeric>
          ;Minimum of set of values as indicated in units as defined,
          ;optional

          Max[<dimension>] := <Numeric>
          ;Maximum value as above, optional

      }
     ;End of loop for curve dimensions

}
!END OF INTERFILE := <NULL>
.fi
.PP
.in 0.2i
.SH FILES
.PP
.in 0.2i
.nf
/usr/local/xmedcon/source/m-intf.h      The header file.
/usr/local/xmedcon/source/m-intf.c      The source file.
.PP
.in 0.2i
.SH SEE ALSO
.PP
.in 0.2i
medcon(1), xmedcon(1), xmedcon-config(1)
.PP
.in 0.2i
m-acr(4), m-anlz(4), m-gif(5), m-inw(4), m-ecat(4)
.PP
.in 0.2i
medcon(3)
.PP
.in 0.2i
.SH AUTHOR
.PP
.in 0.2i
.I (X)MedCon
project was originally written by Erik Nolf (eNlf) for the former PET-Centre at Ghent University (Belgium).
.PP
.in 0.2i
.TS
tab(=);
lB l lB l.
e-mail:=enlf-at-users.sourceforge.net=www:=http://xmedcon.sourceforge.net
.TE