; Places spherical marker in a volume using doc. file
; circle.bat 
;
; PURPOSE: Places spherical shell marker in a volume using locations from a 
;          doc file.
;
; I/O PARAMETERS AND FILES ARE SET HERE:
;
; ----------------- INPUT REGISTERS -------------------------------------

x11 = 9             ; Radius of spherical marker
x19 = 50            ; Number of markers

; -------------- INPUT FILES -------------------------------------
; -------------- MAY HAVE TO EDIT THESE NAMES -----------------------
; -------------- DO NOT COPY FROM WEB BROWSER -----------------------
FR G
[align_doc]doc_unique            ; Input label location doc. file

FR G
[big_volume]large_vol            ; Input volume to be labeled

; ----------------- OUTPUT FILES -------------------------------------------

FR G
[temp_vol]_1                    ; Temporary labels volume (deleted)

FR G
[labeled_vol]large_vol_circ     ; Labeled output volume

; -------------------------------------------------------------------------
DE
jnk[align_doc]

DOC REN                   ; Renumber the location doc file keys
[align_doc]
jnk[align_doc]

; FIND NSAM, NROW AND NSLICE OF LARGE VOLUME
FI x20,x21,x22            ; Large volume size
[big_volume]
12,2,1

x12 =  (2 * x11) + 1 
x13 = - X11               ; Sphere center offsets
x14 = x11 - 1             ; Inner sphere radius

MO 3
[temp_vol]                ; Label output volume
x20,x21,x22               ; Size
SP                        ; Spheres
Y                         ; Get coords. from doc. file
jnk[align_doc]               ; Doc. file
x19,4                     ; Number of spheres, starting col. for X,Y,Z 
0,0,0                     ; Sphere center offsets
300                       ; Shell intensity
x11,x14                   ; Sphere radii

FS
[temp_vol]                ; Label output volume

AD
[temp_vol]                ; Label output volume
[big_volume]
[temp_vol]                ; Labeled volume
*

TH F
[temp_vol]                ; Input volume
[labeled_vol]             ; Output volume
A                         ; Above threshold
257                       ; Threshold
400                       ; Set to this value

FS
[labeled_vol]             ; Labeled volume

DE
[temp_vol]                ; Labeled volume

EN

;