([n],[phi0],[the0],[psi0],[phid],[thed],[psid],[nphi],[nthe],[npsi],[mskval],[peaks],[msktype]) ; Controls motif search
;
; new_sigs_settings.spi  New                         JAN 2003 Bimal Rath 
;                        Parallelized                MAY 2003 ArDean Leith
;                        Rewritten                   JUL 2008 ArDean Leith
;
; PURPOSE: Searches for molecular signature (motif) inside search volume. 
;          Be SURE both volumes have same magnification (1 pixel = "n" nanometer) 

; -------------- Edit next 13 input parameters --------------------------

[n]=0         ; Number of OMP processes wanted

; Phi: Starting angle, Ending angle (+ve), & Step size  (+ve)
[phi0]  = 0
[phin] = 0;  [phin] = 350
[phid] = 350

; Theta: Starting angle, Ending angle (+ve), & Step size  (+ve)
[the0] = 0
[then] =  0 ;[then] = 180
[thed] = 10

; Psi: Starting angle,   Ending angle (+ve), & Step size  (+ve)
; [psid] will be modified be 1/sin([theta]) for uniform sampling of unit sphere
[psi0] = 0
[psin] = 330
[psid] = 30

; # of peaks to be found, (# of particles expected)
[peaks] = 10

; Pixel value for masking (pixels < this value set to: 0, rest set: 1) 
[mskval] = .1

; Type of mask to be used. 
; NOTE: For globular motifs, rotationally invariant mask can be used. 
; Computation will be faster. A cubic motif volume is required.
[msktype] = 0 ; 0 = Rotationally invarient mask,  1 =  Asymmetric mask

; --------------------------- INPUT FILE NAMES ----------------------------
; ----------------- May have to edit these names --------------------------

FR G
[SEARCH_VOL]input/jnk_test_vol             ; Search volume 384x384x110

; When using a rotationally invariant mask, must use a cubic motif volume
FR G
[MOTIF_VOL]input/jnk_test_motif            ; Volume to be searched for 20x20x20 

; Use the mask that was used to separate a volume eg. 40s masked from 80s
; If "TH M" was used for the purpose, you may need to use "DI" to dilate
; the mask a little bit and use the dilated mask here.
FR G
[MASK_PKR]input/dum_mask                   ; Peak restricting mask  UNUSED !!!!!!!

; When searching a tomographic volume you may need to use a wedge filter on 
; the motif to compensate for missing wedge and CTF.
FR G
[WEDGE_FILTER]*                            ; No tomographic wedge filter

;  
; ----------------- OUTPUT FILES ------------------------------------------
; ----------------- No need to edit for default names  --------------------

FR G
[MOTIF_MASK]work/jnk_mask                  ; Motif mask volume (From: 'sigs_pub')

FR G
[CUBE_MOTIF_VOL]work/jnk_cube_motif        ; Padded cubic motif (From: 'sigs_pub')

FR G
[MOTIF_MASK_FFT]work/jnk_mask_fft          ; FFT of mask volume (From: 'LO I')

FR G
[SEARCH_VOL_FFT]work/jnk_search_fft        ; FFT of search volume (From: 'LO I')

FR G
[SEARCH_VOL_SQ_FFT]work/jnk_search_sq_fft  ; FFT of search volume squared (From: 'LO I')

FR G
[LSD_VOL]work/jnk_lsd                      ; LSD volume (From: 'LO LSD')

FR G
[PEAK]output/jnk_peak                      ; LSD scaled peak volume (From: 'LO')

FR G
[DOC_FILE_OUT]output/DOC_OUT               ; Angles and peak search info file stem (From: 'LO')

FR G
[sync_doc]work/sync_doc                    ; Sync. doc file stem for PubSub   (From: 'LO')

FR G
[PEAK_COMBINED]output/DOC_COMB             ; Combined angles & peak search info file stem

; DIRECTORIES CREATED
FR G
[temp_local_dir]local/                     ; A local scratch dir (From: 'sigs_pub')
FR G
[temp_work_dir]work/                       ; A scratch dir       (From: 'sigs_pub')
FR G
[output_dir]output/                        ; An output dir        (From: 'sigs_pub')

; ----------------- END OF OUTPUT FILES -----------------------------------

; AVOID DIVISION BY ZERO
IF ([phid].EQ.0) THEN
   [phid] = 1
ENDIF
IF ([thed].EQ.0) THEN
   [thed] = 1
ENDIF
IF ([psid].EQ.0) THEN
   [psid] = 1
ENDIF

[nphi] = INT((([phin]-[phi0])/[phid])+1)
[nthe] = INT((([then]-[the0])/[thed])+1)
[npsi] = INT((([psin]-[psi0])/[psid])+1)

RE
;