generate_image Parameters :=
; a sample file on how to use generate_image

;;;;; a number of keywords as in Interfile
; (possible values are given by using a | notation)

; optional: values: PET|nucmed *defaults to PET for backwards compatibility)
imaging modality:=PET
; optional (but recommended). Needs to be a STIR supported name
originating system := ECAT 931
; optional patient position keywords (defaulting to "unknown")
; orientation: allowed values: head_in|feet_in|other|unknown
patient orientation := head_in
; rotation: allowed values: prone|supine|other|unknown
patient rotation :=  supine
; optional keywords to set image timing
image duration (sec) := 20 ; defaults to -1 (i.e. unknown)
image relative start time (sec) := 0 ; defaults to zero

;;;;; specific keywords

output filename:=image
; optional keywords to specify the output file format
; example below uses Interfile with 16-bit unsigned integers
output file format type:= Interfile
  interfile Output File Format Parameters:=
    number format := unsigned integer
    number_of_bytes_per_pixel:=2
    ; fix the scale factor to 1
    ; comment out next line to let STIR use the full dynamic 
    ; range of the output type
    scale_to_write_data:= 1
  End Interfile Output File Format Parameters:=

X output image size (in pixels) := 128
Y output image size (in pixels) := 128
Z output image size (in pixels) := 95
X voxel size (in mm) := 2.05941
Y voxel size (in mm) := 2.05941
Z voxel size (in mm) := 2.425

; parameters that determine subsampling of border voxels
; to obtain smooth edges
; setting these to 1 will just check if the centre of the voxel is in or out
; default to 5
; Z number of samples to take per voxel := 5
; Y number of samples to take per voxel := 5
; X number of samples to take per voxel := 5

; now follows a list of shapes and their values
; each will be added to the image (so values accumulate)
; see Shape3D hierarchy for possibly shapes

shape type:= ellipsoidal cylinder
Ellipsoidal Cylinder Parameters:=
   radius-x (in mm) := 100
   radius-y (in mm) := 100
   length-z (in mm) := 400
   ; optional start-end angles to define a wedge as opposed to a full cylinder
   initial angle (in deg) :=10
   final angle (in deg) :=90

   ; next keyword can be used for non-default axes
   ; values below are give a rotation around y for 90 degrees (swapping x and z)
   ; Warning: this uses the STIR convention {z,y,x}
   ; direction vectors (in mm):= { {0,0,1}, {0,1,0}, {-1,0,0}}
   ; origin w.r.t. to standard STIR coordinate system (middle of first plane)
   origin (in mm):={230.375, 3.0192, -0.590588}
   END:=
value := 1

next shape :=

shape type:= ellipsoid
Ellipsoid Parameters:=
     radius-x (in mm):= 60
     radius-y (in mm):= 40
     radius-z (in mm):= 30
     direction vectors (in mm) := { {0,0,1}, {0,1,0}, {-1,0,0}}
     origin (in mm):={130.375, 3.0192, -0.590588}
End:=
value:=5

next shape :=

; now cut lower activity in a box
shape type:= Box3D
box parameters:=
origin (in mm):={130.375, 3.0192, -0.590588}
length-x (in mm):=30
length-y (in mm):=40
length-z (in mm):=50
END:=
value:=-1


END:=
