###############################################################################
NOTES/UPDATES UCL/UCSD/SDSU csurf -- 02 May 2026, Marty Sereno
################################################################################
### N.B.: designed to work alongside default install of MGH freesurfer
### N.B.: only includes manual (hi-res) surf-making tools
### N.B.: if you use this, give credit to UCSD/UCL/SDSU csurf (Martin Sereno)

### download
https://pages.ucsd.edu/~msereno/csurf
https://mri.sdsu.edu/sereno/csurf

### compile machines
mac:   OSX 10.6.8, 64-bit (runs on 10.6 up)
linux: CentOS 5.9, 32-bit (32-bit better inside old Windows virtual machines)
linux: CentOS 5.9, 64-bit (use for most current Linux)

### to install/update, untar anywhere (N.B.: unpacks to "csurf" w/o dates!)
cd ~                                  # example install into home directory
tar xvfz csurf0.8-mac-YYMMDD.tgz      # 64-bit Mac 10.6 and above w/XQuartz
tar xvfz csurf0.8-linux32-YYMMDD.tgz  # Centos5.9 32-bit or equiv 2.6+ kernel
tar xvfz csurf0.8-linux64-YYMMDD.tgz  # Centos5.9 64-bit or equiv 2.6+ kernel

### *or* use script to automate download/install/update-to-latest
cd <directory_in_which_to_install_or_update_csurf>
update-csurf go
# the csurf-update sh script is found here:
  $CSURF_DIR/bin/noarch
         *or* 
  https://pages.ucsd.edu/~msereno/csurf/fsaverage-labels/bin

### data directories
keep subjects/sessions dirs *outside* of csurf (and freesurfer)!
safe to use same SUBJECTS_DIR for MGH freesurfer and csurf!

### all-in-one set-up aliases examples, "fs" (example for Mac csurf)
### Linux: change /Applications/freesurfer => /usr/local/freesurfer below
# [for .cshrc or .tcshrc]
alias fs \
  "setenv FSURF_DIR /Applications/freesurfer; \
   setenv SUBJECTS_DIR ~/subjects; \
   setenv FUNCTIONALS_DIR ~/sessions; \
   pushd ~/csurf; \
   source FreeSurferEnv.csh; \
   popd"
# [for .bashrc or .bash_profile or .zshrc] [sh: use "." instead of "source"]
alias fs="\
  export FSURF_DIR=/Applications/freesurfer; \
  export SUBJECTS_DIR=~/subjects; \
  export FUNCTIONALS_DIR=~/sessions; \
  pushd ~/csurf; \
  source FreeSurferEnv.sh; \
  popd"

### all-in-one set-up aliases, "mg" (example for Mac MGH FreeSurfer)
### Linux: change /Applications/freesurfer => /usr/local/freesurfer below
# [for .cshrc or .tcshrc]
alias mg "\
  setenv FREESURFER_HOME /Applications/freesurfer; \
  setenv SUBJECTS_DIR ~/subjects; \
  pushd /Applications/freesurfer; \
  source FreeSurferEnv.csh; \
  popd"
# [for .bashrc or .bash_profile or .zshrc]
alias mg="\
  export FREESURFER_HOME=/Applications/freesurfer; \
  export SUBJECTS_DIR=~/subjects; \
  pushd /Applications/freesurfer; \
  source FreeSurferEnv.sh; \
  popd"

### HOWTO use aliases above
fs      # setup env to run csurf in a terminal window (or switch from MGH)
csurf   # start interface, menu exit or ctrl-C to quit (Mac: from xterm)
mg      # change env to use MGH freesurfer from same terminal window

### HOWTO use Mac-only Csurf.app (identical code, but w/Mac .app wrapper)
--double-click Csurf.app0.8-linux-YYMMDD.tgz (unpacks to just Csurf.app)
--Finder move Csurf.app to /Applications

### HOWTO remove Mac 'quarantine' attribute (to allow csurf/Csurf.app to run!):
sudo xattr -r -d com.apple.quarantine ~/curf
                       *or*
sudo xattr -r -d com.apple.quarantine /Applications/Csurf.app

### HOWTO speedup interface on MacOS 10.12+ w/cover-uncover hack turned off
boot, login/startX11, logout, login/startX11 (only sticks for a while :-/ )


###############################################################################
UPDATE SUMMARY (latest top)
###############################################################################
### TODO
--finish tksurfer-based hi-res pialwhitethk.tcl script

### 02 May 2026
 1) find gradient reversals (curv, real-valued, phase)
 2) export annot region IDs to label/wfile (copy_idnum_val)
 3) new csurf menu item: add Preferences -> Upate Csurf
 4) tksurfer: alt/cmd-z undo for accidental clear vertex marks

### 17 Sep 2025 (area labels, coherence, better % resp, gather SMOOTH functs)
 1) option to display annotation region names on surface
 2) fourier panel also calculated/paints coherence alt stat mask
 3) better percent resp popup for middle-click "W" on "val:" line
 4) distinguish val/stat smooth, ignore dispersion opt for complex smooth
 5) gather SMOOTH/fillholes/searchlight functs into R-clk-SMOOTH buttonbar
 6) new GR button opts to compute/display per-annot-region avg gradient vecs

### 07 May 2025 (AppleSilicon, 3D cortical ribbon ROIs, cereb dentate nuc)
 1) better instructions, testing, getonearch bugfix for latest Apple Silicon
 2) new functs to make/process 3D cortical ribbon ROIs from rh/lh-*.annots
 3) new 3D cortical ribbon ROIs/parcellations (Csurf, HCP-MMP1)
 4) how to view 3D ROIs/parcellations/overlays in tkmedit
 5) tcl script to make left+right color lookup table
 6) cerebellar dentate nucleus surface recon and flattening

### 12 Nov 2024 (Talairach 152, read diff-vtx-num label, fill holes, select in)
 0) fix label header bug introduced in Linux interim releases 240619,240707
 1) tksurfer can write Talairach coords (MNI 305 or 152) to label (10 functs)
 2) tkmedit can use MNI 152 instead of MNI 305
 3) read_label_to_nearest_annot_using_col: import label w/diff vtx numbering
 4) fill_annot_holes_neigh: fill holes (e.g., in imported label)
 5) option to select vertices inside surface (for complexly folded)

### 26 Apr 2024 (4-step tkmedit undo and im2 dep edit, better gradient arrows)
 1) 4-step undo edit in tkmedit (one-step redo)
 2) tksurfer gradient arrows pruning function
 3) tkmedit range and 2nd image range edit functs (mouse,do-all)
 4) tkmedit brightness-centerable distance-dep contrast ramp
 5) new filled gradient arrowheads
 6) new funct to distance sort single-vertex-wide label paths
 7) new R-clk buttonbars (label S/T/X, val R/CLR/CS, SMOOTH, area D)

### 25 Sep 2023 (use TAXIS_OFFSETS, display 1D bfloat's)
 1) tksurfer displays/prints region areas from labels/annotations
 2) new function label_to_vtxcol (for blink-compare annotations)
 3) tksurfer "val:" line can display 1D bfloat's
 4) fourier.c phase-corrections use AFNI TAXIS_OFFSETS

### 02 Oct 2022 {csurf/fsaverage}-update scripts
 1) new function to write label with adjusted/actual polar angle
 2) update-csurf: script to automate csurf install/update
 3) update-fsaverage: add parcellation, fixed surfaces to writable fsaverage

### 24 Mar 2022 (add topological maps parcellation)
 1) topological maps fsaverage parcellation/annotation: $hemi-CsurfMaps1.annot
 2) buttonbar popups for overloaded "label:" and "val:" line buttons
 3) csurf-generated annot files now mris_convert/freeview compatible
 4) read_gifti_to_annot, labeled_cut_clearvals, currcol_to_vtxcol

### 14 Jun 2021 (better create annot procedure)
 1) display overlay data from only a subset of MGH annotation regions
 2) better functs/interface for creating MGH annotation from indiv labels
 3) extract single MGH annotation region+data to label
 4) control luminance ratio of red/green display
 5) normal search is now default for csurf Setup Funct panel

### 29 Jun 2020 (read Alias/BV, searchlight scripts)
 1) read Alias (*.obj) surfaces, and BrainVoyager(*.srf) surfaces + ROIs (*.poi)
 2) add FlipHemi button (larger F3 interface) to mirror-image a surface
 3) tkmedit can 3D FILL (and append existing FILL) using annotation regions
 4) searchlightarea.tcl script
 5) FreeSurfer.zsh path parsing fixed

### 16 Dec 2019 (direct paint, complex-valued registration)
 1) tksurfer 'direct paint' (no register.dat, direct from curr vol)
 2) sphere_morph ("REG") can use 2nd complex dataset (e.g., pol + ecc)
 3) tksurfer display gray-matter diffusion vecs from AFNI BRIK
 4) tksurfer display vectors (e.g., GM DTi) from 3-frame .mgh
 5) calc % overlap between annotation regions and non-zero .val

### 22 Jul 2019 (convenient re-make edited surface)
 1) mask overlay using any combo of MGH annotation regions
 2) csurf Run recon-all option to start w/edited orig.mgz
 3) csurf accepts inst/subject/functional paths with spaces
 4) truncphase: limits can now wrap, soft roll-off option available

### 08 Feb 2019 (disp/read aseg colors, illuminate inside surface)
 1) display (correct colors), use (get rawdata timecourses) for MGH 3D aseg's
 2) illuminate inside of (complex) cut surface
 3) tmp fix for tksurfer black after click
 4) Linux fonts fixed
 5) new phasemovie option: phase-colored contour over dark other phases

### 21 Jun 2018 (better annot2roi, disp annot on 2D ribbon)
 1) improved annot2roi.tcl script: use HCP surface ROIs for indiv subj vol ROIs
 2) display .annot file as colored ribbon on 2D slice
 3) de-mean and variance-normalize vtx .val data, complex data mean to 1
 4) help updates (non-interactive scripts, tk startup problems, shell scripts)

### 25 Jan 2018 (display normals)
 1) 36 new helpfiles for SHRINK, REG(morph) parameters on tksurfer F3 panel
 2) display normals in tksurfer
 3) divergent/convergent stereo display
 4) script to make exploding brain movie

### 18 Oct 2017 (direct manip big speedup)
 1) much faster direct manipulation of surface on Mac
 2) fix 'surface disappears on first click' (Ubuntu)
 3) csurf checks/explain-fix if AFNI-req'd libXp missing (e.g., Ubuntu 16.04)
 4) fix fourier buffer overflow reading float BRIK w/large values (>32768)
 5) export current surface geometry/coloring to glTF 2.0 file

### 21 Jun 2017 (xfer edits to new wm, mid-clk CORONAL for flip popup)
 1) dump .val's just from borders of displayed labels (tksurfer)
 2) count/report neighbors of each annotation area (tksurfer)
 3) spherical Gaussian hand normalization (tkmedit)
 4) transfer previous wm edits to a new wm (tkmedit)
 5) flip from CORONAL view popup (tkmedit)
 6) new standard script: searchlightdiff.tcl (tksurfer)

### 20 Mar 2017 (autogenerate 3D ROIs from surface annot)
 1) auto generate single-subject 3D ROIs from fsaverage annotation
 2) 3D ROI masks from annotation region(s) now have IDnum
 3) new label/annot 1-layer-of-vertices erosion function
 4) new histogram options (middle click upper right 'h' on tksurfer)
 5) sparse ('representative-vertex') labels w/fixed vertex count

### 17 Dec 2016 (Mac10.10+ speedup, incl fixed inflated_avg)
 1) major speed up Mac OS X 10.10+ direct surf manip (shift-click-drag)
 2) new funct to write labels/data from every MGH annot region (e.g., HCP)
 3) inflated_avg fix and fsaverage HCP labels now included
 4) print histogram of current surface data using gnuplot
 5) searchlight cluster ID count and variance: searchlightop_val2stat

### 04 Oct 2016 (read GIFTI surf/data)
 1) read GIFTI surface (e.g., *.{L,R}.*.surf.gii)
 2) read GIFTI overlay (e.g., *.{L,R}.*.shape.gii, *.{,LR}.*.func.gii)
 3) HOWTO use HCP MMP1 parcellation
 4) arbitrFDRcovarflag tick (more stringent) for non-parametric FDR
 5) save surface-based spotlights to ASCII file

### 24 Jun 2016 (unique/representative vertices functs)
 1) "T" and "C" buttons also do 'representative' vertex sampling
 2) "ROI" button also does fill between phase contours
 3) "CS" button also does surf-based FDR p-val correction for mult compare
 4) tksurfer import/export: F3 panel "OFF" (*.off, opt w/face or vtx cols)
 5) tksurfer 3D printer export: F3 panel "STL" (*.stl)

### 27 May 2016 (calc gradients on curved surf)
 1) cmdline paint, UQ directly generate label of uniq vertices
 2) calculate data gradients on curved surfaces
 3) 'surface normal' search along vector to same pial vertex
 4) prf2sess: conv SamSrf files to image/wfiles so csurf can open as session

### 11 Apr 2016 (map-data-driven morph, disp template .tif, subj<=>subj)
 1) spherical surface morph driven by curv + stat + complex map data
 2) display MGH template .tif frame on any surface
 3) view single subj data on another subj with one tick
 4) many small bugfixes

### 30 Jan 2016 (R/W selected, dilate FILL, labels->annot, cplx/real smooth)
 1) functions to read/write selected vertices from/to labels
 2) dilating FILL
 3) funct to assemble labels specified in MGH Color LUT to annotation
 4) complex smoothing ("cr") with amp replaced by real-valued amp avg
 5) all tksurfer/tkmedit dropdowns do live update
 6) fix intro'd bugs: no FSURF_DIR, linux NOTES, reconall, smallscreen

### 30 Dec 2015 (keyword search, read/write/use .vtk)
 1) cmd/alt-f keyword search in all help panels
 2) remove/restore list of single vertices from label
 3) Save/Restore brain pose
 4) surfclust reads/writes *.vtk files
 5) tksurfer write *.vtk surface or surface+data

### 21 Nov 2015 (works on 10.11-ElCapitan, reads VTK surface/overlay)
 1) csurf and Csurf.app work on Mac OS X 10.11, El Capitan (and earlier)
 2) initial facility to read VTK files for surface (tri) and ovelay (wfile)
 3) "h" buttons on csurf/tksurfer/tkmedit/tkregister for quick help

### 10 Oct 2015 (Csurf.app)
 1) Csurf.app for easier install
 2) fixed nmovie crashing on recent Ubuntu and Mac
 3) tksurfer/surfclust can read multi-frame .mgh files
 4) 8 LUT cases: interpolate/nointerpol, bottom/center, symmetric/onesided

### 22 Sep 2015 (all-in-one help)
 1) csurf: Help -> All Help Contents (clickable)
 2) calcvert can write native (or swapped) bare floats from curv file

### 12 Sep 2015 (script fixes)
 1) fix movie/slices tcl scripts so GLX stays live
 2) fsaverage 'representative' vertex help

### 10 Sep 2015 (corr p-val, representative vertices)
 1) p-value (opt covar) calc/disp for Pearson/circular searchlight corr
 2) get 'representative' vtxs -- nearest to avg of set sampling 1 vox ("UQ")
 3) Pearson/circ corr searchlight can use just 'representative' vtxs
 4) tksurfer: (s)fthresh and (s)fmid fully wired into LUT/CARET/Jet
 5) interactive surfclust button ("CS") moved to "val:" line
 6) 40 new/updated R-click help panels, warn/explain overloaded clicks
 7) fix left-click in black BG sometimes a crasher (!)
 8) "W" on "val:" line disp/write percent resp from _x,_y (enter avgraw,tpts)
 9) Mac: csurf looks for TextEdit before paleolithic xedit :-}

### 23 Aug 2015 (cp prev, cplx amp, direct manip hangover)
 1) "cp prev" buttons on Fourier and View Functional Data panels
 2) can use Jet/CARET for cplx amp (click "Col:" for colscale panel)
 3) direct manip hangover fixed by ShiftKeyUp clears missed mouse UpClicks

### 28 Jul 2015 (read native ROI, bugfixes/help)
 1) HOWTO get middle click
 2) tkmedit read ROI 2-state: "roiup:" (reg'd/upsampled) <=> "roin:" (native)
 3) percent peak-to-peak response (fourier-analyzed)
 4) bug fixes, INPROG tksurfer, tkmedit hacks

### 13 May 2015 (label/annot->3D AFNI mask)
 1) overload "label:" line "D": conv label/annotation(s) to 3D AFNI ROI mask
 2) bugfix: manually load complex stack now doesn't mangle color scale
 3) bugfix: swap settings now doesn't mangle colscale on first swap

### 02 May 2015 (hack for Yosemite, CARET videen-style colscale)
 1) hack to make csurf/tksurfer work reasonably on MacOSX 10.10 Yosemite
 2) CARET "videen-style" colscale=17 (L-click-"Bg", F3, or mid-click BR)
 3) S/V swapping between data sets saves/swaps color scale settings
 4) can display gradient amplitude as color map (vs. arrows: R-click help GR)

### 10 Apr 2015 (geodesics, gradients)
 1) calculate geodesic path on surface, show as label
 2) calculate/display gradients of curvature, val, or phase
 3) display two gradients (fieldsign calculation)

### 22 Mar 2015 (corr searchlight, data extract w/MGH annot, read SamSrf
 1) "X": Pearson or CircCorr 2 datasets (searchlight every vtx label/annotcol)
 2) extract stats/3D-timecourses from one or all MGH annotation labels
 3) read/display output of SamSrf pRF retinotopic map analysis
 4) RECON-ALL panel: fix purple kill, accept BRIK input (auto to NIFTI)
 5) can display just borders of MGH annotation or single labels

### 06 Mar 2015 (read/write ASCII surf, disp/use MGH annotation)
 1) read/write GIFTI ASCII surface (e.g., export from MIPAV)
 2) display MGH annotation file labels, use to extract labelwise surf data
 3) MGHTools->RegisterSurf default morph target now buckner40 (like recon-all)
 4) long thin F5 tkmedit interface + many sm interface, R-click-help updates

### 20 Feb 2015 (easier direct manip, AVGSURF, combine labels, docs)
 1) direct surface manip now only req's Shift-{L/M/R}-click-drag (was +ctrl)
 2) auto-fix giant triangles AVGSURF inflated_avg poles (make_average_surface)
 3) new combine labels function: see "C" button R-click help on "label:" line
 4) update docs
 5) Mac: XQuartz (X11 lib v10.0) now required (better stability)

### 07 Dec 2014 (movies, small bugfix/updates, doc updates)
 1) expand, document movie scripts (phase/offset/movie360/inflate/flatten)
 2) update to tcl/tk 8.5.17
 3) fixed recent Ubuntu csurf startup crash
 4) Import Extern Stats can use .mgz stats file
 5) AFNI version checking blocked (in case AFNI website down)
 6) runs on Mac OS X 10.10 (tk is slow on some machines)

### 02 Nov 2014 (patch mask/cut, 3D fill)
 1) "M"=mask, "C"=cut buttons on "patch:" line to mod current surf w/patch
 2) tksurfer (F3 panel): 3D fill surf: normmv/scale/col3d/"fat"/fill3d/writeims
 3) fix tcl error tkmedit F3 manual norm panel (<Return> in lim/ffrac entries)
 4) nmovie accepts mix of tiff sizes (centers later on first)

### 18 Oct 2014 (undo patch cuts, display areal distortion, direct manip)
 1) local undo surface patch cuts using label (middle-click label "D" button)
 2) new "D" button for "area:" to calc+disp curr/orig area ratio (distortion)
 3) nmovie rewritten (Mac arrkeys, click-drag laptop scroll, static libtiff)
 4) new scripts: inflatemovie.tcl, flattenmovie.tcl
 5) direct manip/color-cache: clk surfwin, ctrl+shift + left/mid/right-clk drag

### 06 Sep 2014 (compile for 64bit-only Linux, bugfixes)
 1) 64-bit linux compile now available
 2) add Linux libjpeg62 for recent releases, fix FreeSurferEnv.sh LD path
 3) fix tcl crash on missing braces in $paint-3D_f 'if'
 4) make trunphaseflag/max/min work with "bi" colscale
 5) calcvert can now convert (all-vertex) wfiles to bare native floats

### 10 July 2014
 1) "locklabel" (tksurfer F3 panel): locks vertices under label during shrink
 2) MGHTools -> Flatten Surface allows re-flatten
 3) fsaverage-adds.tgz: fixed inflated_avg, and new flattenings

### 24 June 2014
 1) AVGSURF button: make_average_subject from CrossSubj Average panel subjlist
 2) documentation for above in Help -> Cross Session Spherical Average
 3) PAINT uses 3D _f file if there (was square amp of painted _r,_i)

### 16 Jun 2014
 1) tkmedit F3 TEST handnorm does all slices to im2, ALL button renamed APPLY
 2) tksurfer rgb dropdown, "R" button: easier chk/overwrite/modexisting/view
 3) label: "C" button cuts hole or label, cutaway parts have zeroed val/val2
 4) fix calvert ASCII->wfile bug w/vtx subset wfile (full rank wfile was OK)
 5) new calvert -maskwfile operation (use label to zero some wfile vertices)
 6) tksurfer SMOOTH button also smooths stat mask if loaded and mask ON

### 07 Jun 2014
 1) "fsavg" checkbut, View Functional Data -> disp singlesub data on fsaverage
 2) popup reports filled_{curr,orig}area for FILL/ROI/N/A/R
 3) tkmedit val/mask/roi comboboxes init'd correctly w/overlay
 4) FOURIER button also does 3D clust filter (3dmerge) for brainstem maps
 5) better/tighter startup window positions so tkmedit display not covered
 6) middle-click RESTORE also does recenter (new surf read in over startup)

### 18 May 2014
 1) better single-sub stat mask support (csurf/tksurfer/tkmedit)
 2) fourier: permutation test generate 3D -log10(p), auto-paints it to _p
 3) help: permutation, smoothing, new outfiles, per-vertex col pipeline
 4) tkmedit: dropboxes for BRIK stat overlays, CLR, FILL over sfthresh option

### 04 May 2014
 1) new "label:" button "C" doesn't restore invisible for find label overlap
 2) add MATLAB Jet colscale=15: "jt"
 3) if tkregister "round", 1/10 micron (0.0001 mm) offset to stop alias
 4) "R" button on "val:" line also accepts a 1frame 1D float *.mgh file
 5) Setup Align/Funct accepts conforming (256/512) .mgz file for MOVEABLE
 6) conflicting csurf/C/tcl intern varname (scandir,session) semantics fix

### 15 Apr 2014
 1) tkregister on-the-fly change between round and trunc (F3 interface)
 2) tkregister/paint/tksurfer/tkmedit autodetect/use "round" MGH register.dat
 3) tksurfer: interface actions -> tcl tksurfer.log (Preferences or click tcl:)
 4) tkmedit: same -> tkmedit.log (Preferences or click tcl:)
 5) fourier multi-threaded permute-freq pval (if non-0 permute cnt Fourier pan)
 6) add more 32-bit libs so nmovie works on curr default 64-bit Linux install
 7) update Help -> csurf/tkregister/tksurfer/tkmedit

### 07 Mar 2014 (Bok, bug fixes)
 1) fixlinks/addlibs for running 32-bit AFNI binaries on default 64-bit linux
 2) paint: Bok-like correct (-bokflag/-sulfrac/-gyrfrac), read float .mgz/.mgh
 3) tkmedit: open cursor, 512 flip, tclscript no -f, trunc editable, gauss kcnt
 4) surf: fix overflowing tables for very large surfaces

### 05 Feb 2014 (label transparency, calc area ratio, disp as curv, csh->sh)
 1) DSP uses current transparency in "alph" entry
 2) tksurfer click toggles "area:"<-> "area2" => read 2nd second area
 3) middle-click auto-reads/calculates/displays area ratio as 'curv'
 4) (not visible) 1600 lines of csh compile/run code ported to POSIX sh

### 13 Jan 2014 (fix sign time-shift, run/monitor bg recon-all)
 1) fix sign rawaverage timeshift
 2) purple button tkmedit PF/PFGAU
 3) shift-middle-click "labels:" "W" button write data underlying DSP'd label
 4) runra.{tcl,csh,sh} run/monitor 'n' copies of bg recon-all for subj list
 5) updated 7 help panels

### 06 Jan 2014 (time-shift rawaverage, new wmfilter, 2D color operations)
 1) time shift allowed in reversed-time raw averages (Combine 3D Raw Images)
 2) wmfilter/tkmedit does anisotropic *Gaussian* plane filter (PFGAU button)
 3) tkmedit does live 2D color operations (right-click "im2:")
 4) tkmedit can use 2D color operations to edit-to-black (F3 interface: OP)
 5) fixed bug in auto-read cluster mask for 3dDeconvolve-analyzed data
 6) 12 help panels updated/new

### 13 Dec 2013 (fix xsub t-test, offscreen render, fix help panels, cleanup)
 1) cross-subject t-test (AFNI) painted and surfclust'd with phasetype="w"
 2) MGHTools->Register now also runs mris_sphere for all-manual morph
 3) csurf Preferences menu item to change namefile (for 3D xsub thalamus avg)
 4) paint accepts short BRIKs (for DWI 'stats')
 5) tksurfer alt/cmd-k makes bigger surface cursor (also color neighbor edges)
 6) fix render offscreen (for extra-hi-res, new R-click help at rgb WRITE)
 7) higher max vertex count (1M->4M) allowed for init orig tessellation
 8) live surfclust parms added to pop-up from R-click "label:"
 9) updated 36 help panels

### 05 Oct 2013 (tksurfer read3D/livepaint, add stats to sample timecourse)
 1) tksurfer live read 3D stats (click "val:" to get "val3d:" alternate)
 2) tksurfer live paint 3D stats, run surfclust
 3) extract timecourse w/normsearch can also get stats ("S" button on "label:")
 4) allow create functional inside subject
 5) tksurfer/tkmedit/csurf help panels update

### 02 Sep 2013 (retinotopic region growing)
 1) find retin borders by grow from seed til overlap (find_retin_borders)
 2) csurf interface, script to run above (Fieldsign panel, borders.tcl)
 3) fill holes in label (fill_val_holes, fill_annot_holes)
 4) update label/render/fieldsign help

### 22 Aug 2013 (cleanup)
 1) accidental missing # in csurf broke VOLUME-STATS
 2) now runs in bash w/FreeSurferEnv.sh
 3) update usages/help
 4) surfclust/multiclust auto-expand stack to avoid crash w/one large cluster

### 18 Aug 2013 (cleanup)
 1) bugfixes (dropdown ?h.sphere revisible, Linux links for 32bit on 64bit OS)
 2) update pop-up help (tksurfer fill/smooth, tkmedit "im:")

### 10 Aug 2013 (various, MGH Talairach fix)
 1) debug csurf surfcluster handling
 2) Talairach fix (log, tksurfer dump raw timecourses)
 3) brik2cor trilinear interpolate improved

### 02 Aug 2013 (single subject cluster filter)
 1) fourier panel PAINT does single subject cluster filter
 2) single subject render panel has option to use cluster filter
 3) mask file lookup/wiring debugged

### 19 Jul 2013 (vertex-color labels)
 1) better sample raw timecourse along normal controls
 2) linrampphase2vtxcol

### 07 June 2013 (vertex-color labels)
 1) read/write vertex-color labels: overlay diff colscale on bg activity

### 03 June 2013 (label timecourses)
 1) uniq/search opts rawdata timecourses from label (Setup Align/Funct panel)
 2) tkmedit lib script for dumping local orthogonal slice series

### 29 May 2013 (3D ROIs)
 1) optional max radius criterion to FILL
 2) anatomical ROI using WMTRUNC
 3) "W" roi also writes ASCII overlay (like a tksurfer .label) to .3dlabel

### 25 May 2013 (surface-based cluster filter)
 1) SAMP2SUBJ also does surf-based clust exclusion for mult comparison correct
 2) spherical average help updated

### 13 May 2013 (color lookup table dropdown, cleanup )
 1) color LUT dropdown
 2) new "R" radius option for fill_nearest_vertices (along w/area, vtxcnt)
 3) extensive cleanup of tksufer.tcl

### 11 May 2013 (MGH areas, write patch bug, new fill option)
 1) write patch bug fixed (was write curv instead)
 2) default now to write MGH curv and area, compute current area fixed
 3) add read/write area next to curv (for $hemi.area.mid and $hemi.area.pial)
 4) new fill option ("A"): up to specified original area ("NUM" -> "N")

### 06 May 2013 (fix read MGH Talairach)
 1) fixed tkmedit read of MGH-generated Talairach coords to use c_{r,a,s} orig
 2) fix tksurfer.tcl roibutton showstopper (statmaskampflag crash)
 3) smallscreen additions: adj combolistbox adj, split/unsplit help menu

### 17 Apr 2013 (minor)
 1) tksurfer tools sulc/curv dropdown
 2) auto-name movies
 3) fix tksurfer read patch if started with 3D
 4) block more bad chars for proposed subj/sess dir

### 07 Apr 2013 (tkmedit ltimecourse)
 1) add extract/color/collapse/write/display/save single rawdata timecourse
 2) slightly reduced full FT memory use fourier/rcxcombine

### 30 Mar 2013 (edit GLT names, include bitmapped, Ubuntu fixes, bugfixes)
 1) edit/save proposed >32 GLT contrast names (easy to go over)
 2) incl libGLU to run on stock Ubuntu 12.04, fix Ubuntu-squished Save/Close
 3) incl bitmapped fonts for Linux in case not installed
 4) add render panel phase color look-up table color scale
 5) tksurfer extract timecourses uses midpoint of setup funct search min/max

### 13 Mar 2013 (gen linear tests, kill 3dDeconvolve bfloats)
 1) rm bfloats from 3dDeconvolve analysis pathway
 2) adapt to new 3dDeconvolve label format
 3) fix stat mask logic
 4) add general linear test panel (superseded pairwise diffs)
 5) finally auto-read AFNI TR's (!)
 6) button to clean up large full FT's

### 28 Feb 2013 (tksurfer dropdowns, bugfixes, help)
 1) tksurfer now has surf/script/label/valfile dropdowns (a lot easier)
 2) updated tksurfer help (csurf/tksurfer, surf, patch ROI)
 3) got rid of inverted (white) hard-to-read text newer Linux combo/entry/menu
 4) moved tksurfer revphaseflag to parallel its panel position in csurf
 5) mv to centOS5.9 compile of tcl/tk/tix (old still in tarball)

### 13 Feb 2013 (full FT, kill bfloats)
 1) Fourier panel: statsformat (bfloat vs. afnibrik), fullFT, Hi-Freq (resp.)
 2) Combine 3D Phase panel: add "vect avg full FT's, do sig" operation
 3) fourier.c: -sigoutbrik to write BRIKs (versus bfloats)
 4) fourier.c: -fullfourier, -fullfouramp to also mk full FT BRIKs (6x raw!)
 5) fourier.c: -juststats reads full FT (vs. calc them), then does sig calc
 6) rcxcombine.c: -ext BRIK reads/write statBRIKs or fullFT BRIKs
 7) rcxcombine.c: -fullFT does read/avg/phaseoffset/reverse/output full FTs
 8) paint.c: accept BRIK stats (in addition to bfloat)

### 07 Jan 2013
 1) render panel display/save/pass/togglestate of sfthresh/sfmid/sfslope
 2) tksurfer accepts signed t-stat for *complex* data (was missing fabs(fmid))
 3) tkmedit accepts signed t-stat for *complex* data (was missing fabs(fmid))
 4) fix introduced bugs in 04 Jan upload

### 04 Jan 2013
 1) fix auto-add .mgz for tkmedit im2
 2) statmask now visible in csurf (not yet in tksurfer, since real->val, swap)
 3) major overhaul of real, complex, and cross subject tksurfer statmask
 4) more auto setting of correct button by between-widget wiring
 5) fieldsign works again

### 28 Dec 2012
 1) tksurfer reports area of FILL or ROI patch to log
 2) t-test _b (power) against t-val entry squared => avg-tstat-sph-sm1_b-lh.w
 3) new csurf complex mask type: t-pow (left old t-sig still there for real)
 4) tkmedit can display MGH parcellations (read into im2, click "la")
 5) csurf Calc Rand Block Stats panel: ADD ADDITION
 6) don't mask colscalebar (no def)

### 05 Dec 2012
 1) multithreaded wmfilter (6x faster on 4 cores)
 2) tkmedit: sphnormflag: spherical piecewise lin norm around click
 3) tkmedit: "valn" readnative/reregister/subsampto1x1x1 "vals" (resampleed
 4) tkmedit: "mskn" same as above for live stat mask for real stats
 5) same as above 2 for tksurfer
 6) tkmedit: color LUT like tksurfer
 7) double tanh squash for real+{F,t}mask for tkmedit, tksurfer
 8) csurf auto-reads 3dDeconvolve coef and t/F output

### 05 Nov 2012
 1) 2x zoom option "z" fixed (HORIZ I/S was flipped)
 2) tkmedit read/dumps/propagate .mgz footer tags
 3) calcimg/tkstrip/wmfilter/fill propagate/add-their-cmdlines-to .mgz tags
 4) fix introduced view saved bitmaps bug (!)
 5) tkmedit can read/display 2 surface at once ("2" checkbutton on surf line)
 6) SubjectTools/MGHTools menus/actions updated
 7) more Expert Preferences for tkstrip/wmfilter/fill/surf
 8) now runs in Windows7 + VMWarePlayer + Centos5 + WMWareTools
 9) tkmedit zoom ('z') fixes
10) tkmedit "val:"<->"reg:" -- can read/reg/subsamp native (non-subsamp) stats


###############################################################################
UPDATE DETAILS (since Jan 2011, latest top)
###############################################################################

### UPDATE: 02 May 2026
--lib/help/tksurfer/{save,goto}_pnt: update
--tksurfer.c: sensibly rename: *vindex -> *selectedptr (in 2 functs below)
--tksurfer.c: same fix as below for (script-only) select_talairach_point
--tksurfer.c: funct below passed &selected(def=-1) so deref rngchk brks 1stcall
--tksurfer.c: rm bad select_orig_vertex_coords err chk *vindex - broke 1st GOTO
--tksurfer.tcl: bind toggle nobicurvfadeoverfthresh mid-clk F3 panel "cv" radio
--tksurfer.tcl: cut_{line,vertices},uncut_connected_vertices: warn no selected
--lib/help/tksurfer/curv_tick: update
--tksurfer.tcl: bind toggle nobicurvfadeoverfthresh mid-clk "[ ] curv" tickbox
--tksurfer.c: add/exp nobicurvfadeoverfthresh:no diff fade to sulc/gyr > fthresh
--tksurfer.tcl: disp-annot,chng-annotbordflag reselect_selected_list:select->top
--tksurfer.c: finally fix undo logic! select_vertex w/select=-1 restarts baklist
--tksurfer.c: back out: draw_curs 3x for all b/c weird offset select problem?
--tksurfer.c: reselect_selected_list: draw last-in-list curs 2x extra fix fail?
--lib/help/tksurfe/clks: update, undo
--tksurfer.c: glxwin 'cmd-z' restores prev selected list & redisplays
--tksurfer.c; add restore_selected_list()
--tksurfer.c: clear_vertex_marks_list saves prev (if not already clr:2Rclk help)
--tksurfer.c: glxwin 'd' key does reselect_selected_list to see over annot
--tksurfer.c: add/export reselect_selected_list()
--csurf: warn {SUBJECTS,FUNCTIONALS}_DIR autoset to inside csurf (by FS Env)
--update-csurf: non-verbose untar if "ggo" to not clog csurf.log
--csurf: updatecsurfcmd: find moved-aside name before run update-csurf
--csurf: check csurf install/update dir writable
--csurf: add un-quarantine commands to final updatecsurfcmd popup
--update-csurf: echo pwd/install dir!
--update-csurf: Mac warns run xattr (new tar), don't autodo b/c req's passwd
--csurf: Preferences->Update Csurf:setupupdatecsurf,updatecsurfcmd: update-csurf
--update-csurf: add "ggo" for don't-ask install
--8 file/label lightweight 'annots' (8M) added to fsaverage/fsaverage-ADDITIONS
 {rh,lh}-CsurfMaps1_MNI152.label
 {rh,lh}-CsurfMaps1_MNI305.label
 CsurfMaps1_newcurv-{rh,lh}.w
 CsurfMaps1_old3byte-{rh,lh}.w
--tksurfer.c: write_label_hdr() includes Talairach 152 vs. 305, normd{frac}samp
--lib/help/tksurfer/val_{lab,write}: update
--tksurfer.tcl: mid-click "val;" makes allverticesflag,val2newcurfflag popup
--tksurfer.tcl: left-click "label:" auto-pops up label_label help
--lib/help/tksurfer/swapstatval: update
--tksurfer.tcl: add copy_idnum_val to S/V (swap stat val) button bar
--tksurfer.c: add/export copy_idnum_val (for writing annot-like wfile/label)
--lib/help/tksurfer/comp_grad: doc hidden compute_laplacian <0,1,2> funct
--tksurfer.c: scale_brain() updates tcl-exported glxzoomfact (not yet used)
--tksurfer.c: trunc pval dots w/fthresh (not fully general for all mod flags)
--tksurfer.tcl: rm 3 Calc Laplacian (includelaplacian=0),leave procs,tksurfer.c
--tksurfer.tcl add 3 Calc Laplacian buttons, comp_disp_laplace proc
--tksurfer.c: add/export compute_laplacian (curv,val,phase) -> valbak
--wrappers.tcl: allow "whitespace" (use proc null), added into GR gradient menu
--tksurfer.tcl: findgradrevctrls help: non-existent findgradrev -> comp_grad
--lib/help/tksurfer/{gradfsarrows,comp_grad}: updates
--tksurfer.tcl: add flipRHpolararrowsflag to FIELDSIGN and GRADIENT ARR
--tksurfer.tcl: do_gradrev: find_grad..,write pval wfile, borddots/val display
--tksurfer.c: add/export pvalborddotflag/dthresh to view .pval above thr as dots
--tksurfer.c: find_gradient_reversals: get same ang from 2D/3D grads dot prod
--lib/help/tksurfer/gradfsarrows: update stale hotkeys, regularize
--tksurfer.tcl: don't trunc lg early-area curv gradients (curv avg flatter/OK)
--tksurfer.c: find_gradient_reversals: replace w/new neighbors-only version
--tksurfer.c: add/export find_gradient_reversals (similar to find_retin_borders)
--tksurfer.tcl: findgradrevctrls popup to run find_gradient_reversals
--tksurfer.tcl: calc gradient reversals make-popup-button to GR button R-click
--lib/help/csurf/setupfield: respect reordered parms
--csurf: Setup Calculate Fieldsign, Borders: dividers, better var description
--lib/help/tksurfer/comp_grad: fix avggradvecbak{3d}flag->reggradvecbak{3d}flag

### UPDATE: 17 Sep 2025
--lib/help/tksurfer/gradfsarrows: update
--tksurfer.c: bugfix: compute_{gradient,surfgrad} unset valbaks_cart2polarflag
--tksurfer.tcl: do_grad2col bugfixes: accept 3D surfgrad, blk reggrad, colscale
--lib/help/tksurfer/comp_grad: update
--tksurfer.c: add/export flipRHpolararrowsflag (def=1) for draw_arrows{2,3}d
--tksurfer.tcl: add 6 brainregion avg gradient buttons to GR gradient buttonbar
--tksurfer.tcl: add reggradvecbak{3d}flags to FIELDSIGN and GRADIENT ARROWS ppup
--tksurfer.c: draw_arrows{2d,3d}() can also just draw brainregion[i].avgvtx k's
--tksurfer.c: add/exp reggradvecbakflag,reggradvecbak3dflag,reggradvecloadedflag
--tksurfer.c: add/export compute_brainregion_avggrads
--mk0: insttmp finally puts tardate also into all-help
--lib/help/tkurfer/label_toggle: document dthreshfact, reason for it
--tksurfer.tcl: add $dthreshfact hack to LABEL CONTROLS popup
--lib/help/*/*: shorten lines for AllHelp (48 vs. 50 wide to reduce white space)
--lib/help/tksurfer: update 18 helpfiles: incl buttonbar buttontext for search!
--tksurfer.tcl: labelR_val: better error/help if trying to read .cols file
--tksurfer.tcl: listcmd_tcl: don't dup dropdown scripts csurf start from subjdir
--lib/tcl/zz-examples/assemble-render-maps.tcl: dthreshfact anti-labelflash hack
--tksurfer.c export dthreshfact->tcl: desperate hack fix flashy labels w/script
--csurf: add Expert Preferences->Views alt font, pass -fontfile to tksurfer
--mk0: 04f: combine separate but dependent freetype,ftgl compiles to "libftgl"
--tksurfer.c: add opt -fontfile for diff .ttf font put into $CSURF_DIR/lib/fonts
--tksurfer.c: 1 cm label same col as scalebar, tweak bar thick, font size/pos
--tksurfer.c: separate draw_areanames dthresh (depth) inflated vs. folded surf
--tksurfer.c: fix linux compiler cast warnings
--mk0: 04e: add freetype, ftgl for static tksurfer compile
--tksurfer.c: new fast draw_areanames: cmp testpnt depth w/glReadPixels readback
--tksurfer.c: draw_areanames: test neigh to 6th order to fix sloppy re-select
--tksurfer Makefile: LIB_PATH mv X11 after freetype/ftgl to get static freetype
--lib/help/tksurfer/{label_write: update
--tksurfer.tcl: "Write Region Centers" butt R-clk "W" on "label:" line buttbar
--tksurfer.c: draw_areanames: add brightness cue to reduce edge flashing
--tksurfer.c: draw_areanames: hacky/slow/working select_vertex occlusion test
--mk0: dist/insttmp: copy luxisb.ttf to $CSURF_DIR/lib/fonts
--tksurfer.c: add write_annot_region_centers (scriptsdir:AnnotRegionCenters.txt)
--lib/help/tksurfer/{label_toggle,meshr/g/b,label_read}: update
--tksurfer.c: fix scalebar label scaling/placement
--tksurfer.tcl: if vars exist, add $areanamesflag, annot-warn to LABEL CONTROLS
--tksurfer.c:   newvars: export: fontname,areanamesflag, intern: FTFont
--tksurfer.c:   newfunc: export:draw_areanames intern:initfont,drawstr_centonvec
--tksurfer.c:   #include FTGL/ftgl.h, #define FTGLFONT to included luxisb.ttf
--tksurfer.c: add ifdef'd __cplusplus FTGL font code below (req's g++) 3 above:
--tksurfer.c: add find_regionvtx_nearest_avg, always do (fast) in read_mgh_annot
--tksurfer.c: add vec2glxwinpix so to use glBitmap (vs. glRasterPos) for FTGL
--tksurfer Makefile: logic so just changing CMPL to g++ fixes libs/includes
--tksurfer.c: add find_regionvtx_nearest_avg, always do (fast) on read_mgh_annot
--tksurfer.c: add vec2glxwinpix to use glBitmap (vs. glRasterPos) for FTGL
--tksurfer.c: finally rm stale select_vertex v->dist test (cause of occas fail?)
--lib/help/tksurfer/{fmid,sfmid}: doc inverse relation fmid,fslope
--lib/help/tksurfer/setuprender: update
--csurf: tick/untick "FTamp" triggers ask reset using askresetcmplxthresh2sane
--csurf: reset chks $renderscanlists($page,fourierampflag): sm sqrtF vs lg FTamp
--csurf: extract ask reset code to proc askresetcmplxthresh2sane
--csurf: select_complexstatsource asks reset thresholds on select "PhaseMask:"
--csurf: addrenderscan: sig+coher PhaseMask, fix select buttnames, shrink title
--csurf: fourier panel Painted VertexList Files (outputs) adds _c coherence
--csurf,mk0: "All Help Contents" starts with all-help, new/calc all-help header
--lib/help/csurf/{setupfour,setuprender}: document coherence stat mask
--csurf: View Functional Data (already) loads new *_c-$hemi.w
--csurf: paintcmd (PAINT button) also paints new fourier.c _c coherence output
--fourier.c: always also write out coherence to _c BRIK, update usage
--lib/help/tksurfer/nonbinaryfs,mk0,tksurfer.tcl -> helpfile name: gradfsarrows
--tksurfer.tcl: fstickctrls warn re-calc grad areaoutliermin,rmgradoutliersflag
--tksurfer.c: centerarrowsflag now also works for curved 3d surface arrows
--lib/help/tksurfer/{arrownorm,nonbinaryfs}: update
--tksurfer.tcl: warn (both popups) re-calc gradient if change rmgradoutliersflag
--tksurfer.tcl: FIELDSIGN and GRADIENT ARR: $rmgradoutliersflag
--tksurfer.tcl: FIELDSIGN and GRADIENT ARR: $sdoutlierfact, $areaoutliermin
--tksurfer.tcl: FIELDSIGN and GRADIENT ARR: $centerarrowsflag, $angoffrevarrflag
--tksurfer.tcl: FIELDSIGN popup: sdoutlierfact,areaoutliermin,rmgradoutliersflag
--tksurfer.tcl: ARROWS/NORMALS/POINTS popup: add $rmgradoutliersflag
--tksurfer.c:  add/export: double sdoutlierfact,areaoutliermin
--tksurfer.tcl: bind to warn filledarrowsflag w/3Dsurf (no space Lbracket,plus!)
--tksurfer.tcl: move up fstickctrls to unoverlap buttonbar if from R-click GR
--lib/help/tkmedit/*: regularize header lines in 109 helpfiles
--lib/help/tksurfer/*: regularize header lines in 280 helpfiles
--tksurfer.tcl: R-clk GR, clk unmarked fstick -> fieldsign/gradient arrows ctrls
--tksurfer.tcl: mid-clk DIST now reports edges (tksurfer.c genstrret_1k append)
--tksurfer.c: compute_avg_edgewidth appends edge count to genstrret_1k
--lib/help/tksurfer/dist: update, Euler, howto calc edges from vtxs,faces
--tksurfer.tcl: middle-click on DIST button does compute_avg_edgewidth
--tksurfer.c: add/export compute_avg_edgewidth, output to log and $genstrret_1k
--csurf: add missing SMOOTH types to help panel (valonly,stat,grad)
--lib/help/tksurfer/smooth_stat: new (update mk0, add R-clk to tksurfer.tcl))
--lib/help/tksurfer/smooth: update (add smooth_stat to SMOOTH buttonbar)
--tksurfer.tcl: add smooth_stat to SMOOTH R-click buttonbar (no vis radiobutton)
--lib/help/tksurfer/softtruncwidth: new, "soft" popup cp avoids new allhelp ent
--lib/help/tksurfer/{smooth,smooth_steps,smooth_weight}: smooth_stat, alt smooth
--tksurfer.c: add smooth_stat (vs. currently using swap stat val and smooth_val)
--lib/help/tksurfer/smooth_weight: update for popup
--tksurfer.tcl: mini popup on R-click "w" smoothing to control $halfweightdist
--lib/help/tksurfer/smooth: update
--tksurfer.tcl: check appropriate fields loaded for all SMOOTH/fillholes functs
--tksurfer.tcl: combine SMOOTH/smoothsteps buttonbars, expand -> all smoothtypes
--lib/help/tksurfer/restore: document restore_zero_position, make_lateral_view
--tksurfer.tcl: tick isocont makes popup (prev just R-click isocont label)
--lib/help/csurf/setuprender: fix $revphaseflag, $angleoffset, other flags
--tksurfer.tcl: "sft" -> "soft" (unoverlap sfthresh!)
--csurf: defsmooth down if fsaverage: ecc:20/20->3/2 (rend,stat), pol:10/10->2/1
--csurf: block auto change to fsaverage if started from scripts dir
--lib/help/csurf/setuprender: update: for new "labels"
--csurf: update/homogenize/improve View Functional Data panel dual-field labels
--lib/tcl/{eccen,polar,twocond}-{views,flat}.tcl: pass/use $smoothstepsstat
--lib/tcl/{eccen,polar,twocond}-{views,flat}.tcl: separate val/stat smooth parms
--lib/tcl/{eccen,polar,twocond}-{views,flat}.tcl: $smoothoverlaymaskflag ignored
--csurf: addrenderscan: rm "m" tickbox (smoothoverlaymaskflag now only 3D/tkmed)
--csurf: addrenderscan: add entry to distinguish data and stat smoothing
--csurf: surftestrender: pass $smoothstepsstat by env to scripts
--csurf: setdefaultparms: new: renderscanlists(def,smoothstepsstat) 5 ;#statonly
--lib/help/csurf/setuprender: update
--lib/help/tksurfer/{val_clear,smooth}: update
--tksurfer.tcl: add clear_stat button for "val:" line "CLR" buttonbar
--lib/tcl/{eccen,polar,twocond}-{views,flat}.tcl: can use $cpxangrealampflag
--csurf: addrender: cryptic "m" tick (smoothoverlaymaskflag) explain if changed
--csurf: addrender: bare tick to ignore dispersion w/smooth (cpxangrealampflag)
--csurf: surftestrender: pass $cpxangrealampflag by env to scripts
--csurf: setdefaultparms: renderscanlists(def,cpxangrealampflag) 0 ;#ignore disp
--lib/help/csurf/setuprender: add refs to 3 kinds of FT->percent at end
--lib/help/tksurfer/val_write: major update
--tksurfer.tcl: add COMPUTE AVG t-SERIES EACH VTX (do_computetseravgs) to popup
--tksurfer.tcl: rewrite RAW FOURIER TO PERCENT RESPONSE pop-up
--tksurfer.c: compute_dftamp2pcnt2stat div by avgrawamp in .stat if avgrawamp=-1
--tksurfer.c: compute_tseriesavg2stat from rawdata, export rawdata_{xyzt}dim
--lib/help/tksurfer/val_write: fix backwards "cat" command (!), FT amp doc
--csurf: empty tarfiledate -> "none" (local compile vs. mk0 insttmp tarfile)

### UPDATE: 07 May 2025
--update-csurf: Mac add unquarantine note at end
--update README.txt: maybe unquarantine (w/tar! don't auto-do since req's pwd)
--FreeSurferEnv.{sh,csh}: mention getonearch in unrecognized architecture error
--getonearch: fix for mac uname -p now returning "arm" (was "arm64")
--csurf/tksurfer.tcl/tkmedit.tcl: appnap OFF apple silicon (kernvers=BigSur=20+)
--add cerebmap20-dentate.tgz to csurf/cereb/updates distro
--make cerebmap20 compat cerebmap20-dentate-nuc from cereb2c-export-dentate-nuc
--rescale surfaces in cereb2c-export-dentate-nuc: flipscale{flat}.tcl, NOTES
--csurf: versions to startup stdout, regularize title bar versions
--tkmedit.tcl: save imgs w/"w" warns/allows save to new name ims read over start
--tksurfer.tcl: add to RESTORE button command/buttonmenu: restore_zero_position
--lib/help/tksurfer/patch: document restore_zero_position, rotate_brain_x -90
--mv font/g++/tksurfer.c/Makefile to new dir: tksurfer-ftgl
--update-sdsu-sereno: re-download UCSD fsaverage-labels, fsaverage-ADDITIONS.tgz
--tksurfer.c: couldn't get vtx-spec working, curr state left in tksurfer-ftgl.c
--tksurfer.c: add freetype/ftgl, compile OK, single lower left display
--mk0: add luxisb.ttf to $CSURF_DIR/lib/fonts
--tksurfer.c: g++: rm "or", clamp rgb, fix !const char's, signed/unsigned cmp's
--tksurfer.c: g++: (void *)->(short ***),etc in contig multidim array mallocs
--bin/noarch/mkbothlut: automatically does below
--HCP-MMP1ColorLUT-both.txt: ??? 255 255 255->Unknown 0 0 0 0 (fix tkmedit olay)
--cd $CSURF_DIR/dist/fsaverage-ADDITIONS/scripts; sh zz-getREADME.sh
--update README.txt's on pages.ucsd.edu, download to fsaverage-ADDITIONS
--bin/noarch/update-fsaverage; add CsurfMaps1.{mgz,+orig.BRIK}, orig+orig.BRIK
--fsaverage-ADDITIONS/mri: add orig+orig.BRIK (+6M inst .tgz)
--lib/tcl/annot2roi.tcl: add savesingleROIbriksflag (def=0)
--tksurfer.c: savesingleROIbriksflag: if def=0, delete 7G of single-ROI BRIKs
--lib/help/tkmedit/{im2entry,im2read}: update
--lib/help/tksurfer/script_annot2roi: update
--fsaverage-ADDITIONS: add HCP-MMP1.mgz, HCP-MMP1+orig.{BRIK,HEAD} ($subj/mri)
--tkmedit.c: detect {HCP-MMP1,Csurf}ColorLUT-both.txt, rm seq_renum_lut (seq'd)
--tkmedit.tcl: detect {HCP-MMP1,Csurf}ColorLUT-both.txt, rm seq_renum_lut(seq'd)
--mk0: add mkbothlut: tclscript to mk hemi-specific lib/lut/*ColorLUT.txt files
--tksurfer.c: merge_idnum_briks makes unique idnums (lh,rh+maxrh)
--lib/help/tkmedit/im2{entry,read}: update
--update-sdsu-sereno: fix cerebellum updates bug
--lib/help/tksurfer/script_annot2roi: update
--tksurfer.{c,tcl}: rename fill_brik_holes -> fill_idnumbrik_holes
--update-fsaverage: add CsurfMaps 3D ROI files
--fsaverage-ADDITIONS: add CsurfMaps1.mgz, CsurfMaps1+orig.{BRIK,HEAD}
--tkmedit.c: timeout overlay double-mid-click popups
--tkmedit.tcl: im2 read mgz parcellation also calls seq_num_lut if match Csurf*
--tkmedit.c: read_val2rgblut uses seq_renum_lut if CsurfColorLUT.txt recog'd
--tkmedit.c: add/export seq_renum_lut for annot-derived sequential LUTs
--annot2roi.tcl: use neighfracthresh (def=0.8) vs. threshneigh
--tksurfer.c: fill_brik_holes: threshneigh arg (1-26) -> neighfracthresh (0-1)
--tksurfer.c: use above in fill_brik_holes/merge_idnum_briks/shortcorbrik2intmgz
--tksurfer.c: new lazy global 3D tmpshortbrik avoid Mac repeat malloc/free crash
--tksurfer.c: add makeshort3D: fill_brik_holes/merge_idnum_briks/shortcorbrik2..
--lib/help/tksurfer/script_annot2roi: major update
--annot2roi.tcl: mk "annot:" dropdown like main "label:" (.annot only,!setfile)
--annot2roi.tcl: convert merged BRIK to mgz parc if subject is fsaverage
--annot2roi.tcl: if both right/left hemi idnum ROI BRIKs present, merge them
--tksurfer.c: add/export merge_idnum_briks (non-general: short, same dims)
--tksurfer.c: add get_brikoris (not exported)
--tksurfer.c: get_{brik,bfloat}dims return vs. harsh xit, pass BRIK vs. HEAD
--tkmedit.tcl: add CsurfMaps1,MY_ANNOT to 'mgh'seglabstemlist to autodetect parc
--annot2roi.tcl: add fill3Dholesflag to run fill_brik_holes
--tksurfer.c: fill_brik_holes: patch all-in-one BRIK pial surface holes
--annot2roi.tcl: disable/normal feedback for search/nosearch, frac/mm options
--tksurfer.c: add/export shortcorbrik2intmgz: 256^3 all-in-one BRIK -> mgz parc
--tksurfer.c: get_brikbyteorder: not exported
--annot2roi.tcl: rm redundant sampclustctrls popup (main panel has enough)
--tksurfer.tcl: add R-click help for entry labels on sampclustctrls
--wrappers.tcl: controls proc: uniq window id from new global: $ctrlswinid
--tksurfer.tcl: regularize sampclustctrls{win}, return win for reposition
--tksurfer.tcl: fix comment-bug crasher "E## force opaque ignoring "tran" entry"
--tksurfer.tcl: select_patch: after 100 to (try to) improve missed shift key
--annot2roi.tcl: improve feedback sequence, better bugouts
--annot2roi.tcl: add sampclustctrls popup, unoverlap by reposition up
--annot2roi.tcl: fix combobox wasn't loading '-' style like CsurfMaps1 (!!)
--annot2roi.tcl: fsaverage 3D ROIs: auto-make pseudoscandir/funct/regdat
--annot2roi.tcl: fsaverage 3D ROIs: force user to mk pseudofunct scandir w/csurf
--tksurfer.c: smooth_steps alt functs report filled/eroded
--tksurfer.tcl: add annoterode button to R-click smooth_steps help
--tksurfer.tcl: $newreadfulllabflag (tcl) overrides def just show label borders
--lib/help/tksurfer/{redraw,arrownorm,label_write}: bigcursorflag behavior
--csurf: change startup subject to fsaverage if it exists
--lib/help/tksurfer/{redraw,arrownorm}: update
--tksurfer.tcl: add toggle bigcursor button to REDRAW right-clk popup
--mk0: 04a: also incl EMAIL in dist and insttmp, UPDATES in dist
--tksurfer.c: .._nearest_annot: foreign surf vtxcnt unknown: allow 'off edge' k
--tksurfer.tcl: labelW_randcolannot/write_statids2randcolannot chks overwrite
--tksurfer.tcl: better HOWTO save/see result on 'paintballs' popups
--tksurfer.tcl: isocont popup action button sets isocontourflag
--tksurfer.tcl: R-clk smoothsteps buttbar for numer/non-numer smooth steps opts

### UPDATE: 12 Nov 2024
--lib/help/tksurfer/{smooth_steps,label_read,selectdmax}: update
--tksurfer.c: read_label_to_nearest_annot_using_col: ignore ripflag vtxs
--tksurfer.c: fill_annot_holes_neigh: ignore ripflag vtxs to speed high neiorder
--tksurfer.c: fill_annot_holes_neigh: add neiorder=5 for smaller surfaces
--tksurfer.c: fix fill_annot_holes bugs (fill val sometimes 0, then paren bug)
--tksurfer.tcl: rm "annotholes-more" b/c fill_annot_holes_neigh is more general
--tksurfer.c: rm fill_annot_holes_more (redundant w/fill_annot_holes_neigh)
--tksurfer.tcl: "annotholes-neigh" uses funct: C/tcl fill_annot_holes_neigh
--tksurfer.tcl: overload smooth steps: add "{annot,label}holes-neigh popup
--tksurfer.c: add fill_annot_holes_neigh(neiorder,annotedfrac) general funct
--tksurfer.tcl: smoothsteps: "{annot,label}holes-more" -> fill_annot_holes_more
--tksurfer.c: add fill_annot_holes_more(): (filled nei minus 3 (vs. minus 2)
--tksurfer.tcl: add no-hotkey "D" button: read_label_to_nearest_annot_using_col
--tksurfer.c: read_label_to_nearest_annot_using_col(): for updated surfaces
--tksurfer.c: fix write_label_hdr check-fp-writable-code on Linux (& O_ACCMODE)
--tksurfer.tcl: disp annot prints totarea all regions (except Unknown) for csurf
--tksurfer.c: tot area annot regions (except Unknown) to genstrret_1k/csurflog
--tksurfer.tcl: add $lighttwosidedflag to lights popup from R-click help buttbar
--tksurfer.tcl: fix R-click report popups for current ta/cu button state
--csurf: hack^2: slow mac10.15 csurf log hangs tkwait/GLwin if appnaphack so blk
--mk0: comment out version-name tksurfer (leave update-tksurfer for later)
--tksurfer.c: set_{real,complex}_color: blk annotmask,adjphase off edge if k=-1
--mk0: add update-tksurfer sh script to dist
--update-tksurfer: toggles tksurfer symlink between 10.6/10.15
--mk0: version-name 10.6 tksurfer compile, incl 10.15 compile, tksurfer->symlink
--tksurfer.tcl: fix buttonbar REDRAW (forgot to make def cmd bind for event gen)
--tksurfer.tcl: add $insidesurffact to brightness/position lights ctrls
--lib/help/tksurfer/{redraw,lights,blufact,selectdmax}: update
--tksurfer.c: draw prev selected inside surface vertices w/points
--tksurfer.tcl: lights bright/pos ctrls: shift-R-clk-REDRAW, REDRAW buttonbar
--tkmedit.c: do 305->152 xform if $xform_mni_305to152_flag (6 fwd's, 1 inv)
--lib/help/tkmedit/xfm305to152,mk0: new helpfile
--tkmedit.tcl: "152" tickbox for $xform_mni_305to152_flag under SAGITTAL
--tkmedit.c: load_invert_305to152_xform() at startup, $xform_mni_305to152_flag
--tksurfer.c: write_annotcol{s}_timecourse.. warns usecurrcoords cancels norm mv
--tksurfer.c:xform_mni_305to152_flag picks find_orig_vertex_coordinates edit.dat
--tksurfer.c: find_orig_vertex_coordinates always reports both MNI 305 and 152
--lib/help/tksurfer/: update multiple help (6 renames, 305 vs 152, 15 files)
--tksurfer.c: export selected (curr vtx, starts -1)
--tksurfer.c: rm xform_mni_305to152(), subst. mni_transform_point(): 5fwd/2inv
--tksurfer.c: add load_305to152_xform() to startup seq: always load, invert
--tksurfer.c: new global Transform's: {inverse_}mni_305to152_transform
--tksurfer.tcl: R-click-"ta" reports MNI 305 vs. MNI 152
--tksurfer.tcl: select Talaiarch "ta" sets up choose MNI 305 vs. MNI 152
--tksurfer.c: test/add xform_mni_305to152(), add/export $xform_mni_305to152_flag
--tksurfer.tcl: C:write_selected_list_to_label->write_val_selected_list_to_label
--tksurfer.tcl: copy-C:write_annotedcol_autoname-> write_val_annotedcol_autoname
--tksurfer.c: rename:write_annotedcol_autoname ->  write_val_annotedcol_autoname
--tksurfer.c:write_selected_list_to_label->write_val_selected_list_to_label(syn)
--tksurfer.tcl: rename: extract_unmasked_flag -> unmasked_to_label_flag
--tksurfer.tcl: rename: extract_overlays_flag -> unmasked_to_labels_flag
--tksurfer.c: fix write_selected_list_to_label header update bug if bigcursorflg
--tksurfer.c: fix all synonyms to use an extra Tcl_CreateCommand
--tksurfer.c: rename write_labeled_vertices->write_val_visible_vertices (bakcmp)
--searchlight{area,diff}.tcl: write_labeled_vertices->write_val_visible_vertices
--tksurfer.tcl: copy-C: write_labeled_vertices->write_val_visible_vertices
--tksurfer.c: write_selected_list_to_label uses new functs, but dup'd for neigh
--tksurfer.c: write_annotedcol_autoname uses 2 new funct
--tksurfer.c: write_{annotcols,annotcol}_timecourses_stats DON'T (do separately)
--tksurfer.c: write_val_{annoted,annotedcol,unmasked}_vertices use 2 new functs
--tksurfer.tcl: usecurrcoordsflag/usetalcoordsflag ticks to "|ta|cu|" tixSelect
--tksurfer.c: extract new funct: write_label_vtxline,write_labeled_vertices uses
--tksurfer.c: extract new funct: write_label_hdr, write_labeled_vertices uses
--lib/help/tksurfer/nsamp_{search,dfrac,max,min,fracmax,fracmin}: update
--tksurfer.tcl: fix R-click help on "label:" label popup
--lib/help/tksurfer/label_write: update
--tksurfer.c: find_orig_vertex_coordinates, write_labeled_vertices use it
--tksurfer.c: extract new function: move_along_normal(k,vb,x,y,z,&x2,&y2,&z2)
--tksurfer.tcl: overload "c2lab" button with usetalcoordsflag
--tksurfer.c: separator: '=' to '_' for write_val_{annotedcols,idnum}_vertices
--tksurfer.tcl: event generate buttonbars for R-clk help for REDRAW, RESTORE
--lib/help/tksurfer/selectdmax: update
--tksurfer.tcl: overload "clo" button with $selectinsideflag
--tksurfer.c: if $selectinsideflag, draw cursor underneath surface (instead)
--tksurfer.c: add/export $selectinsideflag (N.B.: cancels outside select!)
--tksurfer.tcl: display label (labelD_display) opens label control popup (duh!)
--lib/help/tksurfer/isocont: update
--tksurfer.tcl: add isocontour controls pop-up for R-click "isocont"
--lib/help/tksurfer/{label_read,label_toggle}: update
--tksurfer.tcl: padlabelvtxsflag in label tickbox popup, hotkey, warn label read
--tksurfer.c: add padlabelvtxsflag to read_label_to_annot_using_col (also neigh)
--tkmedit.tcl: "im2:" label popup: better description (test vs. apply)
--lib/help/tkmedit/im2label: clarify transpar overlay test vs apply to editable
--tkmedit.c: COMPARE/TRUNC: event generate -> call proc, fix TRUNC cmd-. bind
--tkmedit.tcl: COMPARE: event generate -> call proc, cleanup TRUNC/PF/PFGAU
--tksurfer.tcl: fix def bind for Return in label: entry (invoke fail w/no-cmd)
--tksurfer.tcl: fix def bind for Return in val: entry (invoke fail w/no-cmd)
--tksurfer.c/tcl: check " invoke" of "buttons $f SOMEBUTTON { }"
--tkmedit.c: WMTRUNC,CORONAL invoke -> event generate (b/c empty cmd/only bind)
--tkmedit.tcl: change invoke to event generate: SMOOTHGAUSS,TRUNC,CORONAL,TEST
--tkmedit.c: COMPARE Xkeys: add alt/cmd-C for COMPARE
--tkmedit.c: COMPARE Xkeys: invoke->event generate (b/c empty cmd/only bind)
--tkmedit.tcl: COMPARE hotkeys: add alt/cmd-C for COMPARE
--tkmedit.tcl: COMPARE hotkeys: invoke->event generate (b/c empty cmd/only bind)
--tkmedit.c,tcl: search " invoke" of "buttons $f SOMEBUTTON { }" -> event gen
--tkmedit.tcl: mv up imim2 ctrls un-overlap TRUNC buttbar (not if from OP butt)
--lib/help/tkmedit/wmtrunc: add imim2op help (overlap w/imim2op OP help)
--tkmedit.tcl: add imim2op colspace ellipse to TRUNC buttbar, ctrls to OP
--tkmedit.tcl: rm do_imim2op arg
--tkmedit.tcl: add buttbar for SMOOTH{STRUCT/STATS} button, incl calc grad x/y/z
--tkmedit.tcl: add buttonbar for PF,PFGAU butts (event gen hack for compact)
--tkmedit.c: catch crash in FILL struct 3D ROI if (irrelevant) im2(i) not loaded
--tkmedit.tcl: add buttonbar for FILL button (event gen hack for compactness
--tkmedit.tcl: COMPARE/TRUNC: 'after 1' fix butt state race after bind->proc
--tksurfer.tcl: put neighbor order info on paintball popup into
--tkmedit.tcl: add toggle linearflag button to COMPARE buttonbar
--tkmedit.tcl: add buttonbar for COMPARE button, change bind's to proc's
--tkmedit.tcl: buttonbar for F3 TEST butt (event gen hack keep binds like APPLY)
--tkmedit.tcl: buttonbar for CORONAL (event gen hack to keep binds like SAG/HOR)
--tkmedit.tcl: convert TRUNC butt bind's to procs (rm event generate hacks)
--tkmedit.tcl: section dividers for readability

### UPDATE: 26 Apr 2024
--tksurfer.tcl: new buttonbar for areal-line "D" button
--tksurfer.tcl: new buttonbar for "SMOOTH" button
--tksurfer.tcl: conv val-line "W" butt bind's to procs (rm event generate hacks)
--tksurfer.tcl: new buttonbar for val line "CLR" button (just 2: val, all)
--tksurfer.tcl: new buttonbar for val-line "CS" button (just 2: cluster, FDR)
--tksurfer.tcl: conv val-line "S/V" butt bind's to procs (rm event gen hacks)
--tksurfer.tcl: new buttonbar for val-line "R" button (bind's -> proc's)
--tksurfer.tcl: new button bar for label-line "X" butt (bind's -> proc's)
--tksurfer.tcl: new button bar for label-line "S" butt (bind's -> proc's)
--tksurfer.tcl: new button bar for label-line "T" butt (bind's -> proc's)
--tksurfer.tcl: conv fs-line GR butt bind's to procs (rm event generate hacks)
--tksurfer.tcl: conv label-line W butt bind's to procs (rm event generate hack)
--tksurfer.tcl: conv label-line R butt bind's to procs (rm event generate hack)
--tksurfer.tcl: conv label-line CLR butt bind's to procs (rm eventgenerate hack)
--tksurfer.tcl: conv label-line C butt bind's to procs (rm event generate hack)
--tksurfer.tcl: conv label-line D butt bind's to procs (rm event generate hack)
--tksurfer.tcl: fix stale funct name: read_poi_annot -> read_poi_to_annot
--lib/help/tksurfer/label_write: update write_sorted_by_pathdist_label
--tksurfer.tcl: R-clk label W for C pathsort: write_sorted_by_pathdist_label
--lib/help/tksurfer/label_write: update neighop_val2stat <nei:1-6> >op=3> usage
--tksurfer.c: add write_sorted_by_dist_label(), uses last click for start vtx
--sortlabel: standalone tcl script sorts label by Euclidean dist from start vtx
--tksurfer.tcl: sort Dijk label to pathorder, opt insert overlay data into label
--tksurfer.tcl: better feedback on Dijk output file, check overwrite
--tksurfer.tcl: warn re-run startup, block init-run non-standalone SURFACE-STATS
--tkmedit.c: saveim_for_undo() before flip_corview_xyz, im2wmedits_to_im
--tkmedit.c: add parallel image window [shift]-ctrl-left-click for undo/redo
--tkmedit.tcl: update cmd-z/Z for new extracted saveim's
--tkmedit.c: 1-step redo_edit(), extract/export saveim_for_redo(), undoeditflag
--tkmedit.c: rm edit_pixel {UNDO,REDO}_EDIT to export functs {undo,redo}_edit()
--tkmedit.c: fix off-edge access of tmp array for finding existing imprevnums
--tkmedit.tcl: add imim2op help to F4 panel ellipse parms
--lib/help/tkmedit/{all,clks,wmtrunc,wmfilter{std,gau},smoothstats,clks,imim2op}
--tkmedit.tcl: bind tools window cmd-z to undo
--tkmedit.c: saveim_for_undo: smooth_3d,smooth_3d_nn,imim2op
--tkmedit.c: saveim_for_undo: visible_to_im/norm_allslices_toim2
--tkmedit.c: saveim_for_undo: crop_im_using_im2cols, crop_im_using_im2cols_save
--tkmedit.tcl: TRUNC/PF/PFGAU run_wmfilter does saveim_for_undo
--tkmedit.c: trunc undo's to num prev sequential edits, export saveim_for_undo
--tkmedit.c.c: implement 4-step undo stack/circbuff (TODO: undo stack)
--tksurfer.c: fixed missed shift/ctrl/alt keyreleases b/c of popups
--csurf: cbx:listcmd_mri for mritypes combo to force update before dropdown
--tkmedit.c: fix shift/ctrl/alt KeyRelease missed b/c of popups (force 0 before)
--tkmedit.c: 2-step undo (but no redo since no undo stack: curr im overwritten)
--tkmedit.c: export right_click (undo spdtest): alloc imprev like im: 17% better
--lib/help/tkmedit/nonbinaryfs: update
--tksurfer.tcl: add FIELDSIGN/GRADIENT popup button for sparse arrows defaults
--lib/help/tkmedit/undoedit: new helpfile
--tkmedit.c: cmd-z in image window for undo edit
--tkmedit.tcl: proc editfile pre-deletes any stranded script swapfiles
--tkmedit.tcl: "un" tickbox R of CORONAL to enable/disable undo edit ability
--tkmedit.c: implement 1-edit undo, export edit_pixel(),$undoeditflag (if slow)
--tkmedit.c: raise F3 interface to keep its bottom on screen
--tkmedit.tcl: fixed introduced mispelled "constrastslop"
--tksurfer.tcl: add centerarrowsflag to "phc" arr control popup, arrownorm help
--lib/help/csurf/tksurfer: mention SMOOTH val2stat searchlight popups
--lib/help/tksurfer/script_searchlight{area,diff},smooth
--tksurfer.tcl: pre-delete stranded TmpTclScript.tcl swapfiles
--tksurfer.tcl: proc editfile pre-deletes stranded TmpTclScript.tcl swapfiles
--tksurfer.tcl: add second alt SMOOTH controls popup for run neighop_val2stat
--tksurfer.tcl: add write_statids2randcolannot to "label:" line "W" (no hotkey)
--tksurfer.c: write_statids2randcolannot(): randcol-annot-from-neigh paintballs
--tksurfer.c: shuffleUInt() for write_statids2randcolannot()
--tksurfer.c: grow_stat_idnums(): grout randcol nearest neighbor patches
--tksurfer.tcl: put code for tickbox binding into do_grad2col, binding uses it
--wrappers.tcl: remove +2 from controls edlabval width test for narrower
--tksurfer.tcl: DEFAULT LINE/FILL ARROWS butt FIELDSIGN popup (GR already does)
--tksurfer.c,tcl: arrowheadtype->filledarrowsflag, arrowheadfrac->append "auto"
--tksurfer.c,tcl: rename: line_arrowbarbangle, filled_arrow{tip,barb}angle
--tkmedit.tcl: TRUNC popup: disable 2nd struct-save bounds unless im2boundsflag
--tksurfer.tcl: add arrowhead{frac,min,angle} to FIELDSIGN and ARROWS popups
--tksurfer.tcl: fix Ret in arrowline FIELDSIGN popup bound to PRUNE_ARROWS but
--tksurfer.c: export arrowheadfrac, arrowheadmin, arrowheadangle (rad->deg)
--tksurfer.tcl: Return in gridsize entry does prune_arrows
--tkmedit.tcl: button bar for TRUNC butt, also put up bounds popup (move it up)
--tkmedit.tcl: ctrl-R-click TRUNC for crop_im_using_im2col_save()
--tkmedit.c: crop_im_using_im2col_save(): also save im within $edit_{lo,hi}lim
--lib/help/tkmedit/{wmtrunc,truncparms}, lib/help/csurf/tkmedit: update
--leb/help/tksurfer/{comp_grad,smooth}: update
--tksurfer.tcl: add arrownormflag to FIELDSIGN and GRADIENT ARR CTRLS
--tksurfer.c: fix draw_arrows3d arrownormflag bug (dz accidentally repeated dx)
--tksurfer.c: new prune_arrows algorithm (nearest vs. 1st), add {make,free}int3D
--tksurfer.tcl: PRUNE ARROWS/gridsize/prunearrowsflag: FIELDSIGN/GRAD ARR CTRLS
--tksurfer.c: export prune_arrows(), prunearrowsflag
--tkmedit.tcl: add toggle circleflag to "rad" label, fix lib/help/tkmedit/brush
--tkmedit.c: TEST/APPLY also writes to tcl cmdlog, demo standalone tcl script
--tkmedit.c: print norm tcl script for TEST or APPLY (already to tcl cmd log)
--tkmedit.c: add contrast ramp into spherical norm
--lib/help/csurf/tkmedit: update image window popop help
--tkmedit.c: add/export $edit_{lo,hi}lim2 for shift-left click edits using im2
--tkmedit.c: add ctrlkey to dbl-clk image win help to block edit->blk,tcourse
--tkmedit.tcl: overload "la" tickbox with toggle $im2boundsflag
--$im2boundsflag (so can see editable im while using im2 bounds)
--lib/help/tkmedit/truncparms: new helpfile, add to mk0
--tkmedit.tcl: new helpfile for TRUNC,PF entries: truncparms
--tkmedit.c: shift-left-click edits pix to gray_hilim if within white_{lo,hi}lim
--lib/help/tkmedit/wmtrunc: update
--tkmedit.c: crop_im_using_im2cols() now accepts im2 range (like replace cols)
--tkmedit.c: replace_cols -> cp_im_to_im2_replacing_cols: (vs. inplace->blink)
--tkmedit.tcl: 5th overload TRUNC button to replace col range with single color
--tkmedit.c: replace_cols(): replace editable colrange using TRUNC, PF entries
--tkstrip.c: do_one -> do_all_glx_events, add to shrink for live rotate
--tkstrip.c: double click raises GLwin, make -insurf option work
--tkmedit.tcl: SAVEIMG (orig img name) warns when new img set read in over orig
--tkmedit.tcl: ctrl-mid-TRUNC cp im->im2 repl $white_lolim-hilim w/$gray_hilim
--tkmedit.c: crop_im_using_im2col(): crop col set by $white_lolim
--lib/help/tkmedit/{compare,bwslope,test1,all}: updates
--tkmedit.tcl: R-clk "PieceWiseLinNorm" F3 panel ctrls constrast{nochange,slope}
--tkmedit.c: export contrastnochange,constrastslope for piecewise lin ramp hack
--tkmedit.c: hack norm_allslices_to_imnum to add centerable lin contrast ramp
--tkmedit.tcl: middle-click "contr:" label toggles linearflag
--tkmedit.tcl: overload COMPARE button w/visible_to_im (contr-adj'd to editable)
--tkmedit.c: visible_to_im(): cp contrast-adjusted editable image to editable
--wheel Makefile: rm -lGLU
--wheel.c: 03c: rewrite drawscale plain GL to avoid glu.h/-lGLU/gluPartialDisk
--tksurfer Makefile: rm -lGLU
--tksurfer.c: rewrite draw_colscaledisk plainGL avoid glu.h/-lGLU/gluPartialDisk
--lib/help/tksurfer/label_read: update
--tksurfer.tcl: add tenth label "D" overload: ctrl-mid-clk-D: labelcol_to_vtxcol
--tksurfer.tcl: fix R-clk "D" popup text: CalcOverlap ->ctrl-shift-mid-clk => R!

### UPDATE: 05 Sep 2023
--tksurfer.c: calc_area_per_brainregion zeros brainregions before area sums
--lib/help/tksurfer/{label,label_read}: update
--tksurfer.c: print_annot_to_log_ctab also prints $ctabfname.area w/area append
--tksurfer.tcl: count_mgh_annot_neigh2stat->areaneigh2stat,fix R-clk "D" menubar
--tksurfer.c: read_{mgh,gifti,poi,obj}_annot now always count_mgh_annot_neigh
--tksurfer.c: count_mgh_annot_neigh2stat -> count_mgh_annot_neigh+areaneigh2stat
--tksurfer.c: fix read_gifti_to_annot off-by-1 bug (extra junk entry in ctab)
--tksurfer.c: use print_annot_to_log_ctab() for read_gifti_to_annot
--tksurfer.c: count_vtxs_per_brainregion: ignore alpha at compare annot,mghannot
--tksurfer.c: rename: read_poi_annot -> read_poi_to_annot
--tksurfer.c: hack fix 0vtx cnt by set_annot_alpha *after* count (fixed above)
--tksurferc: functify print_annot_to_log_ctab() for read_mgh_annot
--tksurfer.c: read_mgh_annot:print_annot_to_log_ctab writes areas to csurf log
--tksurfer.tcl: fix "D" read-1-label popup: borders (new def), incl area, help
--tksurfer.c: double-mid click also prints brainregion area
--tksurfer.c: fix read_{gifti,poi,obj}_to_annot() as below
--tksurfer.c: read_mgh_annot() uses 2 functs below
--tksurfer.c: functify: count_vtxs_per_brainregion, calc_area_per_brainregion
--tksurfer.c: read_label_to_annot_using_col() updates filled_{origarea,currarea}
--ima2brik: don't check for missing 3dAFNItoANALYZE, fix parse "which" output
--src/afni/bin/zz-Darwin-test: 10.7to3d,lib{bz2.1,fontconfig.1,freetype.6}.dylib
--lib/help/csurf/{setupfunct,setupfour}: better slice timing documentation
--csurf: fouriercmd: can use fourier ... -taxisoffsets <TR> <sl> <s2> .. <slast>
--fourier.c: new opt: -taxisoffsets inp AFNI TAXIS_OFFSETS to slicetime correct
--fourier.c: document half-cycle phase correct for direct comp to SIMUL
--csurf: addfourscan: UseTAXIS vs. UseSliceOrd, check/warn parms
--csurf: READ HEADER ask biff already-read TAXIS_OFFSETS (b/c 3dvolreg non-prop)
--csurf: Setup Align/Funct: add Multiband Accel Factor, Slice Time Offsets List
--csurf: new saved functscanlists parms: mbaccel, taxisoffsets
--csurf: new procs: getafnitaxisoffsets, getafnimbaccel
--tksurfer.tcl: readtemplateframe leave popup, select_curv remake if diff frmcnt
--tksurfer.c: if annotmaskflag, don't leave padded border of masked annots
--tksurfer.c: make annotmaskflag also work when just borders (annotbordflag)
--tksurfer.tcl: default left-click "R" now req's *.label (was allowing *.annot)
--tksurfer.tcl: R-click "surf:" read_binary_surface printheaderflag -> surfhdr
--tksurfer.c: export new printheaderflag that doesn't exit (justheaderflag does)
--tksurfer.c: new func printf1k: like printf but also appends to genstrret_1k
--tksurfer.tcl: R-click on upper right "surf:" label lists vertexcnt,facecnt
--lib/help/csurf/{csurf,setuprawavg,setupimport}: bshort update
--lib/help/tksurfer/{val,val_read}: bfloat update
--tksurfer.tcl: read_real_or_complex_binary_values: std fmt cmplx bfloat's OK
--tksurfer.tcl: "val:" entry loads scandir *_000.bfloat's
--tksurfer.tcl: "val:" entry accepts *_000.bfloat, checks corresponding *.hdr
--tksurfer.c: export vertexcnt,facecnt to tcl for err check
--tksurfer.c: read_binary_values accepts mri_surf2surf *_000.bfloat's
--mk0: fix onearch! (dir check was using csurf, not csurfsrc!)
--mk0: change 'tail +N' to 'tail -n +N' fix Linux fail on lib/help/csurf/csurf
--ima2brik: fix crash on partial transfer
--mri2mpg: convert from csh to sh, chk for ffmpeg, always clear zzMPG
--mk0: rm ._ junk from Mac tarfile (COPYFILE_DISABLE), quit if pwd!=csurf
--add labelcol_to_vtxcol() to get label "paint" for other label compare
--make a complete CsurfMps1-updated fs5.3 fsaverage
--update-fsaverage: also copy HCP annot, mapping data labels,cols
--dist/fsaverage-ADDITIONS: update README.txt's
--{README.txt,UPDATES.txt}: incl update-{csurf,fsaverage}
--annot2roi.tcl: load csurf-dash-style CsurfMaps1 annots in dropdown, mk it def

### UPDATE: 02 Oct 2022
--fsaverage-ADDITIONS: update README.txt's, add update-csurf/fsaverage
--mk0: insttmp asks OK rm /tmp/csurf, /tmp/Csurf.app
--lib/help/tksurfer/label,label_{readcut,clear,read2val,write}: update
--csurf: print README.txt tarfile date (if there!) into csurf title bar
--bin/noarch/update-csurf: new sh script, added to mk0
--bin/noarch/update-fsaverage: new sh script, added to mk0, fsaverage-ADDITIONS
--tksurfer.c: add strcpyrmhemi() to avoid strcpy restrict violations (4 places)
--tksurfer.c: read_mgh_annot now runs set_annot_alpha(255) (also obj,poi,gii)
--tksurfer.c: restrict: (1) if obj mod thru ptr (2) r/w only allowed by that ptr
--tksurfer.c: no strcpy to origvar: restrict'd arg: 2 ptrs can't access 1 thing
--tksurfer.c: 10.6-compiled is fine, restrict crash appeared w/10.15 compile
--tksurfer.c: alfname/$annot def: CsurfMaps1, read_mgh_annot autoresets alphs
--fourier.c: strsep -> strtok for IRIX
--{tksurfer,tkmedit}.tcl: recognize IRIX64 so libTix8.4.3.so loads on sgi
--tk{surfer,medit,register}.c: incl zsh explanation in warning unset env var
--tkregister.c: IRIX: re-add CWBorderPixel, rgbabuftoscreen ifdef glDrawPixels
--tkmedit.c: IRIX: add CWBorderPixel attr, drawslice{2} IRIX ifdef glDrawPixels
--tksurfer.c: fix IRIX: rm #if 0'd singlequotes, re-add CWBorderPixel attr
--csurf: recognize IRIX64 so libTix8.4.3.so loads on sgi
--mk0: fix IRIX libezxml compile, tgz's, add rmcm, rm now stale mk0.csh
--tksurfer.c: write src annot/gii file comment in subj/sess scripts/<name>.ctab
--tksurfer.c: printvtxdata dumps adjusted colorscale angle (adja), baks only !0
--lib/help/tksurfer/label_{read,write}: update
--tksurfer.c: linrampphase2vtxcol: min redraw not working yet, commented out
--tksurfer.c: linrampphase2vtxcol comment out redraw to avoid redo set_color
--tksurfer.tcl: checklabelfile: warn read cmplx label as if real and vice versa
--tksurfer.tcl: 11th overload Shift-R-clk-"W" "label:": write_adjphase_vertices
--tksurfer.c: write_adjphase_vertices(): adjusted non-integer angle_cycles phase
--tksurfer.tcl: RESTORE rot subj w/"cereb" in name to posterior (vs. side) view
--csurf: rotate any subj with "cereb" in name to posterior (vs. side) view
--csurf: fix SubjectTools -> Inflate Surface Patch (was calling mkfinalsurfaces)
--csurf: repeat Help ExpertPref: RmSkull,FilterWM,FillWM,InflateP,Flatten,Sphere
--help/csurf/fillhires: update w/fill arbitrary volume example
--csurf: getcmdpidnam: add'l cmdpid's for better kill w/multiple bitmaps wins
--tkmedit.c: in all3views, click in subfield changes plane (duh!) for arr butt
--dist/fsaverage-ADDITIONS: updated rgb/mpg
--tksurfer.c -- fixed swapped fthresh/sfthresh mask in compute_surfgrad

### UPDATE: 24 Mar 2022
--csurf: list other brik2cor options on setup struct panel
--csurf: setup structs: 3-way opt (cancel, use, don't use) if no -zeropixwidth
--csurf: double-clk setupscans upper-left "Session:" label for current location
--csurf: block check scandir callback from set iscandir if aspect equals struct
--csurf: double-clk setupscan panel raises csurf only from bottom buttons frame
--csurf: Setup Structural Scans auto-converts *.nii (AFNI 3dcopy)
--lib/help/tksurfer/read_im{2,3}: example set infile names
--lib/help/tksurfer/col1col2: new helpfile, add to mk0{.csh}
--tksurfer.tcl: helpwins for F3 panel col1,col2 for "bi" scale
--lib/help/tksurfer/val2rgb_{read,write}: explicit example set in/out filename
--wrappers.tcl: controls,buttonbar: mv panel right of tk b/c far left tkmedit
--wrappers.tcl: controls,buttonbar: mv panel below GL if F3 b/c tksurfer F3 top
--lib/help/tksurfer/outsurf{NULL,asc,glb,obj,off,stl,vtk}_write: update
--wrappers.tcl: helpwin: mv less right for narrow tksurfer F3, small tkmedit GL
--csurf: all-help panel: separate read/write (SurfaceR,SurfaceW), c2lab to Label
--tksurfer.tcl,mk0: rename helpfile: hemisurf->insurf_read, bind F3 insurf "R"
--tkmedit.c: nudge startup GLX glxwinx0 back to right (for left Mac dock)
--tkmedit.tcl: SAVEIMGS ignores post-startup $inoutim change (write 1st read-in)
--lib/help/tksurfer/{patch,curv,area}_{read,write,mask,cut}: explicit set file
--tksurfer.c: rm unused fname arg from corr_over_annotcol()
--lib/help/tksurfer/label_{read,readcut,clear,write,timecourses,stat,corr}: e.g.
--lib/help/tksurfer/val_{read,clust,write}: explicit example set in/out filename
--lib/help/tksurfer/script_phasemovie: document how to deal with wrap
--csurf: movie panel plays mpgdir mp4/m4v's w/QuickTimePlayer (mac), vlc (lnx)
--tksurfer.tcl: 2D/3D gradient arrows respect annotmaskflag just show unmasked
--tksurfer.tcl: ctrl-right-R,W bind update vclabel so confirm msg not stale
--tksurfer.tcl: ctrl-right-R,W bind: fix forgot to read curr entry to label!
--lib/help/tksurfer/label: update with *.cols, *.cols format
--lib/help/tksurfer/{label,label_read,annot}: update
--add to dist: dist/fsaverage-ADDITIONS/surf/?h.cortex2a.patch.flat, mk tarfile
--add to dist: dist/fsaverage-ADDITIONS/surf/?h.cortex2a.patch.flat, mk tarfile
--mris_convert --annot ../label/{rh,lh}-CsurfMaps1.annot ../surf/{rh,lh}.white \
   ../label/{rh,lh}-CsurfMaps1.gii (FreeSurfer5.3) => dist/fsaverage-ADDITIONS
--tksurfer.c: skip do all glx events if offscreen: resizes win to max onscreen!
--lib/help/tksurfer/label_read: update
--tksurfer.tcl: final overload of D button: currcol_to_vtxcol
--tksurfer.c: add/export currcol_to_vtxcol(): only visible vertices are copied
--tksurfer.tcl: writevtxcols checks no vtxcols loaded, wrong suff
--csurf: double-click on render panel raises small main (no way from tksurfer..)
--tksurfer.c: clear_annot() also clears .annotbord
--tksurfer.c: add arg: clear_vertex_marks_list(reportlog=1): no log intern use
--csurf: showlogs raises main csurf window (helps w/many csurf's)
--tksurfer.c: select_vertex miss selected to -1; all selected users now check
--tksurfer.c: read_label_cut_clearvals -> clear_vertex_marks_list: fix weird PTS
--tksurfer.tcl: bind cmd/alt-z to UNDO cut butt, R-click help on 2 more popups
--wrappers.tcl: add thin space for buttonbar, helpwin lower
--tksurfer.tcl: fix auto-run default scripts (after cmd->bind so can use break)
--csurf: add appnap startup hack b/c ugly startup
--tkmedit.tcl: increase appnap hack to 2000 msec
--lib/help/tksurfer/label_readcut: update
--tksurfer.tcl: allow bail on re-run startup script
--tksurfer.tcl: add labeled_cut_clearval to "label:" line "C", buttonbar popup
--tksurfer.c: add/export labeled_cut_clearvals(), cf. read_label_cut_clearvals
--tksurfer.tcl: remove buttonbar popup delay (wrappers.tcl now moves it aside)
--wrappers.tcl: position buttonbar,controls left of tk, helpwin up/right on GLX
--lib/help/tksurfer/label_read: update
--tksurfer.tcl: 3rd vers DISPLAY SUBSET/MASK OVERLAY popup for vtxcol subset
--tksurfer.c: pick idnums/annotmaskflag works w/vtxcol overlays (was:annot,val)
--lib/help/tksurfer/{label,label_read}: update
--tksurfer.tcl: "label:" entry/dropdown also loads *.gii's, "D" displays
--tksurfer.c: add/export read_gifti_to_annot() (only test: mris_convert output)
--tksurfer.tcl: accept $hemi-<name>.label format for csurf annot files
--tksurfer.tcl: lut2annotcrtsl/do_lut2annot: global combovar update hacked cbx's
--tksurfer.c: read_mgh_annot(): more err check
--tksurfer.c: write_mgh_annot(): workaround mris_convert crash: idmax++,renumber
--tksurfer.tcl: buttonbars pop/re-create corresponding help, shortcuts incl butt
--wrappers.tcl: optional arg to buttonbar to bind helpfile
--tk{surfer,medit}.tcl: increase Mac uncover redraw hack delay to 2000 msec
--tksurfer.tcl: {read,write}vtxcols,labeltovtxcol cleanup, better vtxcol warn
--tksurfer.tcl: readvtxcols accepts *.col in addition to autoconverted *.label
--lib/help/tksurfer/{label_write,angle_offset,rgb_write,rgb_write2}: updated
--tksurfer.tcl: final overload for "label:" line "W": write_vtxcol_label
--tksurfer.c: add/export write_vtxcol_label: curr vtxcols AND visible
--tksurfer.tcl: dup write_mgh_annot comment-in/out: {exclude,include}_following
--tksurfer.tcl: fix nagging vtxcolflag=ON popup -> once only per new read
--tksurfer.tcl: fix logging for vtxcol labels
--tksurfer.c: add/export read_label_to_setvalval2 <valconst> <val2const>
--tksurfer.c: read_label_cut_clearvals(CUTNOCLR):fix recursive non-eroding hack
--tksurfer.tcl: warn hidden label for ROI button (similar to FILL)
--tksurfer.tcl: remaining file not found popups for "label:" line "D" and "R"
--tksurfer.c: label_to_vtxcol_label: use curr loaded stat (1.0 was desaturated)
--getonearch{.csh}: recognize proc=arm64, tmp classify as x86_64
--tksurfer.tcl: buttonbar for "label:" line "R" button R-click help
--tksurfer.tcl: buttonbar for "label:" line "CLR" button R-click help
--lib/help/tksurfer/comp_grad: update
--tksurfer.c: compute_gradient/compute_surfgrad: mask arrs w/sfthresh if statmsk
--tksurfer.tcl: dup arrowscale/arrowline in gradient popup (unlabeld fs tick)
--tksurfer.c: inplane rot: ctrl-arr -> shift-ctrl-arr b/c 10.15 ctrl-arr=maxmize
--tksurfer.tcl: write_mgh_annot: reverse Skip/ShowOverlap, so <Ret> skips
--lib/help/tksurfer/{label_clear,label_write}: updated
--tksurfer.c: read_mgh_colorlut() respects "### {include,exclude}_following"
--tksurfer.tcl: ctrl-middle-click on CLR does clear_annot_with_col mesh rgb
--tksurfer.c: add/export clear_annot_with_col(r,g,b)
--tksurfer.c: restore_ripflags SWAP_CURR_OLD, SAVCURR_MKORIG now don't unmark
--lib/help/tksurfer/{roi,statmaskamp}: update
--tksurfer.tcl: ROI: ctrl-mid-clk overload statANDrealflag mask tick (radio-ize)
--tksurfer.tcl: ROI: if real+stat, force choice between stat vs. stat AND real
--tksurfer.tcl: ROI: if cmplx+stat, force choice between stat vs. stat AND hypot
--tksurfer.c: new filltype=STREFILL: real>fthresh AND stat>sfthresh
--tksurfer.tcl: hack: fix Return in arrowscale in popup bound to arr->col butt!
--tksurfer.tcl: CLR single label now reads current combo entry, not found err
--lib/help/tksurfer/{roi,statmaskamp}: fix confusing typos!
--ima2brik: better checking for -di2sub option
--stripairPD.tcl: new standard lib/tcl script, add to mk0{.csh} dist
--tkstrip.c: def outim tmp->tmp.mgz, action5,6 set dfrac before init_surf_to_im
--tkstrip.c: add action=6: shrink on inim, read/peel orig.mgz, outim tmp.mgz
--lib/bem/ic6.tri: fix truncated file
--tkstrip.c: read_geometry crash from reading truncated *.tri file
--tkmedit.tcl: increase appnap xterm 300->800 msec (same as tksurfer.tcl)
--csurf: procs using mri_surf2surf, check/blk '#' in {FUNCTIONALS,SUBJECTS}_DIR
--tksurfer.tcl: middle-click-R on "rgb:" line shows all tiffs in nmovie
--tksurfer.tcl: FILL warn eroding/non-eroding fill
--tksurfer.c: !erodingfillflag retains FILL-like 1-vtx overlap label hole/add
--csurf: reinstate macos 10.{14,15) mac_appnap_hack=1
--tksurfer.tcl: inc appnap_hack delay 500->800 msec (works 10.15)
--lib/help/tksurfer/{roi,statmaskamp}: update
--tksurfer.tcl: middle-click overload statANDhypotflag to mask tick
--tksurfer.tcl: fix weird bug by always destroy/remake labeltickctrlswin
--tksurfer.c: new filltype=STHYFILL: hypot>fthresh AND stat>sfthresh
--tksurfer.tcl: allow back out of "label:" line CLR's
--tksurfer.tcl: redrawbutton warns vtxcolflag on
--lib/help/tksurfer/angle_cycles: ref linrampphase2vtxcol doc angle_offset
--tksurfer.tcl: allow back out of "val:" line CLR's
--lib/help/tksurfer/label_clear: update
--tksurfer.tcl: overload for "label:" line "CLR": read_label_to_clear_annot
--tksurfer.c: add/export read_label_to_clear_annot()
--tksurfer.tcl: add pointsize, mesh/rgb to labeltick controls win
--tksurfer.tcl: extra labeltick ctrlswin button RESTORE ANNOT BORD undo PRUNE
--tksurfer.c: annotborddotflag uses pointsize/meshrgb to adj annot dot bord
--tksurfer.c: export find_annot_borders()
--tksurfer.tcl: buttonbar "label:" line "D" R-clk help (disp,conv3d,mask,etc)
--tksurfer.tcl: allow escape from all S/V button actions
--tksurfer.tcl: buttonbar for "val:" line "S/V" butt R-clk help (various swaps)
--tksurfer{.c,.tcl}: confirm toggle bigcursorflag GLX and tk
--tksurfer.c: bigcursorflag makes write_selected_list_to_label save neighbors
--csurf: Preferences -> Cover/Uncover Speedup Hack (mac_appnap_hack) if Mac
--tksurfer.tcl: controls for 4-overloaded unlabeled "fs:" tickbox (grad arrows)
--tksurfer.tcl: buttonbar "fs:" "GR" button Rclk-help (calc gradient arrows)
--mk0{.csh}: distinct inst date (README.txt, csurf help), dist date (src file)
--dist/patch/mpeg_play-2.3/util32.c: linux maxdepth -> 24bit to fix transparent
--FreeSurferEnv.{sh,csh}: rm change LANG (broke start xterm from xterm mac10.15)
--tksurfer.c,tcl: rename write_annotcol_to_label -> write_annotedcol_autoname
--tksurfer.tcl: allow bail from all "label:" line writes
--tksurfer.tcl: allow bail from all "val:" line writes
--tksurfer.tcl: buttonbar "val:" "W" butt Rclk-help (vals,FT2amp,sphims)
--tksurfer.tcl: buttonbar "label:" "W" butt Rclk-help (label,vtxcol,annot,etc)
--tksurfer.tcl: write_mgh_annot: restore overlay if skip count overlap
--wrappers.tcl: allow mult buttonbar's uniq'ed by 1st cmd proc (raise existing)
--lib/help/tksurfer/arrownorm: update
--tksurfer.tcl: add pointsize, pointsflag to ARROWS/NORMALS/POINTS controls
--tksurfer.c: export pointsize
--tksurfer.tcl: buttonbar "label:" "C" butt Rclk-help (recut,hole,add,recutuniq)
--wrappers.tcl: optional title for buttonbar
--csurf: Setup Sphavg help: open correct help rather than just warn

### UPDATE: 14 Jun 2021
--lib/help/tksurfer/{label_write,label_write_annot}
--tksurfer.tcl: write_mgh_annot: allow mk annot w/label files missing (C now OK)
--tksurfer.c: write_mgh_annot: report/ignore missing label files
--csurf: fix wasn't passing -softtruncphaseflag to tksurfer in Render panel
--tksurfer.tcl: fix stale hard/soft truncphase message
--tksurfer.c: read_mgh_colorlut bail on duplicated color
--tksurfer.tcl: alt mid-click-GOTO finds opposite hemi point
--tksurfer.c: select_opphemi_vertex_coordinates: find fsaverage pnt other hemi
--tksurfer.c: add intern flag (norm/opp) to select_orig_vertex_coordinates
--tksurfer.c: write_mgh_annot: cnt vtxs for region popups (like read_mgh_annot)
--tksurfer.tcl: write_mgh_annot: gather/report all missing label files
--tksurfer.tcl: searchlight correlation popup tells label vs. annot region
--tksurfer.tcl: write_mgh_annot: also chk dup cols
--csurf: NormSearch def now frac=0.8 (paint/paintmulti chk for thickness file)
--wrappers.tcl: okreplace allows alt "REPLACE" box text (e.g., PROCEED)
--tksurfer.tcl: "label:" line "C" overloads warn missing file, allow cancel
--tksurfer.tcl: "label:" line "D"
--tksurfer.c: write_mgh_annot: overlap->.pval (vs. .stat), swap cmplx, find bord
--tksurfer.tcl: write_mgh_annot: chk dup reg ids (else silent Cfucnt log fail)
--lib/help/tksurfer/{fmid,sfmid,fslope,sfslope}: update w/e.g. raw Fourier
--tksurfer.tcl: normal move "N" on F3 panel does compute_normals_areas
--csurf/tksurfer.tcl/tkmedit.tcl: make proc editfile more parallel
--tksurfer.c: read_mgh_colorlut bail on duplicated region idnum
--tksurfer.tcl: write_mgh_annot: check files for each LUT region exist
--lib/help/tksurfer/{label_write,mesh,arrownorm,complexval}: update
--tksurfer.tcl: "cpx" tick catches/fixes blank disp w/inconsistent real/cpx
--tksurfer.tcl: new arrownorm tick/entry controls pop-up on R-click help
--tksurfer.tcl: make_mgh_annot: allow skip show overlap, alpha=255
--wrappers.tcl: okreplace allows alt "Cancel" button text
--tksurfer.tcl: make MGH annot popup now has full paths and loaded dropdowns
--csurf: subject/sessions auto select if only one pattern match
--lib/help/tksurfer/label_write: update
--tksurfer.tcl: use def .annot outfile write_mgh_annot popup (avoid overwrite)
--ima2brik: to3d EPI -tpattern => FROM_IMAGE, ignore scans 101-109 (reformatted)
--dist/patch/Tix8.4.3/DirList.tcl: strip vpath/npath double-slash crasher
--csurf: chk editor: /System/Applications/TextEdit.app/Contents/MacOS/TextEdit
--lib/help/tksurfer/{cmid,dimredcurvfact}: update
--tksurfer.tcl: jam dimredcurvfact next to cmid
--tksurfer.c: add/export dimredcurvfact for set_curv_color() better contrast
--lib/help/tksurfer/{label,label_write}: update
--tksurfer.tcl: 8th overload "W" butt to extract 1 MGH annot region to label
--tksurfer.c: add write_annotcol_to_label() to extract data from 1 MGH annot
--tksurfer.c: add internal: annotcol2brainregionindex()
--tksurfer.tcl: display "D" annotation pops up areas def color table
--tksurfer.c: timeout annotation region report popup (2.5 sec)
--tksurfer.tcl: fix report wrote transparent after cancel
--wrappers.tcl; helpwin: chk exists again for period subst'd out win name
--lib/help/tksurfer/{label_read,label}: update
--tksurfer.tcl: fork shift-right-D popup: if !valloaded -> show annot subset
--tksurfer.c; annot display respects brainregion[].maskflag (prev:just maskval)
--csurf: reconall req freesurf buildstamp sub-sub-vers for safety (e.g., 7.1.1)
--mk0{.csh},lib/help/csurf/reconall: add recon-all7.1b
--csurf: recon-all start w/edited orig.mgz works MGH FreeSurfer7.1 (was 5.3/6.0)
--add: bin/noarch/recon-all7.1b
--movie360.tcl/inflatemovie.tcl/flattenmovie.tcl: interruptable
--wrappers.tcl: click RUNNING in .controls sets new global purplekillcontrols
--fix FreeSurfer.sh permisions (chmod go+r): was break /usr/local install
--lib/help/tksurfer/scripts_*: notes on how to kill (not "RUNNING" button)
--csurf: bgsequencewin optional title, use to show Flatten,Sphere/Register inps
--mk: more informative error messages (e.g., try run immed after untar)
--tksurfer.tcl: fix fail restore patch view on reload *same* patch over 3d
--tksurfer.tcl: fix fail load *same* 3d surf after displaying a flat patch
--csurf: use -listcmd to live update patches dropdown (e.g. tksurfer wrote new)
--tksurfer.tcl: fix stuck shiftkeypressed for R/W patch (how does this happen?)
--lib/help/tksurfer/script_movie360 update
--tksurfer.c add really_center_patch() for rotate movie, offcent cereb patches
--tksurfer.tcl: select_curv sets surfcolor=1 to display curvature in case gray
--tksurfer.c: write_binary_surface unsets surfeditedflag
--lib/help/tkmedit/coronal: help on flip/align surface to flipped 3D dataset
--csurf,tksurfer.tcl,tkmedit.tcl: uncov xterm fails: use: Yosem=14 to HighSi=17
--tksurfer.tcl: select patch for mask/cut: Shift stops "patch:" dropdn autoload
--lib/help/tksurfer/{mesh,saveview,cutplane}: updates
--tksurfer.c:  cut_plane OK w/>4 marked -> use last 4
--tksurfer.tcl: PLANE complains in pop-up (vs. just invisible csurf log)
--tksurfer.c: export meshline (script only)

### UPDATE: 29 Jun 2020
--csurf: fix bug in csurf -nohack option
--tksurfer.tcl: SAVE/GOTO add-suffix-to-viewmatrix popups show avail suffixes
--csurf: add lights,blufact to all-help
--mk0: combine lib/help/tksurfer/light{1,2,3,4} -> lights
--tksurfer.tcl: better help for the lights
--tksurfer.tcl: bold the "View" butt (curr saved matrix popup), report saved dir
--lib/help/tksurfer/script_searchligharea: update
--FreeSurfer.sh: fix zsh path parsing
--tksurfer.tcl: force load example-res mgz file before FILL3d, write_fill_images
--tksurfer.tcl: also load subjectdir *.mgh files into "val:" dropdown (areas)
--tksurfer.tcl: 6th overload S/V with swap_origarea_val
--tksurfer.c: add swap_origarea_val() -> .origarea loaded at start w/areafile
--tksurfer.c: add copy_area_curv() (fix so-far-unused copy_area_val() bug)
--tksurfer.c: export threadcnt (def=8), incl opt/env
--tksurfer.tcl: blk reabbrev callbacks curv/area in sessdir (was just subjdir)
--searchlightarea.tcl/mk0: new script
--calcvert.c: 1D MGH outp opt for area (rename vars: vnum*->vcnt*, fnum*->fcnt*)
--tksurfer.tcl: fix mid-clk SMOOTH logic (searchlightop_val2stat does neighfill)
--tksurfer.c: searchlightop_val2stat calls neighop_val2stat if filltype=NEIFILL
--tksurfer.c: add SLOPSUM searchlight operation to neighop_val2stat
--tksurfer.c: add copy_area_val()
--tkmedit.c: fill_roi, vol_rois put return in $genstrret_1k for tcl scripts
--tkmedit.c: print 3D brainregion2 name to log (was only double-mid-click)
--tkmedit.c: shift-middle-TRUNC voxel count now pops-up result
--lib/help/tkmedit/roi_fill: update
--tkmedit.tcl: shift-left-click overload FILL button: vol_rois
--tkmedit.tcl: middle-click overload FILL button: clear_rois
--tkmedit.c: vol_rois() to measure current total ROI volume (vox=64)
--tkmedit.c: fill_roi() has option to append to existing region
--tkmedit.c: fill_roi() now has option to fill annotation region
--tkmedit.c: add clear_rois() (was roi_fill auto-cleared each time)
--lib/help/csurf/rc-surfaces,lib/help/tksurfer/surf: FlipHemi update
--csurf/tksurfer.tcl: chklefthandedsurf: change subj re-arms chk left-handed
--csurf: warn read *.srf (but not *.obj), kill popup after 8sec, twice only
--tksurfer.tcl: warn read *.srf possibly left-handed (but not *.obj)
--tksurfer.c: back to not-flipping BV coords (force use F3 interface FlipHemi)
--tksurfer.tcl: rm "surf:" dropdown dups (rh.surftmp match, strip, *.obj re-add)
--tksurfer.c: bail on read BV cols (color indices + RGB, req's POI file anyway!)
--tksurfer.c: make_filenames: *obj,*srf leave hemi on fpref for stdfmt curv etc
--tksurfer.tcl: select_surf try pre-append *.obj/*.srf if non-preappend missing
--csurf: tksurfercmd: special case for non-freesurfer-style *.obj,*.srf names
--csurf: =>w/no surfext prefix, can't tell if intended file is ?h.*.obj, *.obj
--csurf: =>parallel to tksurfer:make_filenames() -> not found, try no preappend
--csurf: fixsurfaces: only strip hemi from globbed surf tail if present!
--csurf: fixsurfaces (fix "surface:" dropdown if newsubj): load all *.obj,*.srf
--tksurfer.c: make_filenames: *.obj/*.srf, also chk surffile no hemi preappend
--lib/help/tksurfer/outsurfobj_write: new helpfile, add to mk0
--tksurfer.tcl: add OBJ to F3 panel for write_obj_surface
--tksurfer.c: write_obj_surface(): basic, colors, normals, colors+normals
--tksurfer.c: order_all_faces(): arr faces around vtxs: unordered->same winding
--tksurfer.tcl: load all *.srf regardless of hemi to "surf:" dropdown
--csurf: load all *.srf regardless of hemi to "surface:" dropdown, fixsurfaces
--tksurfer.c: make_filenames accepts no-hemi-prefix *.srf
--tksurfer.c: read_binary_surface(): tri BrainVoyager .srf surf fmt (flip x!)
--tksurfer.c: fish out find_annot_borders()
--csurf: add Flip (FlipHemi) to all help panel
--lib/help/tksurfer/fliphemi: new help file, add to mk0{.csh}
--tksurfer.tcl: add "FlipHemi" button to REDRAW row on F3 interface
--tksurfer.c: flip_faces(): used by really_flip_brain functions
--tksurfer.c: fix read_binary_surface reading of *.off surfaces (export was OK)
--tksurfer.tcl: "D" button uses read_obj_to_annot if *.obj suffix
--tksurfer.tcl: also load $subject/surf/*.obj file to "label:" dropdown
--tksurfer.c: read_obj_to_annot(): read just colors out of *.obj surf to annot
--tksurfer.tcl: "D" button uses read_poi_annot if *.poi suffix
--tksurfer.tcl: also load $subject/label/*.poi file to "label:" dropdown
--tksurfer.c: read_poi_annot(): load poi file into mghannot/brainregion
--lib/help/csurf/csurf, lib/help/tksurfer/surf, add .obj format
--tksurfer.c: flip_normals()
--csurf: load all *.obj regardless of hemi to "surface:" dropdown, fixsurfaces
--tksurfer.tcl: load all *LH/RH*.obj to "surf:" dropdown
--tksurfer.c: make_filenames accept any *.obj surf, detect maybe fixes hemi
--tksurfer.c: read_binary_surface() accepts tri Wavefront .obj surface format
--tksurfer.c: rename vertex struct members: vnum->vcnt, num->fcnt
--tksurfer.c: really_flip_brain
--tksurfer.tcl: also look-for/dropdown-load oldstyle valfiles in $subject/surf
--mkrandlut(.tcl): new lib/tcl script (add to mk0)
--tksurfer.c: add SLOPPAT=3 to neighop_val2stat->color patches w/stat int id's
--tksurfer.c: neighop_val2stat SLOPPAT=3: non-overlap colpatches w/stat intid's
--tksurfer.tcl: jam unlabeled $insidesurffact entry next to offset on F3 panel
--csurf: add insidesurffact to all help
--lib/help/tksurfer/insidesurffact: new helpfile, add to mk0
--tksurfer.c: insidesurffact to control relative brightness inside surface
--csurf: also load surface dropdown with $inflatedext? $pialext?
--csurf: accepts subject or session dir as arg
--csurf: change default startup volume to orig (was T1)

### UPDATE: 16 Dec 2019
--mk0{.csh}: add -viewerlin,-viewermac to make self-contained quickstart inst
--tksurfer.c: rm redundant diploadedflag
--tksurfer.c: add/export read_mgh_dipoles(): from $val (must be 3-frame .mgh)
--tksurfer.tcl: lib/help/tksurfer/arrownorm: update
--tksurfer.tcl: shift-right-clk on unlabeled arrowstick toggles dipolesflag
--tksurfer.tcl: read .mgh val: check embedded *.rh/lh.* (vs. *-rh/lh.w), warn
--tksurfer.tcl: wider "RD" dropdown list for rawdata BRIKs
--{wrappers,tksurfer}.tcl: -selectforeground black for linux dti,regraw popups
--tksurfer.c: paint_surface: if stat dims=0, subst rawdata dims, fail if both=0
--tksurfer.c: init xx0=xx1=yy0=yy1=zz0=zz1=0.0 (enable test unset, not yet done)
--tksurfer.c: rename: push_val_dip() to copy_val_dip() [no history yet]
--lib/tcl/zz-examples/renderoffscreen.tcl: respect previous rename
--lib/tcl/{borders,eccen-,fs-make,phasemovie,polar-,twocond-*}.tcl: respect prev
--tksurfer.c: rename: push_val_val2() to copy_val_val2(), push_ another synonym
--tksurfer.c: if diploadedflag, printvtx reports it
--tksurfer.c: calc avg len dip (for scale)
--tksurfer.tcl: do_dtivec: force sample single cortical depth, update NormSamp
--tksurfer.tcl: dtivecctrls: add parms for sampling surface, cortical depth
--tksurfer.c: replaced accidentally deleted normals display
--lib/help/tksurfer/val3d_{raw,vecs}: update
--tksurfer.c: add/export scale_dipxyz_by_stat(), optional use in read_vecs2surf
--tksurfer.c: rotate_dti uses normalized (rot-only) inv regdat xform
--tksurfer.c: invert_regdat also makes normed upper 3x3 inv regdat for rot-only
--tksurfer.c: read_rawdata: set flag from HEAD to short, not just float!
--lib/help/tksurfer/val3d_raw: update
--tksurfer.tcl: finish "RD" (read rawdata and regdat) popup for val3d: line
--csurf: help/tksurfer/val3d_raw: add to all help
--wrappers.tcl: okreplace debug msg if absfilename is dir, parent doesn't exist
--wrappers.tcl: okreplace w/o altmsg checks if file exists, adjusts message
--csurf: allow multiple cmdline flags
--tk{surfer,medit}.tcl: macappnaphackflag can force/unforce hack
--tk{surfer,medit}.c: macappnaphackflag passed thru to tk
--csurf: -[no]hack opt pass -macappnaphackflag (-1,1,0) to tk{surfer,medit}cmd
--csurf: -[no]hack opt pass -macappnaphackflag (-1,1,0) to {surf,med}testrender
--lib/help/tksurfer/label: update for overlap calc
--csurf: MacOS 10.15/kern=19 fast tk after logout/in w/o hack: add -[no]hack
--FreeSurferEnv.sh: works unchanged on MacOS 10.15 zsh
--tksurfer.tcl: warn overwrite $hemi.overlap.txt
--tksurfer.c: also count overlap w/idnum=0 (col=maxUint, name="???")
--tksurfer.tcl: warn about FILL even w/visible label (was block w/invis. label)
--tksurfer.c: lastvalfromlabelflag: to tell fname (vfname/val vs. lfname/label)
--tksurfer.c: write calc_annots_nzval_overlap output to subject scripts dir
--tksurfer.tcl: 8th overload "D" butt w/calc_annots_nzval_overlap (ctrl-shift-R)
--tksurfer.c: calc_annots_nzval_overlap: vtxwise overlap MGH annots, non-0 .val
--tksurfer.c: add RD button to val3d to read regdat/rawdata (space: PAINT=>PA)
--tksurfer.tcl: fix tcl: GO button double exec (block callback from setfile)
--tksurfer.tcl: fix misleading error message on NormSamp parm mismatch
--csurf: "Update Subjects/Sessions" warns when subj changed to match curr sess
--csurf: add selecthemi to fieldsigncmd to allow doing fieldsign for one hemi
--tksurfer.tcl: do_dtivec purple/unpurple mv'd more gen wrappers.tcl controls
--wrappers.tcl: add purple/unpurple main button hack to controls proc
--tksurfer.tcl: fix val/val3d both visible after chng interface size w/val3d
--tksurfer.tcl: do_dtivec purples/disables/renames butt, unpurples when done
--tksurfer.tcl: R-clk help also pops up panel for too-much-overloaded labeltick
--tksurfer.tcl: dtivecctrls pop-up to allow choose subbrik
--tksurfer.c: export registerdatloaded, dtirotatedflag, diploadedflag
--tksurfer.c: rotate_dti() to rotate eig in place using inverse of register.dat
--tksurfer.c: invert_regdat() use MNI inverse (intern, read_regdat always does)
--tksurfer.c: rename vtx2rawdata() => xformvec()
--tksurfer.c: draw_surf: flip dip vec if neg projection onto vtx normal
--lib/help/tksurfer/val3d_vecs: add helpfile, add to mk0{.csh}, csurf
--tksurfer.tcl: add "V" butt to "val3d:" entry to run all-in-one read_vecs2surf
--tksurfer.c: read_vecs2surf() to read/paint/xyz/to-dip
--tksurfer.c: swap_val_valbak() to save/restore current overlay
--tksurfer.c: rawdatasubbrik_to_paintable(): copy 1 subbrik to paintable fim_2r
--tksurfer.c: export dipolesflag (draw_surf())
--ima2brik: add -listprot: just list num files, protocol names for each scan
--csurf: "Surface for Sampling 3D Data" orig->white: orig has bad S-I foot!
--tksurfer.tcl: write sphim to mgz now optional on sphimctrls
--csurf: fix SUBJECTS_DIR crasher!
--csurf: don't complain about xterm if not Mac!
--csurf: use recon-all6.0b w/-all-skipstep1 option for fs6.0 (was just fs5.3)
--csurf: add all-help: nonintecc/exptrans/direct_paint/read_im{2,3,_label},
--tksurfer.c: surf2sphim now clamps in case non-spherical surf search off edge
--csurf: add im,im2,im3,im-label to all-help panel
--lib/help/tksurfer/read_im_label: new helpfile for bold "im:" label
--tksurfer.tcl: "im:" F3 interface makes surfdata->sphim->mgz popup: sphimctrls
--tksurfer.c: change default volumes (inim{2,3} to *.mgz (was CORdir)
--tksurfer.c: surf2sphim fills (the few) remaining holes, thicker rim
--tksurfer.c: add/export: write_sphim2byte hack/debug/check morph tractor beams
--lib/help/tksurfer/(morph,val_write,shrink_wbn}: update for wcpx2
--tksurfer.tcl: 8th overload "val:" W butt: samp valbak,val2bak: surf2sphim 4,5
--tksurfer.tcl: replace "wbn:" entry (boundary normal) with "wcpx2:"
--csurf: add morph_wcpx2 to all-help
--lib/help/tksurfer/morph_wcpx2: new helpfile (add to mk0{.csh})
--tksurfer.c: exported: {real,imag}im2loadedflag, surf2sphim accepts 4,5
--tksurfer.c: add second complex-valued drive to sphere_morph, sphims
--lib/help/tksurfer/exptrans: new helpfile (tksurfer.tcl, mk0{.csh})
--tksurfer.c: fix printvtxdata off-edge im crasher w/MRIloaded
--lib/help/tksurfer/read_{im,im2,im3}: new helpfiles, add to mk0{.csh}
--tksurfer.tcl: undo prev, update help to load using std S/V "push imaginary"
--tksurfer.tcl: mid-clk overload "P" button to paint to .val2 (direct_paint 1)
--tksurfer.c: direct_paint stattype arg so im[][][] can go to .val or .val2
--tksurfer.c: export non-std flags: MRIloaded, MRI2loaded, MRI3loaded
--lib/help/tksurfer/{nonintecc,direct_paint} new helpfiles; also mk0{.csh}
--tksurfer.tcl: add "P" button (direct_paint) to "im:" entry
--tksurfer.c: add/export: scale_val <scalefact>
--tksurfer.c: add/export: direct_paint() from im[][][] using normd parms
--lib/help/tkmedit/interface: update
--tkmedit.tcl: middle-click "i" to toggle invert contrast ($midpt => -$midpt)
--tksurfer.tcl: rm 2x reread F3 "insurf:" (touch surfext does tix callback)
--tksurfer.tcl: select_surfext blocks redraw if same as last (callback overlap!)
--lib/help/tksurfer/saveview: update
--tksurfer.tcl: mid-clk Save/Goto view to add suff to default name, surfer.mat
--tksurfer.c: {read,write}_view_matrix use exported vmfname/$viewmatrix
--tksurfer.tcl: fix Dijk button (normal ret to stderr, too? when did I break?)
--lib/help/csurf/flattensurface: re-flatten, better save/view steps instruction
--lib/tcl/{phasemovie,offsetmovie,searchightdiff}.tcl: re-use already there
--tksurfer.tcl: listbox select pops up standard tclscript controls panels w/o GO
--csurf: re-flatten sets subprocessredo: avoid second confusing overwrite query
--{flatten,inflate}movie.tcl: change irritating $skip to $every, raise if there
--tksurfer.c: write_{view,really}_matrix: add subj/surf/date comment
--tksurfer.c: read_{view,really}_matrix: allow comments, bare CR's
--tksurfer.tcl: write surfer.mat into log on "Save"/"Goto"
--tksurfer.c: really_scale_brain->compute_normals_areas (so immed FILL area OK)
--tksurfer.tcl; strip *.3d and *.flat in case patch infix matches surflooklist
--lib/help/tksurfer/{surf,patch,brainpose}: update
--wrappers.tcl confirmalert opt fix height for wrap lines (already linecnt-sens)
--block AFNI,AFNI-ALL buttons from cd'ing, e.g., if 3dvolreg/2swap running in bg
--csurf: VOLUME butt: if vol not found, suggest found *.mgz's from volllooklist
--lib/help/tksurfer/{min,max}stat: add also controls phase rect limits
--csurf: AFNI_PATH_SPACES_OK=YES: avgstruct,reconall,stripinit,3dvolreg,fourier
--brik2cor.c: backslash-quote system arg for abs outpath w/spaces
--lib/help/csurf/csurf: update spaces-in-path advice

### UPDATE: 22 Jul 2019
--[### end spaces-in-{CSURF,SUBJECTS,FUNCTIONALS}_DIR nightmare ###]
--tkmedit.tcl: pathspaces: listcmd_{surf,ims}: set "$list $m" =>lappend list $m
--csurf: refactor dyld/path spaces runafni proc for afni{cmd,allcmd,structcmd}
--csurf: afnicmd: omit empty dyld for namespace fix: env cmd uses as arg not env
--csurf: use AFNI_PATH_SPACES_OK=YES if detect FUNCTIONALS_DIR space (multiple)
--csurf: {l}backslashspaces runacmd args/listargs that could have spaces (~135)
--FreeSurfer.sh: fix lss,lsf,cds,cdf functions to accept spaces
--FreeSurfer.csh: fix lss,lsf,cds,cdf aliases to accept spaces
--mk0: unwind allow spaces edits to "tcltktix" (spaces break tcl configure's)
--mk0: (sh) allows space in srcdir path only for option "dist"
--mk0.csh: block all options if spaces in srcdir path, suggest mk0 (sh)
--N.B.: 10.12 tk{surfer/medit/strip} compiles coredump on 10.6 (converse OK)
--backslash-quote cat/gunzip/system args for paths w/spaces in following:
 => calcimg.c/fill.c/rawaverage.c/regcor.c/tkregister.c/wmfilter.c/tkstrip.c
--csurf: backslash spaces in runacmd pwd report
--csurf: medtestrender: backslash spaces in -real,-imag,-mask args for tkmedit
--csurf: backslash-quote maybe-space-containing DYLD cmdline passed to afni
--csurf: choosedir strips double-slash seen by file exists but not by tixDirTree
 [spaces now OK: opencmdsonlyfile,"Set {Subjects, Funct Sessions} Directory"]
 [spaces now OK: mknew{subject,funct},choose{subject,funct}dir,cpdir,avgsurfcmd]
--csurf: choosedir: strip curly braces in path-with-space added by glob (fixed!)
--csurf: MGHTools->RunRecon-all warn/cont. if space(s) in {FSURF,SUBJECTS}_DIR
--tksurfer.tcl: warn/catch mris_pmake ("Dijk" geodesic) fail w/spaces in PATH
--tksurfer.tcl: Dijk (mris_pmake) won't accept SUBJECTS_DIR spaces, add log/warn
--tksurfer.tcl: listcmd_{tcl,label,val,rgb} work (dblquoted auto-curly-braced)
--tksurfer.tcl: same fix for listcmd_{area,patch,lut}, select_{area,patch}
--tksurfer.tcl: path spaces: listcmd_curv, select_curv: set "..." => lappend
--tksurfer.c: [left some single-quoted system() args: OK unless change->runacmd]
--csurf: backslash spaces in tcl source file args
--csurf: backslash (proc) bindir/afnidir/mincdir/noarchdir spaces for runacmd sh
--wrappers.tcl: new proc: backslashspaces <path>
--tksurfer.c: backslash-quote cat/gunzip/system file args for paths with spaces
--tkmedit.c: backslash-quote cat/gunzip/system file args for paths with spaces
--bin/noarch/mk: add quotes to it make work with spaces in install dir path
--FreeSurferEnv.csh: LIB/PATH spaces now OK (use quoted lists, :q preserves q's)
--FreeSurferEnv.sh: LIB/PATH spaces now OK (use set/unset IFS)
--FreeSurferEnv.csh: if $path member w/space, don't touch (tmp fix, superseded)
--FreeSurferEnv.sh: allow $PATH bloat if memb have spaces (tmp fix, superseded)
--[### begin spaces-in-{CSURF,SUBJECTS,FUNCTIONALS}_DIR nightmare ###]
--csurf: better symbolic link ex. to fix path w/space (doesn't fix tix dirtree!)
--lib/help/csurf/tkmedit: rearrange, doc block double clicks, doc mask ctrls
--lib/help/tkmedit/{im2entry,im2read,seglabel}: update, doc block double clks
--tksurfer.tcl: do_annotmask checks overwrite if omnibus label (not multi)
--lib/help/tksurfer/label_read: update
--tksurfer.c: redraw crasher: set_{real,cmplx}_color didn't chk brainregion/cnt
--tksurfer.tcl: add $extract_unmasked_flag tickbox: write_val_unmasked_vertices
--tksurfer.c: add funct: write_val_unmasked_vertices
--tksurfer.tcl: rm chk _f in filename (do_fdr) so no err when csurf noload stat
--csurf: add View Functional Data tickbox for softtruncphaseflag ("Sft")
--csurf: readheader (READ HEADER) init alignscanparms(brightness) 1.0 if align
--ima2brik: inclprot trimleft 08's to block octal in format (fix past scan07)
--csurf: add "start from edited orig.mgz" tick to Run MGH recon-all panel
--bin/noarch/recon-all5.3b: copy of recon-all w/new opt: -all-skipstep1
--mk0{.csh}: insttmp/dist append tarfile date to README.txt
--ima2brik: add -afniprot, -niftiprot to insert protocol names in output BRIKs
--tkregister.c: fix look for DYLD_LIBRARY_PATH on Linux (broke cmdline use!)
--tkmedit.c: fix look for DYLD_LIBRARY_PATH on Linux (broke cmdline use!)
--tksurfer.c: fix look for DYLD_LIBRARY_PATH on Linux (broke cmdline use!)
--mk0{.csh}: also include my license.txt
--csurf: check CSURF_DIR for .license *or* license.txt (fs6.0 on centos7)
--surfcombine.c: expose additional functs, better documentation stack ops
--surfcombine.c: read_binary_values: fread -> freadFloat (!)
--lib/help/tksurfer/truncphasesoft: update (re-use softtruncphase tick help)
--tksurfer.tcl: add unlabaled entry next to invph tick for $softtruncwidth
--tksurfer.tcl: "invphase" -> "invph" to make room (update relevant helpfiles)
--tksurfer.c: add/export softtruncwidth (width of lin ramp-to-zero)
--mk0{.csh}: add new helpfile: truncphasesoft
--csurf: new $softtruncphase helpfile: truncphasesoft
--lib/help/tksurfer/{truncphase,rgb_write,rgb_write2}: update
--tksurfer.tcl: overload mid-click-WN on "rgb:" line to force write transparent
--tksurfer.tcl: overload mid-click-W on "rgb:" line to force write transparent
--tksurfer.tcl: add "s" tickbox for $softtruncphaseflag, "truncphase"->"truncph"
--tksurfer.c: add/export softtruncphaseflag (lin ramp-to-zero beyond limits)
--annot2roi.tcl: warn opposite hemisphere not yet done
--surfcombine: add write_{real,complex}_cv
--surfcombine: prohibit mixing orig (subset OK) with curv (full) valfiles
--surfcombine.c: stacksize: 100->300
--surfcombine.c: read_binary_values() also accepts curvfiles
--lib/help/tksurfer/truncphase{flag,min,max}: update
--tksurfer.tcl: ticking colscale=1=heat resets truncphase{min,max} to orig def
--tksurfer.tcl: truncphase{flag,max,min} allow wrapped phase limits if complex
--tksurfer.c: all set_complex_color's accept wrapped truncphase limits
--lib/help/tksurfer/label: update
--csurf: AVGSURF also fixes fsaverage pial 'poles' (for final disp, not sample)
--[don't fix less-used fsaverage surfs w/'pole' defects: orig, white]
--bin/noarch/fixpial: script to fix giant triangles in fsaverage pial
--lib/help/tksurfer/{label_read,label_write}: update
--tksurfer.tcl: setfile label w/relative now defaults to subject (was funct!)
--tksurfer.tcl: mask annot popup can write labels (not in "W" but convenient)
--tksurfer.c: add funct: write_val_idnum_vertices <idnum>
--lib/help/tksurfer/redraw: update
--tksurfer.tcl: wire toggle multitimecourseflag to ctrl-mid-REDRAW
--csurf: setup align/funct page sets iscandir so AFNI button goes to right dir
--lib/help/tksurfer/{label_toggle,label_read,hbutt}: update
--tksurfer.tcl: annotmaskctrls opens current MGH annot ctab in helpwin
--tksurfer.c: read_mgh_annot: write MGH ctab in scripts (vs. overwrite in label)
--tksurfer.tcl: annotmaskctrls/do_annotmask: pick annot idnum(s) to not mask
--tksurfer.tcl: bind pick annot idnum vis ctrls popup to "D" butt (shift-R-clk)
--tksurfer.tcl: bind annotmaskflag to label tickbox (5th overload: shift-R-clk)
--tksurfer.c: set_{real,complex}_color: if annotmaskflag use brainreg maskflag
--tksurfer.c: add funct: set_idnums_visibility <0,1> => brainregion[i].maskflag
--tksurfer.c: add funct: set_idnum_visibility <idnum> <0,1> => .maskflag
--tksurfer.c: add annotmaskflag (enable masking by annot regions)
--lib/help/csurf/makenewfunct: update
--lib/help/tkmedit/im2read: update

### UPDATE: 08 Feb 2019
--lib/help/tkmedit/roiup_write: update
--tkmedit.tcl: overload "W" button on "roiup:" line with write_allsegids
--tkmedit.c: add write_allsegids
--csurf: fix afni crash new Mac: add DYLD if exists /opt/X11/lib/flat_namespace
--lib/help/tkmedit/roiup_time: update
--tkmedit.tcl: overload "T" on "roiup:" line to run write_segid_timecourses
--tkmedit.c: add write_segid_timecourses <idnum> (first load segmentation)
--csurf: block all abspath paradigmdir's in deconvcmd, rawaveragecmd (concat)
--lib/help/csurf/setuprand: suggest only stim1Ds dir inside each scandir
--FreeSurferEnv.{c}sh: Mac: if exists /opt/X11/lib/flat_namespace add to DYLD_
--tkregister.tcl: fix cmd typo disabling SAGMIRR! (showvisble -> showvisible)
--tkmedit.c: thin gray dividers for all3views
--csurf: add "clo" tickbox help to csurf allhelp panel
--lib/help/tksurfer/selectdmax: new helpfile for tksurfer "clo" (near isocont)
--tksurfer.c: fix accidentally regressed (Nov2018) while->if: do_all_glx_events
--mk0{.csh}: add patch to tk to fix tk "raise" cmd
--README.txt: explain how to shrink stupid-big Gnome window title bars
--lib/help/tk{medit,surfer}/interface: new R-click help files
--tksurfer.tcl: add "i" button for toggle interface size (skip popup)
--FreeSurfer.sh: (bash-only) fix bug in detect if skipfontsflag override exists
--csurf: CentOS 7 back to doublebuffer if nvidia kernel module there
--tksurfer.c: add -justheaderflag (after mris_info hung computer on cereb)
--tksurfer.tcl: mid-click "N" bot left lg F3 pan: norm_move_vertices_fracthick
--tksurfer.c: norm_move_vertices_fracthick
--tkmedit.tcl: small "i" left of SAGITTAL to get interface size popup toolbar
--wrappers.tcl: new buttonbar proc for no-arg command list (only one allowed)
--lib/help/tkmedit/{clks,im2read,im2entry,seglabel}: update
--tkmedit.c:  read FreeSurferColorLUT.txt region name, dbl-mid-clk reports
--tkmedit.tcl: F4 interface tick to disable double click
--tkmedit.c: export blockdoubleclickflag (mid:reportseg right:winhelp)
--tkmedit.c: do_one_glx_event -> do_all_glx_events (slight speedup)
--lib/help/tkmedit/clks: update
--tkmedit.c: double-middle-click reports seg idnum (like tksurfer)
--tkmedit.c: genstrret_1k exported variable for single return string
--tkmedit.tcl: auto-back to 1st buff on read MGH seg overlay to show it
--tkmedit.tcl: read 2ndimg use read_sort_mghval2rgblut if FreeSurferColorLUT.txt
--lib/help/tkmedit/seglabel: update
--tkmedit.c: log reports mgh segmentation label number if loaded
--tkmedit.c: read_sort_mghval2rgblut: conv/sort/read FreeSurferColorLut.txt
--tkmedit.c: read_val2rgblut (4col) switches to above (6col) if std FS name
--tkmedit.c: drawslice() uses either byte or int segid (intern:intsegidsflag)
--FreeSurfer.sh: conv long-broken aliases to functs: sdir/fdir/lss/lsf/cds/cdf
--csurf: sort fix{surface,patch} globlist before resort (10.6=OK->CentOS7=rand)
--tkmedit.c: read_second_images now accepts int/float/short
--tkmedit.tcl: add "tran" entry to control overlayalpha on large F4 interface
--tksurfer.tcl: show non-standard patch types in "patch:" dropdown after std
--tksurfer.tcl: "clo" tick to adj selectdmax (def=2mm, deep near vert surf=0.25)
--csurf: "csurf -db" or "csurf -sb" to force start doublebuffer or singlebuffer
--tksurfer.c: export selectdmax to tweak select_vertex (omit selectzwinfact)
--tksurfer.tcl: PLANE button turns on light inside surfaces
--tksurfer.c: set_complex_color correct draw w/vals_cart2polarflag=1 for morph
--lib/help/tksurfer/redraw: update
--tksurfer.tcl: ctrl-middle-click REDRAW: toggle light back/inside surfaces
--tksurfer.c: lighttwosidedflag to light back/inside surfaces
--tksurfer.c: req read img before clear_selfintersect (cereb: override def=256)
--FreeSurfer.{c}sh: Linux uses MaxOSX 10.6 75dpi Helv fonts for Linux
--mk0{.csh}: copy good MaxOSX 10.6 75dpi Helv fonts for Linux (finally same!)
--csurf: tmp disable doublebuffer for CentOS 7 (3.0+ kernels)
--csurf: add separated R-click help for standard tcl script
--lib/tcl/script_{offset/phase/movie360,flatten,explode}movie: bind helpwin's
--lib/help/tksurfer/script_{offset/phase/movie360,flatten,explode}movie: new
--std script help fished from lib/help/tksurfer/script to R-clk each pop-up
--lib/help/tksurfer/script: document new exposed vars
--phasemovie.tcl: expose dontsaveframes, {col}phasecontour{modflag,_bright}
--tksurfer.c: phasecontour_bright affects phasecontourmodflag=1 (def still wht)
--tksurfer.c: colphasecontourflag: col phcont on gray (req phasecontourflag)
--lib/help/tksurfer/shrink: say how to save surface made with SRHINK!
--lib/help/tkmedit/surf2col: say how to show 2 surfaces!
--csurf: now singlebuffer also for CentOS (until I fix underlying problem)
--wrappers.tcl: linux also chk /etc/*-release: fix CentOS7 giant helv14,droparr
--lib/help/csurf/tksurfer: add REDRAW stereo, "Col:", LUT ticks, MGH label
--tksurfer.tcl: ltw hover saves curr colscale, undo change->ltw w/no val2rgblut
--tksurfer.tcl: "R" on "lut:" line warns if val2rgblut file doesn't exist
--tksurfer.c: set_complex_color() catches off-edge's if fred/pha LUT maxval<1
--tksurfer.c: FRED_TONO same: immed gray->orange, gray at end (vs zero-cent)
--tksurfer.c: make_color_luts() now wraps fredtonolut[] correctly (0-1)
--tksurfer.c: write_val2rgblut() now writes FRED_TONO colscale=18

### UPDATE: 21 Jun 2018
--csurf: explicit -padx 11 fixes Linux extra-wide "Slice Ord" tixSelect
--lib/help/csurf/tk{surfer,medit,register,strip}: Mac shellscript help
--tkregister.c: check/explain/exit DYLD_LIBRARY_PATH unset,maybe Mac shellscript
--tkmedit.c: check/explain/exit DYLD_LIBRARY_PATH unset, maybe Mac shellscript
--tksurfer.c: check/explain/exit DYLD_LIBRARY_PATH unset, maybe Mac shellscript
--csurf: CSURF_LIBRARY_PATH not set err before load tix (print after load fail!)
--csurf: "csurf -h" err if CSURF_LIBRARY_PATH not set
--lib/help/csurf/setupfour: clarify that 3D and surfcluster different
--lib/help/tksurfer/script_annot2roi: new R-click help popup (cp from scripts)
--lib/help/csurf/tkregister: update w/simple usage (tkregister s1.mgz s2.mgz)
--tkregister.c: read (don't biff) existing register.dat: tkregister 1.mgz 2.mgz
--lib/help/tksurfer/val_read: update
--tksurfer.tcl: shift-middle-click-R "val:" read cpx, scale mean complex amp->1
--tksurfer.c: add meanamp2one_valval2()
--lib/help/csurf/tksurfer: update update GLX window clicks in 'h' help
--lib/help/tksurfer/{arrownorm,redraw}: update
--tksurfer.tcl: rm REDRAW diverge/converge stereo toggles, left-click stereo off
--csurf: setupscans updates scandir entry on go back and show first page
--csurf: tksurfercmd: guess 1st funct for annot2roi (req's 1 SessionTools open)
--csurf: tksurfercmd: fix SURFACE button crash on initially empty $iscandir
--lib/tcl/annot2roi.tcl: fix bug in errcheck blocking resample surf->3D
--lib/tcl/annot2roi.tcl: allow re-use existing resampled annot
--lib/tcl/annot2roi.tcl: fix var cleanup in case no *.annots
--lib/tcl/annot2roi.tcl: one panel only (raise existing)
--csurf: SURFACE passes curr csurf iscandir tail (e.g., image/pol1) to tksurfer
--lib/help/tksurfer/script: add minimal HOWTO for annot2roi.tcl register.dat
--csurf: fix crash on Make Scandirs, Find Copy Raw w/invalid session
--lib/tcl/annot2roi.tcl: better session/scandir/rawdata/regdat errcheck/help
--lib/help/tksurfer/val_read: update
--tksurfer.tcl: middle-click-R on "val:" line does demean,varnorm after read
--tksurfer.c: add demean_varnorm_val()
--lib/help/tksurfer/surf: better help for not-visible-here F3 write surface
--lib/help/tksurfer/script: add non-interacive command line script example
--lib/help/tksurfer/outsurfoff_write: add Mathematica import example
--dist/patch/mpeg_play-2.3/Makefile: add: -I/usr/X11/include, -L/usr/X11/lib
--lib/help/tksurfer/annot: new helpfile, add to mk0{.csh}, csurf all-in-one
--tksurfer.tcl: *shift*-right-click help overload (annot summary label entry)
--tksurfer.tcl: first shift-R-click help (2nd helpfile for interface item)
--tkmedit.tcl: make "annot:" a live-loaded combo dropdown
--tkmedit.tcl: <Return> in $oneidnum uses goto_idnum()
--tkmedit.c: add/export goto_idnum() -> goto average position of a brainregion
--csurf: add tkmedit surfpaint to all-help panel, and mk0{.csh}
--lib/help/tksurfer/surfpaint: update
--tkmedit.tcl: "an:" entry to allow draw only one annot idnum
--tkmedit.c: add/export $oneidnum to draw only one annot idnum
--csurf: VOLUME-STATS can open no-functs fs scandir for F4 tkmedit SURFPAINT
--tkmedit.tcl: warn no surface for SURFPAINT curv/fs/annot
--tkmedit.tcl: add "annot:" READ: read_mgh_annot
--tkmedit.tcl: put "fm:" READ function into "fs:" READ like tksurfer
--tkmedit.c: add/export read_mgh_annot(), fix flags, draw_surface() can use
--tkmedit.c: add brainregion struct, vertex.annot
--searchlightdiff.tcl,annot2roi.tcl: log commands (incl eval exec's)
--annot2roi.tcl: load fsavg annot dropdown, better err chk, ask overwrite
--dist/fsaverage-ADDITIONS.tgz: remake/upload tarfile to incl new README.txt
--dist/fsaverage-ADDITIONS/scripts/README.txt: update/upload for single-sub HCP
--lib/help/tksurfer/{scripts,label,label_read}: updates for single-sub HCP
--annot2roi.tcl: option to return after just resamp fsavg annot to this subject
--tksurfer.c: translate zoomed stereo for less nonoverlap [redist as 180125]

### UPDATE: 25 Jan 2018
--lib/help/tksurfer/redraw: update
--tksurfer.c: fix stereo cursor, export stereo_rot_deg
--tksurfer.tcl: shift-middle-click REDRAW toggles stereoflag, convergent stereo
--tksurfer.c: add/export convergentflag for convergent stereo
--tksurfer.tcl: middle-click REDRAW toggles stereoflag, divergent stereo
--tksurfer.c: add/export stereoflag: divergent stereo by rotate 4 deg
--tksurfer.tcl: Shift-Return in $arrowscale entry also sets $arrowline to val
--lib/help/tksurfer/arrownorm: update
--tksurfer.tcl: 3rd overload tick bott phasecontour box: toggle display normals
--tksurfer.c: add/export normalsflag/arrowline, allow draw vtx normal vectors
--csurf: add 36 new helpfile to All Help Contents
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{wcrv,wsta,wcpx,wa,wbn}
--tksurfer.tcl: rearrange widgets in 3 rows: self/selfd/ck3rd/ar/2d/ck3:{lo,hi}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{cthk,whitemid,graymid}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{mstrength,mslope}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{expand,explode}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{update,decay,momentum}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{ncthr,ncthr_ck}
--tksurfer.c: locklabelflag also affects sphere_morph()
--tksurfer.tcl: add bindings for 14 new F3 help panels
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{locklabel}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{selfd,areaflag,2dflag}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{clearself,writeself}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{ckself,ckfill,ckgr,ck3rd}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{ws,wn}
--tksurfer.tcl: forcemode errors (on <Ret>)
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{forcemode,shrink_mmid}
--lib/help/tksurfer, mk0{.csh}: add helpfiles: shrink_{steps,cyc,ckMRI,adj}
--lib/help/csurf/spheresurface: add dist/parea/corr parameter explanations
--lib/tcl/explodemovie.tcl, add to mk0{.csh}
--tksurfer.c: fix explodeflag (if, ripfaces), expandflag force: 0.1->$mstrength
--lib/help/tksurfer/outsurf: update for new output formats
--lib/help/csurf/{rc-surfaces,rc-subjects,rc-SURFACE}: help update
--csurf: load non-pre-appended *.vtk, catch/warn on click SURFACE (CHROMA)

### UPDATE: 18 Oct 2017
--tksurfer.tcl auto-append .asc/.vtk/.off/.stl/.glb: testreplace warn overwrite
--lib/help/tksurfer/outsurfglb_write: update
--tksurfer.c: write_glb_surface(): uses curr displayed/cached colors
--tksurfer.tcl: add ctrl-shift-right-click prune_annotbord overload label tick
--tksurfer.c: prune_annotbord() if neigh annotbord's >= total neighbors-1 (OK)
--lib/help/tksurfer/label_toggle: update
--tksurfer.tcl: add ctrl-shift-mid-click $annotborddotflag overload label tick
--tksurfer.c: add annotborddotflag (add white dots on label border vertices)
--mk0{.csh}: insttmp: AFNI-req'd libXp .deb in $CSURF_DIR/lib/deb for user inst
--fourier.c: read rawdata float BRIK to floatbuff to avoid >32768 overflow
--fourier.c: block non-power of 2 (until convert to fftw.c)
--fourier.c: new option -1D to process 1 col in ASCII timecourse table
--fourier.c: if no -freqsurr (not req'd arg!), set def hifreq -1 => Nyquist
--lib/help/tksurfer/save_pnt: update help
--tksurfer.c: SEND/find_orig_vertex_coordinates reports midpnt curr normsearch
--csurf: add GLB (glTF output) button to all-help panel
--lib/help/tksurfer/outsurfglb_write: new help file, update mk0*
--tksurfer.tcl: add GLB (glTF output) output button on fn-F3 panel
--tksurfer.c: add write_glb_surface(): write binary glTF (*.glb) surface
--wrappers.tcl: positionpopup can now just return position
--csurf: File menu items to open xterm/gnome-terminal in subj/sess scripts dir
--nmovie.c: fix byte-swapped *.rgb image in 10.4
--csurf: if Ubuntu/Debian, turn doublebufferflag OFF (so startup OK, until fix)
--csurf: if Ubuntu/Debian, use ldd to check of libXp missing, warn/explain fix
--wrappers.tcl: def testclose (usu. overwritten) so kill win w/just wrappers.tcl
--csurf: improved cmdline help, --f OK too (force start csurf from Mac Terminal)
--csurf: explicit tixSelect -padx 11 (fix VBOX update def reset "Views: lat..")
--mk0{.csh}: link bak compat libXm.4 to libXm.3 requested by old PPC AFNI bins
--FreeSurfer.{c}sh: make old PPC afni bins work using incl libXm.4
--FreeSurfer.csh: failed attempt get ppc bins to run on Intel: would req ppc X11
--mk0.10.4: nmovie,wheel,tk{surfer,strip,medit,register}: /opt/X11->/usr/X11R6
--lib/help/tksurfer/arrownorm: better doc of constant-length gradient arrows
--csurf: missing env var better error: both tcsh (setenv) and bash (export)
--tksurfer.c: do_one_glx_event() -> do_all_glx_events(): "if" -> "while"
--tksurfer.c: call do_one_glx_event 10x -> much better 10.10+ responsiveness

### UPDATE: 21 Jun 2017
--tksurfer.c: count_mgh_annot_neigh2stat() also prints neigh IDnums to outfile
--tkmedit.tcl: before flip, if not CORONAL, warn/force CORONAL/center
--tkmedit.c: ptype errors, un-global/clean-up impt,ipt,jpt
--tkmedit.c: goto_point_coords->goto_point_zcoords, unzoomed: goto_point_coords
--csurf: add tkmedit CORONAL/SAGITTAL/HORIZONTAL to all help window
--lib/help/tkmedit/{hbutt,coronal,sagittal,horizontal}: new help, update mk0*
--tkmedit.tcl: overload "CORONAL" butt (mid-click) with flip_corview_xyz popup
--tksurfer.tcl: fix GR button error popup bug, manually bind avoids dup L-*-clk
--lib/help/csurf/csurf: more script help, document csurf tclenv mechanism
--lib/help/tksurfer/label: update
--lib/help/tksurfer/label_read: update
--tksurfer.tcl: count_mgh_annot_neigh2stat: ctrl-mid-clk-D, warn no-annot/.stat
--tksurfer.tcl: bind ctrl-middle-click-D to count_mgh_annot_neigh2stat
--tksurfer.c: add/export count_mgh_annot_neigh2stat(), write scriptsdir file
--tksurfer.c: annot2brainregionindex() (localizes above)
--tksurfer.c: catch off-edge on double-middle-click popup annot region/color
--tksurfer.c: do_one_glx_event: double-mid-clk also pops up D'd plain label col
--lib/help/tksurfer/label: another doc of double-mid-click popup annot name/col
--tksurfer.c: neighop_val2stat(): add 6th order (still useable: ~3min)
--searchlightdiff.tcl: also support neighop_val2stat (fillneartype=3)
--tksurfer.c: neighop_val2stat() for 1st-5th order neigh (req'd same alloc fix)
--tksurfer.c: count_neigh_ids2stat() for 1st to 5th order neigh (req'd samefix)
--mk0{.csh}: add searchlightdiff.tcl to standard scripts
--lib/tcl/searchlightdiff.tcl: new standard lib script
--tksurfer.c: fix free(hist) crash in searchlightop_val2stat_th() w/simple alloc
--tksurfer.c: searchlightop_val2stat_th(): if (SLOPCNT) -> if (optype==SLOPCNT)
--tksurfer.c: write_val_annoted_vertices: fix write all bug, resp annotbordflag
--lib/help/tkmedit/smoothstats: update to mk alt options parallel
--lib/help/tkmedit/{compare,wmtrunc,wmfilterstd,wmfiltergau}: update,mkparallel
--tkmedit.tcl: overload "COMPARE" button (shift-mid-click) with im2wmedits_to_im
--tkmedit.c: im2wmedits_to_im(): apply im2 WM_EDITED_OFF=1,WM_EDITED_ON=255 ->im
--lib/help/tkmedit/wmtrunc: make apply trunc, tclfunct help parallel to PF{GAU}
--tksurfer.c: print AnnotStruct: catch off-edge array access if Unknown region
--lib/help/tksurfer/label_read2val: explain complex, funct name typo shift-mid
--lib/help/tkmedit/sphnorm: doc Gaussian spherical option for $sphnormflag
--tkmedit.tcl: M-clk overload "sph" tick w/$gaussnormflag autoset $sphnormflag
--tkmedit.c: if gaussnormflag (and sphnormflag), linear->Gaussian profile
--tkmedit.tcl: better log commands for hand normalize, regular and sphere norm
--tksurfer.tcl: write_val_annoted{col,cols}_vertices: warn if $annotbordflag ON
--tksurfer.c: write_val_annoted_vertices: fix write all bug, resp annotbordflag
--tkmedit.tcl: fix run_wmfilter non-combo entry get (PF,PFGAU disabled Apr2016)
--lib/help/tksurfer/label_write: update
--tksurfer.c: write_val_annotedcol{s}_vertices respect annotbordflag

### UPDATE: 20 Mar 2017
--lib/tcl/movie360.tcl: can use ffmpeg to make mp4 directly (if on $path)
--lib/tcl/tksurfer/scripts: doc annot2roi.tcl
--lib/tcl/annot2roi.tcl: new script: samp fsavg annot to sing sub, get 3D ROIs
--tksurfer.c: single quote rm,>> args in system() calls (sure wildcard block)
--lib/tcl/tksurfer/label_read: doc all-in-one ROI BRIK
--tksurfer.c: insert_idnum() can accumulate merged all-in-one ROI BRIK
--tksurfer.c: write_annotcols_timecourses_stats() makes all-in-one ROI BRIK
--bin/noarch/fsavgannot2subj: sh one-liner to samp fsaverage annot to sing sub
--lib/help/csurf/setupfield, lib/tcl/borders.tcl: better doc
--tksurfer.c: write_annotcol{s}_timecourses_stats puts idnums into mask BRIKs
--tksurfer.c: print annot region IDnum (not just annot name) to log on select
--lib/help/tksurfer/label: update because couldn't find label->3DROI ("D")
--lib/help/tksurfer/{smooth,smooth_steps}: update
--tksurfer.tcl: SMOOTH steps field also takes "annoterode" -> run erode_annot()
--tksurfer.c: add/export erode_annot() HCP parcellation or single disp label
--lib/help/tksurfer/{label_corr,label_write,fill2num,smooth}: update docs
--tksurfer.tcl: searchlightop panel: add searchlighuniqflag, numafteruniqflag
--tksurfer.{c,tcl}: searchlight outfile: Spotlights.txt -> Searchlight.txt
--tksurfer.tcl; "N" butt reports std/dense vs. uniq-by-rm vs. uniq-expand-to-N
--tksurfer.c: searchlightuniqflag/numafteruniqflag: searchlightop_val2stat_th
--tksurfer.c: searchlightuniqflag/numafteruniqflag: fill_nearest_vertices
--tksurfer.c: searchlightuniqflag/numafteruniqflag: write_searchlights
--tksurfer.c: searchlightuniqflag/numafteruniqflag: corr_over_label
--tksurfer.tcl: xcorr: xcorruseuniq->searchlightuniqflag, add numafteruniqflag
--tksurfer.c: xcorruseuniqflag -> searchlightuniqflag, export numafteruniqflag
--tksurfer.c: write_uniqsamp_vertices now respects ripflag (for re-cut label)
--lib/help/tksurfer/val3d_read: HEAD -> BRIK in example
--csurf: add $hemi.surftmp* to surfaces dropdown (like tksurfer, tkmedit)
--lib/help/tksurfer/comp_grad: doc dilate, 3D arrow heads
--lib/help/tksurfer/hbutt: doc new options
--tksurfer.tcl: histctrls: two new options on popup sensitive to (s)fthresh
--tksurfer.c: new print_hist ops: (4)ang if amp>fthresh (5)ang if stat>sfthresh
--tksurfer.c: print_hist respects ripflag
--tksurfer.tcl: histctrls: preset complex ang option=3 if complexvalflag

### UPDATE: 17 Dec 2016
--lib/help/tksurfer/smooth: explain mid-clk-SMOOTH for searchlightop_val2stat
--tksurfer.tcl: middle-click SMOOTH to get pop-up to run searchlightop_val2stat
--csurf: add hist button help panel to all-help index
--lib/help/tksurfer/hbutt,mk0{.csh}: new helpfile for "h" help button...
--tksurfer.tcl: mid-clk upper-right "h" makes run print_hist (histogram) pop-up
--tksurfer.c: print_hist(): adjustable smoothing, nbins 
--tksurfer.c: print_hist(): convert x-axis bin number to data value 
--dist: $CSURF_DIR/tiny/{NOTES.txt,tiny.c,tiny.tcl}: minimal C+tcltk test prog
--tksurfer.c: subtr_valbak_from_val prints sign test counts
--lib/tcl/zz-examples/searchlightdiff.tcl: another example script
--tksurfer.c: omit OpenGL calls from thread (crash if no tk yet, tho single OK)
--tksurfer.c: add/export subtr_valbak_from_val(), result to .stat
--tksurfer.c: multithread searchlightop_val2stat (~8x faster => 10min)
--tksurfer.c: searchlightop_val2stat: add variance after substr center operation
--tksurfer.c: searchlightop_val2stat: add count-diff-IDs-in-spotlight operation
--tksurfer.c: searchlight_val2stat (just avg) renamed: searchlightop_val2stat
--mk0{.csh}: tcl/tk: regress to 8.5.18: just '-' in entry still OK
--mk0{.csh}: tcl/tk: found '-' in C-var float/int entry crashes 8.5.19 tk!
--tksurfer.tcl: default S/V explain panel only one time (others still always)
--lib/help/csurf/setupsphavg: doc new FIX-POLES location, fixinflatedavg script
--lib/help/tksurfer/{label_corr,val_read}: update formats, calcvert HOWTO
--csurf: fixinflatedavg: use $CSURF_DIR/subjects/fsaverage-ADDITIONS fixlabels
--mk0{.csh}: dist/inst: fsaverage-{adds,labels} -> subjects/fsaverage-ADDITIONS
--bin/noarch/fixinflatedavg: new bash script, add to mk0{.csh} dist/inst
--csurf: fixinflatedavg: fixed curv/sulc not being written out for AVGSURF
--update tcl/tk 8.5.17 => 8.5.19, mk0 {tcltktix,progs,insttmp,dist}
--mk0{.csh}: also include fsaverage-labels.tgz (HCP .annot) in dist
--tksurfer.c: do_one_glx_event 2x to fix slow interactive manip on 10.10+
--tksurfer.tcl: explicit bind ButtonRelease-1 b/c break won't work in -command
--tksurfer.tcl: block spaces in entered rgbnames: save_rgb_{checkfirst,named}
--lib/help/tksurfer/{label,label_corr,label_write,fill2area,fill2num,fill2rad}
--tksurfer.tcl: change write_spotlights => write_searchlights
--tksurfer.c: change var/funct names "spotlight" to "searchlight"
--tksurfer.c: add/export print_hist (curv/val/amp/ang/stat)
--tksurfer.c: add/export spotlightavg_val2stat -> slow (need multithread)
--tksurfer.tcl: create subject tmp dir if missing (For TmpTclScript.tcl)
--lib/help/tksurfer/{label,label_readcut,label_write,label_stat}: update,fixes
--tksurfer.tcl: force: $hemi-<infix>: match hemi, no .label, dash, 1+ char infix
--tksurfer.tcl: 7th label "W" (shift-ctrl-R-clk): write_val_annotedcols_vertices
--tksurfer.tcl: mv 6th label "W" overload shift-ctrl-R-clk => shift-ctrl-M-clk
--tksurfer.c: force: $hemi-<infix>: match hemi, no .label, dash, 1+ char infix
--tksurfer.c: fix write_val_annotedcol_vertices label lines count
--tksurfer.c: add/export write_val_annotedcols_vertices => all annots -> labels

### UPDATE: 04 Oct 2016
--lib/help/csurf/{csurf,rc-surfaces,rc-surface: update for GIFTI}
--lib/help/tksurfer/{clks,surf,val}: update for GIFTI
--tksurfer.c: double-middle-click selects vertex and prints annot (if loaded)
--tksurfer.c: double-middle-click selects vertex and prints annot (if loaded)
--tksurfer.tcl: "val:" entry loads *.$hemi.*.{func,shape}.gii
--csurf: load "surface:" dropdown w/non-hemi-prefixed GIFTI surfs incl flat
--tksurfer.c: read_binary_values now accepts one-frame GIFTI
--tksurfer.c: new/exported var, giivalframe: choose later frame in .gii valfile
--tksurfer.c: if surfext is *.gii ignore/fix hemi, don't append hemi to fpref
--tksurfer.tcl: "surf:" entry loads *.$hemi.*.surf.gii, no preappend hemi 
--tksurfer.c: read_binary_surface reads GIFTI base64/gzip (no ASCII yet)
--tksurfer/Makefile: $(INC_XML), $(LIB_XML_ST), -lezxml
--mk0{.csh}: compile, myinstall ezxml.{h,a}
--add csurf/dist/ezxml-0.8.6.tar.gz
--tksurfer.c: new #include: ezxml.h
--tksurfer.c: add meminflate() for in-memory gunzip, bs64_{enc,dec}() for base64
--lib/help/tkmedit/trunc
--tkmedit.tcl: shift-middle-TRUNC to countvox (white_{lo,hi}lim, to log)
--tkmedit.c: add/export countvox <low> <high>, lims included so lo=hi OK
--lib/help/tksurfer/fill: update: fillbutton, script left_click coords
--lib/help/tksurfer/{label_write,fillcrit,fill2*}: update
--tksurfer.tcl: 6th overload (shift-ctrl-R-clk) label "W": write_spotlights
--tksurfer.c: write_spotlights: ASCII to ~/label/$hemi-Spotlights.txt for label
--mk0{.csh}:dist/insttmp:add lib/tcl/zz-examples/{crosscorr,renderoffscreen}.tcl
--lib/help/tksurfer/script: better hints/examples
--tksurfer.tcl: add arbitrFDRcovarflag tick to mid-click-"CS" popup
--tksurfer.c: find_FRD_from_pvals: add nonpar FDR correct: div by log(n)+0.5772
--tksurfer.tcl: better "label:" line "C" OK help after recut sparse/uniq label
--lib/help/tksurfer/smooth: document tcl wrapper

### UPDATE: 24 Jun 2016
--lib/help/tksurfer/{label_readcut,mesh}: HOWTO make/disp sparse uniqvtx labels
--tksurfer.tcl: middle-click MESH toggles pointsflag
--tksurfer.tcl: ctrl-left-click "C" recut label respecting normdsampuniqvtxflag
--tksurfer.c: read_label_cut_clearvals <0=label> respects normdsampuniqvtxflag
--csurf: paintmultibrik bug/typo: uniqsampvtxs2labelflag=>normdsampuniqvtxflag
--tkmedit.tcl: add surftmp to dropdown list
--tksurfer.tcl: add surftmp to dropdown list
--tksurfer.tcl: check selfintersectloaded (avoid ask clear selfintersect 2x)
--tksurfer.c: export/maintain selfintersectloaded
--lib/help/tksurfer/val_clust: doc cmdline tksurfer tcl script for FDR calc
--lib/help/tksurfer/dijk: document subject/session location output path label
--tksurfer.tcl: add hemi, cp Dijk subj scripts to sess scandir or subj labeldir
--lib/help/tksurfer/label: add how to make 1-vtx-wide line-label traverse
--imptest: *.off(gray,tricol/vtxcol)->geomview,Mathematica, *.stl->Mathematica
--tksurfer.tcl: mid-clk OFF => face colors, shift-mid-clk OFF => vertex colors
--tksurfer.c: write_stl_surface: face colors option, vtx col option: OFF=>COFF
--csurf: add new write .off and .stl help panels to All Help panel
--lib/help/tksurfer/outsurf{off,stl}_write: new helpfiles, add to mk0{.csh}
--tksurfer.tcl: add F3 panel OFF button to write .stl format surface (3D print)
--tksurfer.c: write_stl_surface writes .stl pos octant ASCII file
--tksurfer.tcl: add F3 panel OFF button to write .off format surface
--tksurfer.c: write_off_surface writes .off format file
--tksurfer.c: read_binary_surface autodetects/reads .off format file
--csurf: make/run no-window tksurfer script to calc cross-subj FDR (no uniqvtx)
--fourier.c: autoswap LSB input timeseries BRIK (already reads LSB fullfourier)
--csurf: fouriercmd: forcebrikMSB _h BRIK output (from apply clustermask)
--csurf: fouriercmd: forcebrikMSB fourier pre-smooth out (was smooth prob!)
--tkmedit.c: read_native_stat swaps LSB BRIK (was fail w/LSB 3dmerge mask)
--tkmedit.tcl: catch/fix statmask-disabling sfthresh=sfslope=0.0 (thr,sl,msk)
--tksurfer.tcl: catch/fix statmask-disabling sfthresh=sfslope=0.0 (thr,sl,msk)
--tkmedit.c: left-click also prints statmask value if loaded
--tk{medit,surfer}.tcl: warn sfthresh=sfslope=0.0 disables statmask
--tksurfer.tcl: add val,weight smooth type option on FDR pop-up
--tksurfer.tcl: new smooth type option on FDR pop-up
--tksurfer.tcl: if stats loaded, also smooth w/sparse,weighted (was just val)
--lib/help/tksurfer/val_clust: how to use the FDR popup, method
--tksurfer.tcl: FDR CS popup: smoothsteps, desired_FDR, noisedf, uniqsampvtxflag
--lib/tcl/{real,eccen,polar,twocond}-{views,flat}.tcl: after swap:set stat $val
--lib/help/tksurfer/label_read2val: doc new read_uniqsamp_vertices binding
--tksurfer.tcl: add ctrl-L-click "label:" line overload: read_uniqsamp_vertices
--tksurfer.tcl: fix Shift-Middle binding "RC"->"R" button (was overlap/ignore)
--tksurfer.c: fix alt/cmd-click on tk window w/focus in GLX window (like shift)
--tksurfer.c: fix all label-reading functions to ignore k out of bounds
--tksurfer.c: add/export read_uniqsamp_vertices (for paint.c-created label)
--tksurfer.c: add/export pval_FDR, find_FDR_from_pvals()
--tksurfer.c: add/export noisedf, pval_from_fourier_fstat()
--tksurfer.c: add NR fcdf() -- uses betainc(), loggam() and betacontfrac()
--tksurfer.c: draw_colscaledisk: top of scale resettable w/maxstatcolscale
--lib/help/tksurfer/val2rgb_write: doc req. low fthresh/sfthresh for write LUT
--lib/help/tksurfer/rect: document assumed input amps, no stat fade
--tksurfer.c: write_val2rgblut: assume hi stat to avoid fade (only amp in LUT)
--tksurfer.c: draw_colscaledisk: fix inset w/fmid=0 (was purp), hi stat no fade
--lib/help/tksurfer/{roi,script}: updates
--tksurfer.tcl: ROI does phasetrunc w/truncphase ON preced:stat/phase/cplx/real
--tksurfer.c: floodfill_marked_patch <PHAFILL=4>: fill between trunc limits
--tkmedit.tcl: make cursor big 2x after GOTO for changeplane (sameplane 2x OK)
--csurf: addrenderscan fix missing bak compat default for new uniqvtx var
--tksurfer.c: catch stale UQ after new paint
--lib/help/csurf/setupfunct: better uniqvox/uniqvtx explanation
--lib/help/tksurfer/nsamp_uniqvtx: new helpfile, add to mk0{.csh}
--csurf: add nsamp_uniqvtx to All Help
--csurf: normdsampuniqvtxflag forces normdsampuniqvoxflag (like tksurfer.c)
--csurf: rename uniqsamplabelflag -> normdsampuniqvtxflag, also pass to tksurfer
--tksurfer.tcl: uniqvtx tcourse pre-warn: req: native stat, paint, uniqsamp
--tksurfer.c: paintTODOflag: set on load/reload 3D
--tksurfer.c: normdsampuniqvtxflag requires (doesn't do) find_uniqsamp_vertices
--tksurfer.c: [one extra line of C => 150 lines of interface and help...]
--tksurfer.c: normdsampuniqvtxflag: sample tcourse continue if not uniqsamp vtx
--tksurfer.tcl: add ~/tmp/TmpTclScript.tcl to "tcl:" menu
--lib/help/tksurfer/val3d_paint: update for smooth overload
--tksurfer.tcl: mid-clk overload PAINT also smooths (curr parms) before redraw
--csurf: setting minvol (clustervol) to 0 skips 3D clustering (like 2D disable)
--csurf: change CLONE FUNCT to just cp everything (was mk links to big files)
--csurf: visually separate off options for PAINT on Setup Funct panel

### UPDATE: 27 May 2016
--tksurfer.c: fix control-click on tk window w/focus in GLX window (like shift)
--lib/help/tksurfer/val3d_uniq: update for new binding
--tksurfer.tcl: middle-click UQ writes */$scandir/$hemi-UniqSampVtxs.label
--tksurfer.c: add/export write_uniqsamp_vertices (ignores usecurrcoordsflag)
--lib/help/csurf/setupfunct: update for new tick, changed tick labels
--csurf: add UniqLab tick to Setup Align/Funct to make PAINT dump uniqsamp label
--csurf: 35zr: allow start from Terminal with -f
--tksurfer.tcl: fix searchlimitsOK, re-order maxs above mins
--lib/help/tksurfer/val3d_{paint,uniq}: sample surf, effect white vs. inflated
--tksurfer: find_uniqsamp_vertices loads orig unless c2lab/$usecurrcoordsflag
--tksurfer.c: rename overlay_tm -> regdat_tmat (to be same as paint.c)
--paint.c: (vers=11a): re-parallelize paint/tksurfer paint_surface()
--csurf: N.B.: left midpnt contrast w/paint_surf,write_label_time set max to min
--csurf: if using midpoint, also set max's to it to override tksurfer def=0.4
--csurf: live samp/PAINT: warn using midpoint when normsearch OFF w/non-0 range
--tksurfer.tcl: searchlimitsOK also checks block min > max
--tksurfer.tcl: get{tseries,stats,stattseries}: block like paint_real_or_complex
--tksurfer.tcl: paint_real_or_complex: block normsearch=OFF w/non-zero range
--paint.c: N.B.: no normdsampsearchflag: both limits always determine search
--paint.c: rename thkflag to curf/tksurfer equiv normdfracflag (avoid confuse)
--tksurfer.c: write_label_timecourses_stats: reset vars like paint_surface does
--tksurfer.c: paint_surface: norm search OFF forces zero range (max set to min)
--tksurfer.c: paint_surface updates orfname/origcoords when it uses wmgmext
--paint.c: print register.dat, preappend _r prefix uniqsamp .label outfile
--paint.c: add paint_surface fn/fnsamp, find_write_uniqsamp_vertices()
--surflib.h: add to vtx struct: int uniqvoxnum, char uniqvoxcnt (for paint.c)
--csurf/tksurfer.tcl/tkmedit.tcl: 'exec xterm ... -e bash' --nrc to keep clean
--csurf: Setup Funct/Align ALL=>T catches inconsistent targTR's (e.g. diff reps)
--csurf: getfunctimageslist (Image File:) filter TmpClustMask+orig,MY_AREA+orig
--csurf: checkconcurrent ignores running nmovie
--csurf: Fourier: no tixopts: Painted Vertex List Files inserting "image/align"
--README.txt: add: run csurf from xterm, XQuartz uses .bashrc not .bash_profile
--csurf: force start from xterm, not Mac Terminal (nmovie fail, then can't kill)
--csurf: change killbox -> killboxOK (wrappers proc name change not propagated!)
--csurf: changed surfclust default to 150 (what help says!)
--csurf: changed defs to respect -dxyz=1: clusterrad:10->1, clustervol:150->40
--lib/help/csurf/{setupfour,setupimport}: fix docs
--csurf: fixed 3DClust labels here: Fourier panel, Import External Stats panel
--csurf: fix misleading labels (units=vox,not mm)(connected,not rad) for 3DClust
--lib/help/tkmedit/smoothmask: new helpfile, add to mk{.csh}
--tkmedit.tcl: add "m" tick under SMOOTH STATS for $smoothoverlaymaskflag
--lib/help/csurf/setuprender: add doc for smoothoverlaymaskflag
--csurf: add "m" tick render panel 3D smooth for parm $smoothoverlaymaskflag
--tkmedit.c: rough in example for cmdline read env (rarely used)
--tkmedit.c: add/export smoothoverlaymaskflag (def=1) to skip stat mask smooth
--csurf: add "All Help In One Panel" entry to Help Contents
--rename: lib/help/CSURF_HELP.txt -> lib/help/all-help
--calcvert: new op -atanh: wfile -> atanh -> wfile (clamps inp -1 to 1)
--lib/help/csurf/setuprand: warn/explain too-long paradigm file stem
--csurf: always warn/nag too long (>7) paradigmfile stem, too long: space vs tab
--csurf: cbx:select_{raw,sig}toavgdir: allow extstatscan, not just functscan
--real-{view,flat}.tcl: fix multi/all: csurftclenv sets tcl vars, not env vars
--/lib/help/tksurfer/label_corr: update
--tksurfer.tcl: xcorr writes r2z wfile <xcorr_outstem>_z-$hemi.w in $val dir
--tksurfer.tcl: xcorr writes corr/covar wfile <xcorr_outstem>_s-$hemi.w $val dir
--tksurfer.tcl: add xcorr_outstem entry and r2zscoreflag to xcorr pop-up
--tksurfer.c: add/export r2zscoreflag for xcorr: z = atanh(r)
--prf2sess: also subst amp to make _x,_y (looks like already subst'd!)
--calcvert.c: input r/i/file3 label files => r/i wfiles w/complex amp from file3
--calcvert.c: conv 5th or 6th column of labelfile to valfile (cp vtx nums)
--tksurfer.c: fix small error in sphere_morph norm recalc
--csurf: better csurf -help (was version mismatch crash!)
--csurf: mksphavgdir blocks make avg scandir named "image/prf"
--csurf: setupsphavgcx blocks open image/prf (e.g., unopened singsub conversion)
--csurf: setupsphavgcx blocks open single scandir config'd as functscan
--csurf: autoconfig functscan type (noerr) 1st render-open of prf2sess'd SamSrf
--bin/noarch/prf2sess: new bash script to conv prf labels to session wfiles
--tksurfer.tcl: if recognize pRF*_{ecc,pol}_r-?h.w, reset colscale
--tksurfer.tcl: "label:" line "W" message tells whether write is real vs. cmplx
--csurf: fix bak compat addrender missing paintext used in surftestrender
--csurf: pass functscanlists($page,paintext) to tksurfer -wmgmext (live paint)
--tksurfer.c: add env/opt -wmgmext to pass "Surface for Sampling 3D Data"
--csurf: add Preferences -> Clear Logs (clearlogs)
--csurf: add samevtxthickflag as "Same" to addfunctscan, pass to tksurfer
--csurf: add samevtx,wmgmext to allhelp
--lib/help/tksurfer/nsamp_wmgmext: new helpfile, update mk0{.csh}
--tksurfer.tcl: add wmgmext to NormSamp, Clust Controls
--tksurfer.c: add/export: wmgmext=$wmgmext (orig or white)
--tksurfer.c: auto/lazy read pial from prfname=$pialcoords (no normctrls)
--tksurfer.c: add/export: wrfname=$whitecoords, prfname=$pialcoords (not used)
--tksurfer.c: paint_surface,write_label_timecourses_stats chk samevtx/bok req's
--tksurfer.c: ctrl-middle-click now bails if missing samevtx/bokflag req's
--tksurfer.c: add bokflag to normdsamp_timecourse_stat: timecourse samp wasn't!
--lib/help/tksurfer/nsamp_samevtx: new helpfile, update mk0{.csh}
--tksurfer.tcl: add samevtxthickflag to NormSamp, Clust Controls
--paint.c: add: -samevtx <surfsuff2>, mm/frac dist to same numbered pial vtx
--tksurfer.c: samevtxthickflag: use mm/frac dist to same numbered pial vertex
--tksurfer.c: add/export read_binary_surface_vertexonly (to *vertexonly)
--lib/help/tkmedit/clks: add GL win hotkeys
--tksurfer.c: compute_{gradient,surfgrad}: zero gradient if amp < fthresh
--lib/help/tksurfer/label_toggle,erode,nonbinaryfs,comp_grad: updates
--tksurfer.tcl: 3 more overloads (compute_surfgrad) for "GR" button
--tksurfer.tcl: 1 more overload for unmarked fs button: toggle gradvecbak3dflag
--tksurfer.c: add draw_arrows3d (if gradvecbak3dflag)
--tksurfer.c: add/export compute_surfgrad (data gradients on 3D surface)
--lib/help/tksurfer/label: better tips for (primitive) label tools
--tksurfer.c: fix occasional targim zeros from rev paint norm search vol alias
--tksurfer.c: add read_sphims_at_vertex (if there) (shift-left-click)
--lib/help/tkmedit/clks: add clicks for gnuplot histogram facility

### UPDATE: 11 Apr 2016
--tksurfer.c: sphere_morph: precalc surf/targim ang/amp (baks so no wheel biff)
--tksurfer.tcl: REG checks {curv,stat,real,imag}imloadeflag's
--tksurfer.tcl: "W" butt "val:" overload: shift-L:val_to_sphim 2,val_to_sphim 3
--tksurfer.tcl: swap rare parm: shrink2d(wsh->shear) for sphere_morph(wcpx)
--tksurfer.c,tcl: rename wval to wsta
--tksurfer.c: add ***revpnt_stat,SPH_STAT to not overlap val/val2
--tksurfer.c: recalc sphere norm every step: simply {x,y,x}/100
--tksurfer.tcl: read .tif template popup warn sphere.reg coords not yet loaded
--csurf: add shrink/morph help to all-help panel
--lib/help/tksurfer/morph: new helpfile (added to mk0{.csh})
--lib/help/tksurfer/{curv,curv_read,val_write}: update tif template,surf2sphim
--tksurfer.tcl: val "W" overload: shift-M:val_to_sphim 0, shift-R:val_to_sphim 1
--tksurfer.tcl: swap rare parms: area_shrink(wt/wc) for sphere_morph(wcrv/wval)
--tksurfer.tcl: add REG button to run/interrupt sphere_morph
--lib/help/tksurfer/swapstatval: doc new curv-related bindings
--tksurfer.tcl: 4th,5th S/V bindings to expose swap_curv_curvbak,swap_curv_val
--tksurfer.tcl: rm read_tif_* frames arg to parallel read_binary_values mgh,vtk
--tksurfer.c: change surf2sphim to read from curv/val/va2 (was just val)
--tksurfer.c: add/export functs: surf2sphim,sphere_morph, parms: wcrv,wval
--lib/help/csurf/csurf: update to describe .tif format
--tksurfer.tcl: if select template .tif -> chooseframe popup (documents frames)
--tksurfer.tcl: load abs FSURF_DIR template .tif's into curv dropdown
--tksurfer.c: rm read_tif_* frames arg to parallel read_binary_values mgh,vtk
--tksurfer.c: add/export read_tif_template(), read_tif_header(), templateframe
--tksurfer.c: add/export swap_curv_val(), assume curv always loaded
--tksurfer.tcl: add (tif) $template to setfile sessionfiles
--csurf: blkcallback colscaletype bind stops select_colscaletype reset config'd
--offsetmovie.tcl: add HOWTO in error if angle_offset wrap
--wrappers.tcl: always print report on source except by csurf
--wrappers.tcl: helpwin: add linux/mac find/next help to right of title 
--lib/help/tksurfer/{intplut,botedge,zerosymm,val2rgb}: update
--tksurfer.tcl: if ltw, botedgelutflag=1,zerosymmfadeflag=0 (no effect:reflect)
--tksurfer.c: phase LUT: discrete colors works (both assume botedgelutflag=1)
--tksurfer.c: printeventtype =>tkmedit:printXevent (count,Mac-specific Generic)
--lib/help/csurf/spheresurface: explain average.tif vs. average...buckner40.tif
--lib/help/tkmedit/clks: new file (add to mk0{.csh})
--tkmedit.c: right-double-click for volume window click help
--mk0{.csh}: add new helpfile
--lib/help/csurf/fsavg: new file
--csurf: R-click fsavg gives widget-specific help (clk elsewhere: setuprender)
--csurf: shift-middle-click fsavg sets up: curr -> fsaverage -> othersubj
--wrappers.tcl: rename tmpcontrols => modalcontrols, killbox => killboxOK
--csurf: if paint single subj onto fsaverage, allow use fsaverage-only patches
--csurf: more bakcompat in addrawavgscan for 000319CF
--csurf: 30 combos on notebook pages to -listwidth <pix> only, adjust some
--tkmedit.tcl: 8 lg: -listwidth <pix>: im,roiup,roin,valup,valn,mskup,mksn,lut
--tkmedit.tcl: 2 sm: -listwidth <pix> *and* listbox.width: surf,im2
--tksurfer.tcl: 7 lg: only -listwidth <pix>: tcl,patch,label,lut,val,val3d,rgb
--tksurfer.tcl: 3 sm: -listwidth <pix> *and* listbox.width: surf,curv,area
--csurf: 6 on mainwin: tixComboBox -listwidth 208 vs. -options listbox.width 25
--need listwidth+options for <20 char else min const width increases
--small width: (<20chars) -listwidth <pix> *and* -options listbox.width <chars>
--large width: (>=20chars) only -listwidth <pix> required
--tixComboBox add -listwidth <pix> vs. -options "... listbox.width <chars>"
--on linux, smaller only appears after previously clicking different dropdown
---------------------------------------------------------------------
--finally, fix for every 3rd click on combo shrinks listbox to entry size
--table of char->pix
--less than than 20 chars: -listwidth <pix> *and* -options listbox.width <char>
    17->153, 18->159, 19->166
--more than 20 chars: just -listwidth <pix>
    20->173, 21->180, 22->187, 23->194, 24->201, 25->208, 26->215, 30->243
    35->278, 38->297, 40->315, 42->327, 45->348, 55->418, 60->453
---------------------------------------------------------------------
--lib/help/csurf/{rc-vol,rc-volradio}: update
--lib/help/tksurfer/erode: update
--tksurfer.tcl: ROI butt unsets dilatingfillflag, update/restore tick label
--tksurfer.tcl: change "er" to bold "dl" if dilating FILL, better state report
--csurf: localize csurf help next to each widget code
--csurf: convert mritype entry to autofill combo to allow load non-standard vol
--csurf: fix auto-cancel ViewFunct/Sphere type (no tkwait, set makingsetupscan) 
--csurf: inline env AFNI_ENFORCE_ASPECT=YES for afni
--csurf: choosedir (mabye dir/file) uses entry title vs. "Choose Directory"
--csurf: differentiate choosedir entry title strings (Choose vs. Enter)
--tk{med,reg}.c,orig2cor.c: cleanup MRI_DIR->VOL_DIR
--mk0{.csh}: insttmp makes tclsh/wish links (so bare matches CSURF_LIBRARY_PATH)
--FreeSurferEnv.{c}sh: report *LD_LIBRARY_PATH copied to CSURF_LIBRARY_PATH
--bin/noarch/{bsurf,csurffonts}: fix 10.10+ wish startup (left tclsh general)
--lib/help/csurf/{tkstrip,rc-VOLUME}: update
--csurf: shift-mid-click on VOLUME opens tkstrip on currently selected volume
--csurf: add TkStrip to all-help panel
--mk0{.csh}: new helpfiles
--lib/help/csurf/tkstrip: new helpfile
--tkstrip.tcl: add upper-left "h" button
--lib/help/tksurfer/clks: new helpfile
--tksurfer.c: fix/update cmdline click help
--tksurfer.c: surface window R-double-click help for surface window clicks
--lib/help/tksurfer/label_write: update for nhits display
--csurf: add setenv SUBJECTS_DIR to recon-all script: ElCapitan no longer passes
--tksurfer.c: don't re-malloc/destroy marked[] on re-read same vertexcnt surf
--csurf: exec $editor $file >& /dev/null & => exec open -e $file (no multiple)
--csurf: editfile: TextEdit case (bad geom arg -> 'permissions' err begin 10.9+)
--lib/help/csurf/tkmedit: document main window clicks at top
--tkmedit.c: raise/focus glx win after gnuplot histogram, popup warn rad=1
--tksurfer.tcl: do_lut2annot displays/rotates assembled labels, then hitcount
--tksurfer.c: write_mgh_annot accumulates label hit count (nhits) in .stat
--csurf: wrong type (funct/sphavg) warning now closes setupscans panel
--tksurfer.tcl: reset flag/alpha for read/write_mgh_annot reset for log
--tksurfer.c: harmonize read/write_mgh_annot (tksurfer.tcl resets flag/alpha)

### UPDATE: 30 Jan 2016
--tksurfer.tcl: Linux:100ms delay block runaway updates w/fast slidertrough clks
--lib/help/tksurfer/label_write: update for write_mgh_annot
--tksurfer.tcl: ctrl-mid-clk label "W" assemble ColorLUT csurf labels to .annot
--tksurfer.c: default $lulabel/ulfname now $CSURF_DIR/lib/lut/CsurfColorLUT.txt
--tksurfer.c: write_mgh_annot:assemble MGHcolorLUT csurf label infixes -> .annot
--csurf: R-click help for the "h" button
--csurf: add new complex/real smoothing to all-help panel
--mk0{.csh}: add new helpfile to dist
--lib/help/tksurfer/{smooth_cpxreal,smooth}: new helpfile, update existing
--tksurfer.tcl; new "cr" (complex/real) smoothing F3 (or mid-clk F2 "val")
--tksurfer.c: add/exp smooth_complexang_realamp (repl smoothed amp w/real avg)
--bin/noarch/tiff2mpg: add tiling option (if ImageMagick montage on path)
--lib/help/tksurfer/erode: document dilatingfillflag
--tksurfer.tcl: overload erode FILL: mid-clk => dilate FILL (erode cancels)
--tksurfer.c: add/export dilatingfillflag for floodfill_marked_patch
--csurf: load2surf bug (forgot to global inflatedext2)
--tksurfer.tcl: copy global/startup C/tcl functions/vars into comments
--tkmedit.tcl: copy global/startup C/tcl functions/vars into comments
--mk0{.csh}: fix broken cp to source of precompiled linux jpeg libs
--tkmedit.tcl: localize all help bindings (easier to rearrange)
--tkmedit.tcl: add listcmd to "lut:" combo (for luts written interactively)
--tkmedit.tcl: add listcmd to "mskup:" combo (interactive write upsamp mskBRIK)
--tkmedit.tcl: add listcmd to "valup:" combo (interactive write upsamp valBRIK)
--tkmedit.tcl: add listcmd to "roiup:" combo (for ROIs written interactively)
--tkmedit.tcl: add combo w/listcmd to "im2:" (for vols written interactively)
--tkmedit.tcl: add combo w/listcmd to "im:" (for vols written interactively)
--tkmedit.tcl: add combo w/listcmd to "surf:" w/surfs for both hemis, curr first
--csurf: below makes Preferences->SmallScreen work again for SURFACE button
--csurf: SURFACE/surfercmd env=>opts:late csurftclenv read broke openwin configs
--csurf: earlier warn wrong rendertype (View Funct/SphAvg Data menu before set)
--csurf: squish padx RIGHT LEFT BOTH for freakishly large Fedora Helv 14
--wrappers.tcl: foundbywhich: strip to tail in string match else not found Mac
--csurf: fix reconall ADD/DEL file not found bug: unset mghinprawscanfiles(last)
--tkmedit.tcl: add Mac app nap hack
--lib/help/tksurfer/val_bi, lib/help/csurf/setuprender: better "bi" scale doc
--csurf: add angle_offset for 1sec delay to View Functional Data
--csurf: Fourier panel calculates angle_offset for 1sec delay
--lib/help/csurf/setuprawavg: improve description of reversing time
--csurf: block/explain non-integer Stim Cycles Per Scan
--csurf: block/explain non-integer Num TRs to timeshift
--csurf: stop "Now, locate single sub..." message from wrapping on "functional"
--tksurfer.tcl: don't crash interface if FSURF_DIR not def'd, just rm Dijk butt
--tksurfer.c: malloc marked[] to vertexcnt of surface
--wrappers.tcl: foundbywhich now works w/compound path, fix File->NOTES on linux
--lib/help/tksurfer/label_{read,write}: update additional overloadings
--tksurfer.tcl: ctrl-left-D on "label:" line => read_label_to_select
--tksurfer.tcl: ctrl-left-W on "label:" line => write_selected_list_to_label
--tksurfer.c: add/export read_label_to_select
--tksurfer.c: select_uniqsamp_vertices now marks, too
--tksurfer.c: increase marklist 1K->150K, mark_vertex flag to skip log print
--tksurfer.c: add/export write_selected_list_to_label
--Makefile: tk{sur,med,reg,str},nmovie,wheel: Mac-only: add /opt/X11/{incl,lib}
--tksurfer.tcl: add listcmd to "area:" combo so open dropdown updates files
--tksurfer.tcl: add listcmd to "curv:" combo so open dropdown updates files
--tksurfer.tcl: add listcmd to "lut:" combo so open dropdown updates files
--tksurfer.tcl: add listcmd to "patch:" combo so open dropdown updates files
--tksurfer.tcl: add listcmd to "val:" combo so open dropdown updates files

### UPDATE: 30 Dec 2015
--multiclust.cpp: marty: allow .mgh/.vtk input/output (parallel to surfclust)
--multiclust.cpp: extern global recurscnt/maxusedrecurscnt (decl:surflib.h)
--multiclust.cpp: (from surfclust) incr stacksize deep recursive growCluster
--randsurfclust.cpp: allow vtk surf input
--randsurfclust.cpp: crashes w/recursive growCluster -> incr stacksize to max
--csurf: add View:Save/Goto and F3 VTK write surf to all-help
--tksurfer.tcl: .mgh/.vtk "val:" line "R" resets colscale real-valued if cmplx
--tksurfer.tcl: shift-ctrl-mid-clk val "W": write_vtk_surface_plus_values
--tksurfer.c: write_vtk_surface_plus_values, auto-append .vtk as previous
--tksurfer.c: write_vtk_surface, auto-append .vtk to outname if not there
--tksurfer.tcl: rm F3 FL (flatten) button til works again (makes space for PTS)
--tksurfer.tcl: F3 panel: W-ASCII=>ASC, VTK (write_vtk_surface), autoappend .vtk
--tksurfer.c: read_binary_values: accept *.vtk start w/header *or* POINT_DATA
--lib/help/tksurfer/{val,val_read,val_write}: updates, "W" overloads
--tksurfer.tcl: ctrl-middle-W val: write vtk POINT_DATA valfile (force realonly)
--tksurfer.tcl: ctrl-left-W val: write mgh valfile (force real-only)
--tksurfer.c: add write_vtk_values (begin POINT_DATA: allvertices,float,1frame)
--tksurfer.c: add write_mgh_values (allvertices,float,1frame)
--clustlib.cpp: warn half that (calcStats w/300K already over 15 min)
--clustlib.cpp: block >300K growCluster recursions (crashes above 750K)
--surfclust.c: extern global recurscnt/maxusedrecurscnt (declared: surflib.h)
--surflib.c: surflib.h: global recurscnt/MAXRECURSCNT to catch growCluster crash
--surfclust: still crashes w/recursive growCluster -> incr stacksize to max
--surflib.c: comment out redone MRIScomputeNormals,mrisComputeVertexDistances
--wrappers.tcl: new confirmalert $bgcol w/barely vis frame indicate selectable
--wrappers.tcl: okreplace indents filename
--tksurfer.tcl: GO (run tcl script) suppresses ret=0,1 in addition to ret=""
--surfclust.cpp: add help, examples, arg checking
--surfclust.cpp: .vtk: transcribe surf, append one col vals
--surfclust.cpp: .mgh: req .mgh input, writes only 1 frame regardless of inp
--surflib.c: MRISwriteVtkSurfaceAndValues: transcribe surf, append 1 col vals
--surflib.c: MRISwriteMghValues: one output frame regardless of input frames
--csurf: add View:Save/Goto to all-help
--lib/help/tksurfer/{save_pnt,goto_pnt,saveview}: document $subjtmpdir
--surflib.c: MRI_DIR -> CSURF_DIR
--surflib.c: regularize MRISreadValues{Mgh,Vtk}File to return ecode
--surflib.c: mv MRISreadValues{Mgh,Vtk}File from surflib.cpp to here
--surflib.c: add mrisReadVtkFile function
--surflib.c: add 2nd fork (mrisReadVtkFile) to MRISread/MRISreadOverAlloc
--surflib.h: add MATCH_{PREFIX,SUFFIX} macros, FIRST_IMG_BYTE, MAXVTKLINE
--surfclust.cpp: add -vtkvalcol, MRISreadValuesVtkFile
--tksurfer.c: make backup of surfer.mat before writing new, hardcoded->defines
--tksurfer.tcl: add Save/Goto View buttons inside TRANSLATE panel
--csurf: fixsurfaces trace for fsaverage: if inflated_avg there, use it
--csurf: previous forces error/explain on try to misconfig Funct or SphAvg Dir
--csurf: block/explain SURFACE/VOLUME-STATS if this notebook page not config'd
--nmovie.c: break to STOPPED if wastefully LOOPING w/1 image
--wrappers.tcl: mk confirmalert text selectable (textwidget,revert:$usetextw=0)
--lib/help/tksurfer/{save_pnt,goto_pnt}: improve find orig coords explanations
--mk0{.csh}: include new helpfile
--lib/help/tksurfer/cutpts: new helpfile
--lib/help/tksurfer/{cutline,cutarea}: update to remove awk cut/uncut overloads
--tksurfer.tcl: mv awk LINE/AREA cut/restore points overloads to new PTS button
--tksurfer.c: Enter/LeaveNotify: ignore Shift down in otherwin w/start GL focus
--tksurfer.tcl: shift-mid-clk overload AREA/LINE w/cut_vertices (1+ marked)
--tksurfer.tcl: mid-clk overload AREA/LINE w/uncut_connected_vertices (1+ mark)
--tksurfer.c: new/export: uncut_connected_vertices (also export cut_vertex)
--tksurfer.c: cut_line: re-enable cut_vertex: open/closed line same (AREA/LINE)
--tkmedit.c: add/export left_click, use if tkmedit.log in do_one_glx_event
--tkmedit.tcl: log tkwin arrowkeys (arrow bindings)
--tkmedit.tcl: log GLwin arrowkeys (tcl changeslice call from do_one_glx_event)
--csurf: Re-Make Surf (hi-res): block use mri_fill
--tkmedit.tcl: fix log report for sag/hor trough, sag/hor-tal/native coords
--tkmedit.tcl: open xterm, run tail -f tkmedit.log in it upon record tclscript
--tksurfer.tcl: open xterm, run tail -f tksurfer.log in it on record tclscript
--wrappers.tcl: mk xcmd/cmdkey global here (rm in csurf/tk{surf,med,reg,strip})
--lib/help/tksurfer/cuts: mention auto-setup-output-names menu items
--csurf: mid-click on csurf "h" button brings up full help
--csurf: 3 selected text widget logs black on linux (-selectforeground black)
--wrappers.tcl: helpwin: selected text widget help black on linux
--csurf: viewonehelp: focus on helptext, position cursor beginning
--wrappers.tcl: helpwin: focus on helptext, position cursor beginning
--wrappers.tcl: helpwin: OK kills search panel like "x"
--wrappers.tcl: helpwin: fix alt-f,g to work on Linux
--csurf: viewonehelp: fix alt-f to work on Linux
--wrappers.tcl: helpwin: strip periods from helpfile name (b/c window path)
--wrappers.tcl: move replchar from csurf to here (now needed in helpwin)
--csurf: move replchar to wrappers.tcl (needed by helpwin there)
--lib/tcl/{flattenmovie,inflatemovie}.tcl: use parms (bug from changed controls)
--lib/tcl/{movie360,phasemovie,offsetmovie}.tcl:use parms (new ctrls),close@end
--csurf: check/block/warn "#" in recon-all pathname (subshell fails)
--csurf: file chooser height 400->500
--csurf: italicize (bold/unbold) main all help TOC headings
--csurf: rename ifont->ifontb, add ifont for allhelp
--wrappers.tcl: rename ifont->ifontb, add ifont
--csurf: add hemi,3dradios,surfradios,other3dvol to help TOC
--lib/help/csurf/csurf: help TOC, Cmd-f/NEXT,<Ret>,Cmd-g, search big help
--csurf: bind Alt/Cmd-H to all help in one window (CSURF_HELP.txt)
--csurf: finish R-click help (hemi, 3d radios, surf radios, other 3d vol)
--mk0{.csh}: add new helpfiles
--lib/help/csurf/{rc-hemi,rc-volradio,rc-vol,rc-surfradio}: new helpfiles
--csurf: use wrapper26nm.tcl onefindpanel for onehelp window in allhelp
--wrappers.tcl: add search to help panels (Cmd-f, NEXT==<Ret>==Cmd-g)
--lib/help/csurf/{csurf,rc-surface} mention make empty subject
--tksurfer.c: read_binary_values: VTK: check first line only, skip to POINT_DATA
--tksurfer.c: read_binary_surface: VTK: more feedback, more checking

### UPDATE: 21 Nov 2015
--lib/help/csurf/{csurf,rc-surfaces}: HOWTO make vtk surf appear in "surface:"
--csurf: surface combo includes $hemi.{orig,inflated}* at end, better sorting
--lib/help/tksurfer/val: doc new multi-column ASCII .vtk vertex data format
--lib/help/csurf/csurf: doc new ASCII .vtk surface format
--tksurfer.tcl: "val:" line "R" choose column num popup if .vtk filehdr ncols>1
--tksurfer.tcl: also load *.vtk files (sub+sess) to "val:" (ignore $hemi)
--tksurfer.c: read_binary_values: .vtk w/3lines: POINT_DATA,SCALARS,LOOKUP_TABLE
--tksurfer.tcl: also load *.crv files into "val:" dropdown (ignore $hemi)
--medtestrender checks functscanlists($page,tkregtargdir) exists old csurf.dat
--csurf: add explicit csurf "h" help butt lower right (parallel to tksurfer etc)
--tkregister.tcl: small upper left "h" button for tkregister help
--tkmedit.tcl: small upper left "h" button for tkmedit help
--tksurfer.tcl: small upper right "h" button for tksurfer help
--wrappers.tcl: allow abs helpfile -- tk{surfer,medit,register} in csurf subdir
--csurf: R-click csurf help from intermenu, above "Structural"/"Functional"
--lib/help/csurf/{viewscandirs,handnormalize}
--csurf: R-click help for SessionTools setup panels
--csurf: all help: add omitted "val:" line help for "W" button
--lib/help/tksurfer/val_write: better explanation of C/tcl functions used
--lib/help/tksurfer/label_timecourses: pointer to % from already painted _x,_y
--lib/help/tksurfer/label_corr: better documentation of wrapper functions
--Csurf.app (no change to applescript) now works on Mac OS X 10.11
--csurf: rm env: surftestrendernopanel, medtestrender, surftestrender
--csurf: rm env: fixinflatedavg, fieldsigncmd, findretinborderscmd
--csurf: surfercmd: tclenv->file, if $csurftclenv != "",readenv.tcl uses to set
--csurf: mk3dscript, mkviewcutscript, mkflatscript source readenv.tcl
--readenv.tcl: $csurftclenv exists/nonempty/there, var=val lines set tcl vars
--[tkmedit.c/tkregister.c don't need -csurftclenv: no tcl vars passed via env]
--[need -csurftclenv b/c can't use env, even tho it *does* pass non-PATH,DYLD]
--tksurfer.c: new/exported csurftclenv: non-empty only if -csurftclenv <arg>
--csurf: new: DYLD_LIBRARY_PATH=$CSURF_LIBRARY_PATH exec wish8.5 $0 ${1+"$@"}
--csurf: go back to sh vs. tcl comment startup trick to pass DYLD_LIBRARY_PATH
--csurf: old: #! /usr/bin/env wish8.5 => fail: env doesn't pass DYLD to subshell
--FreeSurfer.{c}sh: CSURF_LIBRARY_PATH to fix Mac OS X 10.11 nopass-env2subshell
--MacOSX 10.11 (ElCapitan): PATH, DYLD_LIBRARY_PATH not passed to subshell
--csurf: fix writelog if run dir moved out from under running csurf

### UPDATE: 10 Oct 2015
--csurf: Render panel: add/cpprev botedgelutflag,zerosymmfadeflag
--tksurfer.tcl "bot","sym" on F3 panel, sm radios: "none"->"no", "curv"->"cv"
--mk0{.csh}: add new helpfiles
--csurf: add new LUT flag helpfiles, add all-help curvtick/offset/cvfact line
--lib/help/tksurfer/{botedge,zerosymm,val2rgb,curv_tick}: new helpfiles, update
--tksurfer.tcl: intplut->intp, bot/$botedgelutflag, sym/$zerosymmfadeflag ticks
--tksurfer.tcl: F2 panel: replace "none" and "curv" radios with "curv" tick
--tksurfer.c: clamp hi/lo non-interpolated center-defined colors (was trunc)
--tksurfer.c: 8 LUT cases: interpolateflag x botedgelutflag x zerosymmfadeflag
--lib/help/tksurfer/val2rgb: fix doc fabs fthresh, add zerosymfadeflag
--csurf: sphavglists(00,clustsurf) to pick surf used by surfclust for area calc
--tksurfer.c: disp window keyboard pose changes now logged (like tk window)
--tksurfer.tcl: fmid/fslope/angle_cycles/angleoffset keyboard shortcuts logcmd's
--tksurfer.c: R-click clear vertices does logcmd
--csurf: env-overriding dotcsurfrc read/write Csurf.app only (it can't see env)
--tksurfer.tcl: DIST and Dijk also return pop-ups (was just log)
--tksurfer.c: use genstrret_1k to return Euclidean dist
--tksurfer.tcl label-line binds: if notdivider => if divider break (OK in bind)
--tksurfer.tcl: brainpose by sliders reports C/tcl cmds to tcllog (vs tcl procs)
--csurf: fixswfileprefs: ImportStats no-match-mask-err popup->log, rm 10.10 hack
--csurf: menu item to write .csurfrc using current state of subj/sess/FSURF dirs
--csurf: if ~/.csurfrc exists, read "export name=val" to tcl env if exist tclvar
--applescript/Csurf.app: make applet.icns (flat, darken red)
--mk0{.csh}: include applescript in "dist", make Csurf.app if Darwin "insttmp"
--applescript/Csurf.app: source .csurfrc else mkdir fsdata/{subjects,sessions}
--tksurfer.tcl: "val:" line "R" choose frame popup if .mgh fileheader nframes>1
--tksurfer.c: new/exported funct, read_mgh_header (partial, uncompressed only)
--tksurfer.c: new/exported var, mghvalframe: choose later frame in .mgh valfile
--nmovie.c: rm XSetInputFocus (was X crash on Ubuntu14 laptop, some 10.9)
--surfclust.cpp: read given frame .mgh file if instem suff .mgh, wfile out only
--surfclust.cpp: readmgh (e.g. lh.cope1.mgh 1974x1x83=163842 w/2 frames)
--tkmedit.tcl: force show "roi" tick on read upsamp roi
--csurf: SetupFunct panel "SubjectDir Target Image Set" controls stats underlay
--lib/help/csurf/HOWTO: new section on disp 3D retinotopy, revise fourier/surf
--tksurfer.tcl: warn/help bad non-integer SMOOTH args
--tksurfer.tcl: warn ROI fill ignores truncphase, return
--wrappers.tcl: helpwin -inactiveselectbackground $bgcol to avoid black
--csurf: change reconall/avgsurf script to req. tcsh (maybe tcsh inst'd w/o csh)
--csurf: check tcsh installed also for reconallcmd, avgsurfcmd w/start anyway
--csurf: startup check tcsh installed (for recon-all), warn/allow start anyway
--csurf: better error msg on refuse to overwrite NIFTI already conv from BRIK

### UPDATE: 22 Sep 2015
--cleanup csurf startup (warn no $CSURF_DIR before try load tix)
--Mac: add yosemite hack to help panel
--lib/help/*/*: major update/cleanup/regularization of 320+ help panels
--tksurfer.tcl: cmd-ctrl-left/right arrow rotates brain in plane
--tksurfer.c: ctrl-left/right arrow rotates brain in plane
--mk0{.csh}: renamed helpfiles, new helpfiles, include forgotten rot/trans help
--tksurfer.tcl: new help for "%:" scale entry
--csurf: clickable table-of-contents of ~320 helppanes in one clearable helpwin
--tkmedit.tcl: bold {x,y,z}Tal labels, change to left click
--tkmedit.tcl: bind new helps
--lib/help/tkmedit/{script_record,linewidth,linearflag,colscale}
--lib/help/tksurfer/script_record,brainpose: new helpfiles
--tksurfer.tcl: new help for click "tcl:" to record interface tcl commands
--wrappers.tcl: helpwin: fix $loc="varnotfile" broken by justraise using w=fname
--lib/help/csurf/rc-{subjects,surfaces,patches,sessions,scandirs,surfload{23}}
--lib/help/csurf/viewrgb: new helpfile
--tkmedit.tcl: respect new helpfile name (label -> seglabel)
--lib/help/tkmedit/label: rename helpfile label -> seglabel
--lib/help/tkmedit/im2label: new helpfile
--tkmedit.tcl: im2 popup now L-click, add R-click help, make action label bold
--csurf: compact clickable contents bound to most helpfiles
--tkregister.tcl: respect new helpfile name: fthresh -> fthresh2
--lib/help/tkregister/fthresh: rename helpfile fthresh -> fthresh2
--calcvert.c: allow curv/area/fs input to write to bare (swapped) floats
--tksurfer.tcl: redraw select_surfext fix stalebuff on 2x in funct on Mac (?)

### UPDATE: 12 Sep 2015
--all tksurfer/tkmedit tcl scripts now keep GLX window live while up
--{mri2mpg,slices}.tcl: rm dependence on tmpcontrols
--tkmedit.tcl: source $script resets userok for tmpcontrols->controls
--{borders,flattenmovie,inflatemovie,offsetmovie,phasemovie}.tcl:rm tmpcontrols
--tksurfer.tcl: source $script resets userok for tmpcontrols->controls
--csurf: turn off surfclust in SAMP2SUBJ (2nd pass) if clustarea not > 0.0
--csurf: SURFACE-STATS skips checkstale{regdat,wfile} if subj fsaverage
--lib/help/tksurfer/val3d_uniq: 'representative' vertices HOWTO for surf avg
--lib/tcl/movie360.tcl: fix popup hangs GLX win, allow redo (controls w/o wrap)

### UPDATE: 10 Sep 2015
--wrappers.tcl: undo intercept killbox in controls (user must save f, kill win)
--tksurfer.tcl: new dftctrls/corrctrls callers fro interactive parmfix w/o kill
--lib/help/tksurfer/{restore,redraw}: regularize alt click fmt
--lib/help/tksurfer/{swapstatval,area_{read,disp}}: regularize alt clk fmt
--lib/help/tksurfer/label_{read,read_cur,clear,read2val,write}: reg alt clk fmt
--lib/help/tksurfer/val_write: document val "W" button overload
--tksurfer.tcl: mid-click "W" on "val:" line: percent resp to .stat, wfile (_%)
--tksurfer.tcl: wrappers controls now intercepts killbox, do_corr pauses/kills
--tksurfer.tcl: inline corrctrls back into do_corr
--wrappers.tcl: controls: intercept killbox (no userok in proc): no caller hang
--wrappers.tcl: tmpcontrols: intercept upper-left 'x' kill no tkwait hang!
--tksurfer.c: compute_dftamp2pcnt2stat for percent from _x,_y without rawdata
--lib/help/tksurfer/label_corr: xcorruniq tick doc, HOWTO uniq
--tksurfer.c: corr_over_label: add Pearson p calc (circ corr already done)
--tksurfer.tcl: warn/explain missing find uniq vox vtxs
--tksurfer.tcl: add xcorruseuniqflag to xcorr pre-popup
--mk0{.csh}: add prev 15 new help files
--tksurfer.tcl: mid-click "val:" line CLR also clear unkiqvoxdata
--tksurfer.c: clear_uniqvoxnums -> clear_uniqvoxdata (num and cnt)
--lib/help/tksurfer/nsamp_{search,uniqvox,all,dfrac,bok,min,max}
--lib/help/tksurfer/nsamp_{fracmin,fracmax,step,op,pre,area,sul,gyr}
--tksurfer.tcl: wire find_uniqsamp_vertices to UQ
--tksurfer.tcl: paint_real_or_complex checks 3D stats loaded
--lib/help/tksurfer/val_clear: add clear_uniqvoxnums
--tksurfer.c: rm uniqvoxnum2pvalflag, add/export clear_uniqvoxnums
--tksurfer.c: add .uniqvoxnum to vtx struct, add uniqvoxnumloadedflag
--tksurfer.c: paint_surface always loads .uniqvoxnum (except normop=AVGN)
--tksurfer.c: save uniq 3Dvoxnum in new vtx struct memb .uniqvoxnum (was .pval)
--mk0{.csh}: add HOWTO helpfile
--lib/help/csurf/HOWTO: update basic retinotopy HOWTO
--csurf: new new second Help menu item: HOWTO (retinotopy)
--tkmedit.tcl: try TextEdit first
--csurf: try TextEdit before the execrable xedit...
--lib/help/tksurfer/val_lab,label_{label,stat,timecourses}: new button names
--lib/help/tksurfer/val3d_{paint,read}: new button names
--mk0{.csh}: mv val3d_clust to val_clust, add new helpfile
--lib/help/tksurfer/val3d_uniq: new helpfile
--tksurfer.tcl: mv val3d: CLU to val: CS, squish
--tksurfer.tcl: rm val3d: S/V, add val3d: UQ, rename val3d PNT->PAINT
--csurf: Make Scandirs, Find/Copy Raw better warning if sess is "__nosession__"
--csurf: reconall warns/explains empty subjdir (vs. ask tick to use edited wm)
--lib/help/tksurfer/val3d_{read,paint}: doc tcl wrapper functs
--tksurfer.c: select_uniqsamp_vertices: just redraw uniqvox cent vtx selects 
--tksurfer.c: find_uniqsamp_vertices: get vtx nearest avg of vtxs sampling 1vox
--tksurfer.tcl: add R-click popup help to NormSamp popup
--tksurfer.c: click vertex also prints pval
--tksurfer.c: paint_surface: was no-search=>real, now: non-avg-search=>pval
--tksurfer.c: rename paint_surface uniqvoxnumflag to uniqvoxnum2pvalflag
--tksurfer.c: mv uniqvoxnumflag to write_label_timecourses: uniq->ROI, can wrap
--tksurfer.tcl: "X" pre-pop-up reports corr results type, fields where they go
--csurf: fix quote smooth_curv command for fixing inflated_avg surf (crashing?)
--tksurfer.c: corr_over_label: fix xcorr div by zero, norm covar by vtxcnt
--lib/help/tksurfer/val_bi: doc arbitrary col1 and col2
--lib/help/tksurfer/label_corr: covar tick doc
--tksurfer.tcl: add xcorrcovarflag tickbox to Searchlight popup
--tksurfer.c: fix printvtxdata sometime crasher if click in background (!)
--tksurfer.c: add/export xcorrvarianceflag: if 1, save numer (var), not corr
--tksurfer.tcl: popups warn/explain overloaded clicks:
--tksurfer.tcl:  (cont.) vtxcolflag, annotbordflag, gradvecbakflag,
--tksurfer.tcl:  (cont.) gradvecflag, zerosymmfadeflag, angoffrevarrflag,
--tksurfer.tcl:  (cont.) arrownormflag, nonbinaryfsflag, bordneiflag
--lib/help/tksurfer/val_read: rewrite, doc read .mgh
--lib/help/csurf/val: doc accepting 1D .mgh file
--lib/help/csurf/csurf: better AFNI HEAD doc
--fourier.c: stop writing AFNI ORIGIN 2x! (first was copied, second was 0,0,0)
--lib/help/tksurfer/label_read2valcut: file removed (put into "R" button)
--lib/help/tksurfer/label_*: add titles, update for rm RC, improve readcut
--tksurfer.tcl: "RC" button (read/cut) rm'd, mv funct to shift-middle-click "R"
--tksurfer.tcl: if NormSamp controls there, just raise window vs. make another
--tksurfer.tcl: make "label:" bold to indicate clickable
--randsurfclust.cpp: better cmdline help
--lib/help/csurf/setupsphavg: better help for randsurfclust
--tksurfer.c: circ_corr: if pval==0.0, clamp max pos p-value exponent to 37
--lib/help/tksurfer/{label_corr,swapstatval,val_clear}: doc pval calc/clear
--tksurfer.tcl: mid-click "val:" line CLR also clear pvals
--tksurfer.c: add/export clear_pvals()
--tksurfer.tcl: force stat mask OFF on complete xcorr
--tksurfer.tcl: 3rd overload S/V: swap_pval_val (pval only exposed this confirm)
--tksurfer.c: add pval calc to circ corr, dump -log10(p) to new .pval field
--tksurfer.c: add/export swap_pval_val(), pvalloadedflag
--tksurfer.c: add .pval to vertex structure, clear to 0 on surfread
--tksurfer.c: Jet/CARET draw_colscalebar sets bar max/min to truncphase max/min
--lib/help/tksurfer/label_corr: warn effect of swap
--tksurfer.tcl: warn stat/val swapped so click vtx log reports stat as 'val'
--lib/help/tksurfer/{curv_bgcol,overlay,offset,cvfact}: update
--tksurfer.c: fix forgot-to-cache complex displayed as amp (luta,jet,CARET)
--tksurfer.tcl: auto redraw radio change in colscale popup, rm REDRAW button
--wrappers.tcl: helpwin: just raise if already there (was create copy)
--lib/help/tksurfer/{val_lt,val_jt,val_vd}: updates
--tksurfer.tcl: videen: real:zerosymmfadeflag=0,cplx:zerosymmfadeflag=1 (toggle)
--tksurfer.tcl: CARET: zerosymmfadeflag=0 (mid-click to toggle)
--tksurfer.c: dup zerosymmfadeflag fade code to Videen/CARET, cplx amp scalebar
--tksurfer.tcl: overload mid-clk colcontrols real LUT: toggle zerosymmfadeflag
--tksurfer.c: LUT: zerosymmfadeflag for fabs val/stat before cf fmid/sfmid
--tksurfer.c: LUT: wire in fthresh/sfthresh/fmid/sfmid (was:fthresh,nofabsfmid)
--csurf: fixswfileprefs real+mask confirmalert's self-cancel if yosemite_hack

### UPDATE: 23 Aug 2015
--tksurfer.c: ShiftKeyUp clears missed UpClicks (fix Shift-NoClick uses Motion)
--tkregister.c: hack allows non-abs .mgz->.mgz: tkregister zz1.mgz zz2.mgz
--tkregister.c: hack allows no-opt .mgz->.mgz: mkstructregdat, unset blur/invert
--tkregister.c: opt -mkdefstr to mk default struct reg.dat
--tksurfer.tcl: if .colcontrols there, just raise it (break works in bind!)
--lib/help/csurf/setuprender: doc CARET/MATLAB complex amplitude
--lib/help/tksurfer/{val_jt,val_vd}: update for complex amplitude display
--tksurfer.tcl: fixcolscale sets now-allowed complex amp if real+imag loaded
--tksurfer.c: if complexvalflag set, CARET/MATLAB_JET both work for complex amp
--tksurfer.tcl: "Bg" to "Col" ("Colscale" omitted before)
--tksurfer.tcl: add R-click help to colscales pop-up radios, explain midclk-ltw
--mk0{.csh}: lib/help/tksurfer/{val_w4,val_lta}: new helpfiles
--tksurfer.c: prev weird fix not required (but OK) on Linux (Mac bug?)
--tksurfer.c: mv make_color_luts after read_image_info fix FRED_TONO wrap fail?
--csurf: add ColorScale: "w4" (fred tono) to addrender, "jt" -> "jet"
--tksurfer.tcl: add w4=18=FRED_TODO to fixcolscale, colscale pop-up
--tksurfer.c: add colscale=18=FRED_TONO built-in LUT
--lib/help/csurf/{setupfour,setuprender}: "cp prev" button
--csurf: "cp prev" button on Fourier panel StimCycles line
--csurf: "cp prev" button on Render panel ResetToDefault line
--csurf: don't blow away rendertype copied to unconfig'd from Fourier phasetype
--lib/help/tksurfer/{val2rgb,val2rgb_write}

### UPDATE: 28 Jul 2015
--lib/help/tksurfer/label_timecourse: update
--tksurfer.c: fix missed ctrl key-up w/long read_rawdata
--tksurfer.c: ctrl-mid-click vertex prints pcntsigpk2pk if 3D stats loaded
--tksurfer.tcl: shift-right-T to get avg pcnt change from label
--tksurfer.tcl: ROI butt pop-up warns fill to stat/complexamp/real ([s]fthresh)
--tksurfer.tcl: pop-up pre-report value: line CLR actions
--tksurfer.tcl: pop-up pre-report def/nondef label D,C,CLR,R,RC,W butt actions
--tksurfer.c: label timecourses opt reports pcnt activ for label to pcntsigpk2pk
--bin/noarch/runra.{sh,csh,tcl}: add directory setup example
--tksurfer.tcl: report 3rd file (avg float tcourse) now written by "T" button
--tksurfer.c: rawdata_avgtseries: int->float, write out 3rd file (avg raw t)
--lib/help/csurf/{tkmedit,makenewsubj,reconall}: update
--lib/help/tkmedit/{saveimg,compare,wmfilterstd,wmfiltergau,test1}: updates
--tkmedit.tcl: mid-click F3 TEST runs locnorm_allslices hacks (median/histmax)
--tkmedit.c: calcgradampdd from dir. deriv. Gaussian functs
--tkmedit.c: calcgradamp from x,y,z neighbors (from tksurfer)
--tkmedit.tcl: mid-clk-COMPARE swaps *contents* of editable and COMPARE buffers
--tkmedit.c: don't kill tkmedit if shift-right-clk w/o register.dat (!)
--tkmedit.c: shift-mid-clk print3dhist: dump loc 3D hist, disp in gnuplot
--tkmedit.c: locnorm_allslices: alt norm uses smoothed hist max -> abandon both
--tkmedit.c: fix wintitle on read new editable (like already working im2)
--tkmedit.c: multi-thread locnorm_allslices (8x faster on i7)
--lib/help/tksurfer/label: update for cross-corr over label (X) button
--tksurfer.tcl: put corrctrls at top of do_corr (else prevents change cmptype!)
--tksurfer.tcl: warn/block FILL if label loaded but not shown
--tksurfer.c: display/clear label/MGHannot sets annotloadedflag, export it
--tksurfer.tcl: don't set swap_*_explain vars so overloaded S/V always reports
--tkmedit.c: mediannorm_allslices: normalize by mult by avgbrain/3Dmedian
--tkstrip.c: allow -outim to overwrite built-in scripts default outfiles
--lib/help/tksurfer/patch_cut: typos
--csurf: MGHTools -> Register Surface (to symm) wired up
--tksurfer.c: shrink_area: bordneiflag: add 2% tangential force fix ragged edge
--tksurfer.c: write_binary_areas{2}: b/c vtx correct, restore 2x bug at outfile
--tksurfer.c: fix compute_normals_areas compute vertexwise area for quads
--tksurfer.c: move read_binary_areas oldarea 0.5x correct: areatotal->vtxlevel
--mk0{.csh}: update for new help file
--lib/help/csurf/inflatepatchhires: new help file
--tksurfer.c: rmvtx2nonbordflag to block rip vtx w/no 2nd order non-bord nei
--tksurfer.c: area_shrink() rips vertices w/no 2nd order non-border neighbors
--csurf: tksurferinflatepatch: interactive initial pose adj, final surf inspect
--csurf: reconallcmd warns missing MGH license file
--csurf: tksurferinflatepatch allows write tiffs
--README.txt: update Mac middle-click/X11->input help
--csurf: SubjectTools -> Inflate Surface Patch (hi-res): tksurferinflatepatch
--tksurfer.c: add compute_normals_areas reportflag arg to fix too-verbose shrink
--csurf: change to subject at startup if csurf started in subject's script dir
--lib/help/tksurfer/restore: documents really_center_brain
--tksurfer.tcl: shift-mid-click RESTORE overload: does really_center_brain
--tksurfer.c: shrink_area: alt border policy: bordneiflag (avg of non-bord nei)
--tksurfer.c: smooth_logarat: catch zero area (e.g., from def FS midline)
--tksurfer.tcl: if areaflag, recalc full area on white, else def zero midline
--tested->OK: brik2cor:native _f -> zz.mgz, tkmedit:read zz.mgz as native stat
--tkmedit.tcl: read native stats (valn): accept .mgz/mgh, load to valn dropdown
--tkmedit.c: read mgz/mgh float stats: extend mknativestatbufs, read_native_stat
--tkmedit.c: new funct: get_mgzdatatypedims, get_mgzdatatype wrapper discards
--tkmedit.c: fix repeat-arrowkey overhang GL win (slower, 1 down skipped after)
--lib/help/csurf/tkmedit: document toggle roi button, correct s->up typo
--tkmedit.tcl: re-enable SEND/GOTO if turn off all3 while zoomed
--tkmedit.c: allow -scalefac,-offset w/byte images
--tkmedit.c: make options work w/2arg: tkmedit orig.mgz -opt ...
--tksurfer.tcl: popup reports samp lims in label->ROI-BRIK like tksurfer.c
--tkmedit.c: better help/err for float mgz
--brik2cor.c: flag (-floatmgzout) to output a float mgz
--tksurfer.tcl: warn $scandir equals __noscandir__ for MGH label -> 3D ROI BRIK
--tksurfer.c: 3D ROI from label incl samp lims in BRIK name {fr/mm}={min}to{max}
--tkmedit.c: check/require read_regdat done for read_native_{stat,roi}
--tkmedit.tcl: readnativeroi: read_native_roi,do_regupsamp_roi,labelflag,redraw
--csurflib.c/h: add makeshort3D/freeshort3D (for tkmedit read native ROI)
--tkmedit.c: write/export read_native_roi(), do_regupsamp_roi()
--lib/help/tksurfer/label_read: explain overloaded function
--lib/help/tkmedit/{valn_read, roiup}: fix typos
--mk0{.csh}: update for prev renames
--lib/help/tkmedit/{roin2up,roin,roin_read}: new helpfiles
--lib/help/tkmedit: rename roi_{read,write,time} -> roiup_{*}, roi -> roiup
--tkmedit.tcl: toggle roin/roiup state (native vs. upsamp) of 3D ROI label line
--tkmedit.tcl: rename $label->$uplabel, add $rawlabel
--tkmedit.c: rename label->uplabel, add rawlabel, tclexports, -rawlabel cmdline
--csurf: mid-clk "fsavg" button sets oppfsavghemiflag (disp on opp fsavg hemi)
--tkmedit.tcl: fix bug in error message, add help for read non-conforming ROI
--lib/help/tksurfer/{arrownorm,swapstatval,val_clear}: top summaries
--README.txt: rm anachronisms, intro FUNCT/STRUCT DIRS, say cp MGH fsaverage
--csurf: mknewfunct: fix "mvlog mv ..." bug in attempting to mv aside session
--tksurfer.tcl: Dijk checks if MGH geodesic binary is there (e.g., not in 5.1)

### UPDATE: 15 May 2015
--fix bug: forgot-to-global-brainregioncnt prevented using do_corr w/MGH annot
--fix bug: lastcolscale was -1 on first complex swap from dup'd fixcolscale var
--csurf: SubjTools->ReMake surf 1hemi only tessellates 1 despite possible stale
--lib/help/csurf/tksurfer: label button overloads, top summaries, writearea, GR
--lib/help/tksurfer/area_{disp,read}: top summaries
--lib/help/tksurfer/{label_{read,readcut,clear,read2val,write}: top summaries
--tksurfer.tcl: warn popups for non-def overload actions "label:" line "D" butt
--tksurfer.c: annotcol2brainregionname exp->tcl, write outp to $brainregionname
--lib/help/tksurfer/label_read: new "D" overloads
--tksurfer.tcl: "label:" ctrl-shift-left-"D" conv all annot regions to ROIs
--tksurfer.tcl: "label:" shift-left-"D" conv 1 clicked annot region to ROI mask
--tksurfer.tcl: "label:" shift-mid-"D" conv label to AFNI ROI mask BRIK
--tksurfer.c: write rawdata-res 3D ROI mask BRIK of vox sampled by label/annot
--tksurfer.c: AFNI write_head()
--mk{.csh}: add new helpfile, label_label, to dist
--lib/help/tksurfer/label_label: new helpfile
--lib/help/tksurfer/{curv_bgcol,val3d_paint,label_stat,label_timecourses}
--tksurfer.tcl: R-click "label:" now brings up help panel (better consistency)
--tksurfer.tcl: bind sample controls popup to (default) L-click "label:"
--tksurfer.tcl: "winxy:" reports clamped-to-screensize number after short delay

### UPDATE: 02 May 2015
--csurf: Fourier panel PAINT skips surfclust if cluster area is zero
--tksurfer.c: multitimecourseflag restore orig overlay behavio, tcl script only
--lib/help/csurf/tksurfer: improve GL/tk win overloaded clicks docs
--tksurfer.c: popup at init rawdata load 1 timecourse, skip show orig/samp surf
--lib/help/tksurfer/{val_jt,val_vd}: doc fixed controls
--tksurfer.c: fix videen-style fthresh trunc, disable videen fmid/fslope
--tksurfer.tcl: L-click "Bg" gives popup w/verbose radio labels all colscales
--tksurfer.tcl: fmid/fthresh/truncphase{min,max} presets on click "jt", "vd"
--tksurfer.tcl: warn/explain panel for display gradient ampl as shading
--tkmedit.tcl: update to new trace syntax
--tkregister.tcl: update to new trace syntax
--tksurfer.tcl: update to new trace syntax
--csurf: add "vd" CARET VanEssen "videen-style" to View Funct Data colscales
--lib/help/tksurfer/{val_w1,val_BRy,val_BRw}: update help
--tksurfer.tcl: middle-click overload: BRy->jet, BR->vd (without F3)
--mk{.csh}: add new helpfile, val_jd, to dist
--lib/help/tksurfer/val_vd: new helpfile
--lib/help/tksurfer/{val_jt,truncphasemin,truncphasemax}: doc use trunc limits
--tksurfer.tcl: select jet/vd zeros fthresh/fmid, resets truncphasemin/max
--tksurfer.tcl: add Caret videen-style "vd" colscale on F3 panel
--tksurfer.c: add CARET/VanEssen "videen-style" colscale=17=VIDEEN_STYLE
--lib/help/tksurfer/{fmid,fslope,angle_offset}: add shortcuts
--mk{.csh}: add new helpfile, smooth_grad, to dist
--lib/help/tksurfer/smooth_grad: new helpfile
--tksurfer.tcl: F3 panel smoothtype "gr" (tcl:smooth <type=grad>), =valbakonly
--tksurfer.c: compute_grad_to_ori_in_baks <foldangle> for cereb curv gradients
--lib/help/tksurfer/{comp_grad,arrownorm}: update
--tksurfer.tcl: shift-middle-click arrownorm: conv/disp gradamp to real overlay
--tksurfer.tcl: comp_disp_grad only does compute_angles_vals_to_baks if phase
--tksurfer.tcl: horrible hack for yosemite slowdown: tmp xterm over tools panel
--tksurfer.tcl: "curv:" dropdown loads thickness, resets R/G colscale mid=2.3mm
--csurf: horrible hack for yosemite slowdown: tmp xterm over setupscans panels
--wrappers.tcl: positionpopup returns position (for yosemite csurf hack)
--lib/help/tksurfer/{swapstatval,comp_fs}: update
--tksurfer.tcl: swap_settings w/swap_{val_val2,stat_val,valval2_valbakval2bak}
--tksurfer.tcl: corrected prev binding (was an Shift in there, too)

### UPDATE: 10 April 2015
--tksurfer.tcl: overload unlab'd arrownormflag check w/toggle angoffrevarrflag
--tksurfer.tcl: editfile: 'open -e', touch to mk new file, OK on OSX 10.10
--tksurfer.tcl: toggle arrownormflag resets arrowscale (ON=>0.5mm, OFF=>5)
--tksurfer.c: fix compute_gradient on phase (save gradients til loop done)
--tksurfer.c: correctly track compute_angles r,i=>th,r thru swaps,push,readnew
--lib/help/tksurfer/comp_fs: document confusing polar angle grad directions
--tksurfer.c: read_{fieldsign,fsmask} now autodetects, correctly reads curvfmt
--mk0{.csh}: new helpfiles: arrownorm,arrowscale
--lib/help/tksurfer/{arrownorm,arrowscale}: new helpfiles
--tksurfer.tcl: arrownormflag/arrowscale unlabeled chk/entry under phasecont
--tksurfer.c: adjust grad vec colors if fieldsign so both visible over it
--tksurfer.tcl: "F" button to run fieldsign, optionally display 2 gradients
--tksurfer.c: filter/zero gradient outliers to zero -> dark red arrowheads
--tksurfer.c: finally made *seriously confusing* angoffrevarrflag hack work!
--tksurfer.c: angoffrevarrflag: angle_offset/revphaseflag ctrl win-rel arrows
--tksurfer.tcl: tick gradvec{bak}flag only resets parms if other not ON
--tksurfer.c: arrownormflag: ignore amplitude, arrowscale sets length in mm
--tksurfer.tcl: overload nonbinaryfs tick w/toggle gradvecflag,gradvecbakflag
--tksurfer.tcl: "GR" button to run compute_gradient
--tksurfer.tcl: squish entry, "sl:" to nothing, to mk space for "F"/"GR" butts
--tksurfer.tcl: squish "sl:" to nothing to make space for "F" and "GR" buttons
--mk0{.csh}: new helpfiles: comp_fs,comp_grad
--lib/help/tksurfer/nonbinaryfs: update for toggle gradvec{bak}flags overload
--lib/help/tksurfer/{comp_fs,comp_grad}: new helpfiles
--tksurfer.c: fsdata2gradsflag: compute_fieldsign converts data to gradients
--tksurfer.c: compute_gradient: arg=2=phase (circsubtract) -> valbak,val2bak
--tksurfer.c: draw_cursor norm/big: don't draw select edges to ripped vertices
--tksurfer.c: add adjustable gradient arrowheads, add/export arrowscale
--tksurfer.c: block compute_{fieldsign,gradient} on non-flat surface
--tksurfer.c: add/export compute_gradient(0=curv,1=val) -> valbak,val2bak
--mk0{.csh}: add new helpfile: djik
--lib/help/tksurfer/dijk: new helpfile
--tksurfer.tcl: Dijk: warn/use $hemi.curv if $hemi.smoothwm.H.curv not found
--tksurfer.tcl: "Dijk" butt measure/disp ~geodesic path between last 2 selected
--tksurfer.c: add/export print_selected_list(): scripts/CurrVtxList.txt else log
--tksurfer.tcl: select_curv rec $hemi.area.logarat, fix R/G colscale resets
--bin/noarch/mri2mpgs: fix AFNI bg, recursive subdirs problem
--lib/help/csurf/tksurfer: doc "area:" line "D" button, "label:" line "X" butt
--lib/help/tksurfer/area_disp: explain new function and revised "D" bindings
--tksurfer.tcl: rebind area "D": left=>logarat,mid=>arat,shift-mid=>pial/white
--tksurfer.tcl: calcdisp_curr2orig_logarat: use compute_logarea
--tksurfer.c: add/export compute_logarea()
--lib/help/tksurfer/label_corr: clarifications

### UPDATE: 22 Mar 2015
--tksurfer.tcl: report searchlightvtxcnt, global label to fix setfile in docorr
--lib/help/tksurfer/label_corr: document circ corr
--tksurfer.tcl: corrctrls popups documents CircCorr
--tksurfer.c: implement circular correlation in corr_over_label
--tksurfer.tcl: rm corr parms from label popup, add setup prepopup to "X" butt
--tksurfer.tcl: confirm 3 kinds of swap with a diagram of stack
--tksurfer.tcl: swap/show corr, reset col when done w/corr_over_label/annotcol
--tksurfer.c: do GLX window events during corr_over_label, find_retin_borders
--tksurfer.tcl: overload "X" button: middle-click does corr_over_annotcol
--tksurfer.c: corr_over_annotcol (wrapper, like annotcol stats/timecourses)
--csurf: Preferences -> Bigger Logs: 7 lines vs. 18 lines each
--wrappers.tcl: change def helpwin (tksurfer/tkmedit popups) rows 11 -> 18
--lib/help/tksurfer/label_stat,label_timecourses,nocut,swapstatval: updates
--lib/help/tksurfer/label: document SamSrf labels
--tksurfer.tcl: label: "R" auto-reads pair of SamSrf labels given either one
--tksurfer.tcl: label: dropdown loads SamSrf ${hemi}_pRF_sf_{pol,ecc}_r.label
--tksurfer.tcl: also load SamSrf labels like: ${hemi}_pRF_sf_pol_r.label
--tksurfer.tcl: if Mac, look for TextEdit (N.B.: not good for fullscreen)
--tksurfer.c: corr_over_label cmdline help (shell and tcl interp)
--tksurfer.tcl: bad fill/cmp type error/help for docorr (before log errors)
--tksurfer.tcl: bind mid-click nearestbuttons to set fillneartype (L-click too)
--tksurfer.tcl: fillneartype, cmptype state now maintained by interface
--mk{.csh}: add new helpfile
--lib/help/tksurfer/label_corr: new helpfile
--lib/help/tksurfer/swapstatval: update explain new/revised bindings
--tksurfer.tcl: add "X" button to label line to run corr_over_label
--tksurfer.tcl: swap_val_val2=>mid-S/V, swap_valval2_valbakvalbak2=>shift-mid
--tksurfer.c: read_label_to_val sets valloadedflag
--tksurfer.c: corr_over_label: searchlight correlation (real/cplx to real/cplx)
--update mk0{.csh} to including pfbrik
--bin/noarch/pfbrik: new csh script to run tkmedit gauss planefilter on BRIK
--cor2brik.c: fix out HEAD ORIGIN(-128,128,128),DELTA(1,-1,-1): correct reexport
--csurf: fix kill RECON-ALL purple: hand-kill recon-all+tee, rm IsRunning file
--csurf: recon-all panel: fix return to same dir for second+ input files
--lib/help/csurf/reconall: document BRIK allowed
--csurf: ask to auto-convert AFNI BRIKs provided by FIND to recon-all panel
--lib/help/tksurfer/{label_timecourses,label_stats}: document the 9 functions
--tksurfer.tcl: bind all 9 cases to "T" (3 cases) and "S" (6 cases) buttons...
--tksurfer.tcl: add arg/errchk tcl funct getstattseries label/annotrgb/annotall
--tksurfer.tcl: add arg/errchk tcl funct getstat for label/annotrgb/annoall
--tksurfer.tcl: add arg/errchk tcl funct gettseries for label/annotrgb/annotall
--tksurfer.tcl: expand S/T to 9 cases: time/stat/both by label/annotrgb/annotall
--tksurfer.c: write_annotcols_timecourses_stats (same: all regions curr annot)
--tksurfer.c: write_annotcol_timecourses_stats (tmpfile->write_label_timecrs..)
--lib/help/csurf/tksurfer: fix direct manip mouse doc
--tksurfer.c: swap Shift-mid/right click to trans/scale to be same as Freeview
--tkmedit.tcl: context-sensitive F5 help if surface not loaded
--tksurfer.c: set_annot_alpha forces alpha "{U,u}nknown" region to transparent
--lib/help/tksurfer/label_toggle
--tksurfer.tcl: shift-middle-click label tick toggles annotbordflag
--tksurfer.c: read_label_to_annot_using_col also finds borders for single label
--tksurfer.c: read_mgh_annot finds borders of labels, annotbordflag toggles vis
--tksurfer.c: MESH r,g,b reports clicked color of single labels, too

### UPDATE: 06 Mar 2015
--lib/help/tksurfer/{label,label_read,label_readcut,label_clear,label_write}
--lib/help/tksurfer/{meshr,meshg,meshb,smooth_steps,cuts}
--tksurfer.tcl: label buttons chk suff, then setfile, check{read,write}labeldir
--tksurfer.tcl: shift-left-"W" overload to get: write_val_annotedcol_vertices
--tksurfer.c: recog subj root if cmdline started in label dir, better indents
--wrappers.tcl: use join to flatten list of args passed by testreplace
--tksurfer.c: write_val_annoted{col}_vertices write complex if complexvalflag
--tksurfer.c: write_annoted_vertices renamed to write_val_annoted_vertices
--tksurfer.c: clear_annot also clears/frees brainregions
--tksurfer.c: if MGH annot loaded, update r/g/b entries with current annot col
--tksurfer.tcl: add $anlabel to setfile list (rm unused $annot)
--tksurfer.tcl: labelentry/D now also load/use .annot files as well as .label
--tksurfer.c: write_val_annotedcol_vertices: dump out vtx data from 1 MGH annot
--tksurfer.c: click prints annotname by rev lookup annot color in MGH 'LUT'
--tksurfer.c: read_mgh_annot: read MGH .annot to brainregion struct, load color
--tkmedit.tcl dup "surf" tick F5 panel (N.B.: must load surf before goto F5)
--tksurfer.tcl: scroll entry to useful end of filename after select val/val3d
--tksurfer.c: fix funct name: rightclick_vertex -> middleclick_vertex (!)
--lib/help/tksurfer/{label,val3d_read,val3d_clust}: update
--tksurfer.tcl: add copy of S/V button to val3d for read/paint/swap 3d stats
--tkregister.tcl: bigger Linux putbelowtkwin gap startup interface size change
--tkregister.c: add 10 to Linux TKGL_YGAP avoid Ubuntu startup overlap problem
--tksurfer.tcl: val3d: warn/fix colscale mismatch, help (PNT to see, samp ctrls)
--lib/help/csurf/tkmedit: document F5 interface, rm stale cmdline example
--tkmedit.tcl: add long/thin fn-F5 micro interface
--lib/help/tksurfer/isocont: thicken isocont hot key
--lib/help/tksurfer/val_ltw: new file (update help list in mk0)
--lib/help/tksurfer/val2rgb: update complex phase vs. amp color LUT
--lib/help/tksurfer/val_jt: emphasize jet scale limits set by truncphase
--tksurfer.c: rm JET colscale return/cache so parallel to other colscale cases
--tksurfer.c: make read_ascii_surface tcl synonym for read_binary_surface
--csurf: change def morphtarg to buckner40 (MGHTools->Reg) to match recon-all
--csurf: load surf combo with orig? for import hacking (was orig,orig1,orig2)
--tksurfer.tcl: add "R" button on F3 "insurf:" for consistency
--copy surface format specs from lib/help/csurf/csurf to lib/help/tksurfer/surf
--lib/help/csurf/csurf: document ASCII surface format
--lib/help/tksurfer/{surf,hemisurf}: cleanup after interface code untangle
--tksurfer.tcl: allow full path in F2 "surf:" surface extension entry
--tksurfer.tcl: fix/rename/untangle select_surfext from fullpath F3 entry
--tksurfer.c: read_binary_surface detects/accepts #!ascii tri/quad/quad2tri
--csurf: fix inflate's'cycles typo blocking non-hi-res smooth/inflate
--mk0: add outsurfasc_write helpfile to list
--lib/help/tksurfer/outsurfasc_write: new helpfile
--tksurfer.tcl: add W-ASCII button on F3 interface for write_ascii_surface
--tksurfer.c: write_ascii_surface (tri or quad depending on ExpertPref flags)
--tkmedit.c: rm Tcl_Eval sendupdate (was no longer defined in tkmedit.tcl!)
--tksurfer.c: flush remaining queued click-drag xforms by lookahead to up-click
--tksurfer.tcl: expose phase LUT (lutw) in fn-F3
--tksurfer.c: glFlush in openglx to start w/black window (2x glFinish ignored)

### UPDATE: 20 Feb 2015
--tksurfer.tcl: shift-mid-click on "w1" -> switch to "w3" without needing fn-F3
--csurf: allow config/save 'w2' RGBY wheel colscale View Functional Data panel
--tksurfer.tcl: label combo listcmd live re-read labeldir (man reabbrev sm log)
--tksurfer.tcl: clear rgb combo on listcmd live re-read rgbdir (was appending!)
--lib/help/tksurfer => trim dashed lines that overflow in Linux help:
    label_readcut, val_w1, val_clear, swapstatval, restore
    label_write, label_stat, label_read2val, label_read
    label_clear, label,cuts, area_read, area_disp, angle_offset
--lib/help/tkmedit/imim2op -> trim dashed lines that overflow in Linux help
--lib/help/csurf => trim dashed lines that overflow in Linux help
--lib/help/tksurfer/label_readcut: update
--tksurfer.tcl: read_label_cut_clearvals 2 bound to label line Shift-Middle-C
--tksurfer.c: read_label_cut_clearvals <2=add>: add label to existing cut label
--tksurfer.c: clr/unmark: selected=-1 (dbl but not sglbuff was hiding drawcurs)
--lib/help/tksurfer/{val3d_clust,val_w1}: update doc
--tksurfer.tcl: warn/advise empty .stat on CLU after just read real-valued
--tksurfer.tcl: middle-click on "w1" -> switches to "w2" without needing fn-F3
--csurf: reinstate a chunk of code in concat stim file accidentally deleted
--tksurfer.c: locklabelflag also blocks curv/val smoothing under label
--tksurfer.tcl: logcmd locklabel (accidental omission)
--tksurfer.c: fix shrink-no-display crash: wrap XPending w/if(openglwindowflag)
--lib/help/csurf/setupsphavg: updated for inflated_avg pole fix
--csurf: AVGSURF button now auto-fixes giant triangles in poles of inflated_avg
--csurf: catch grep -c csurf to make csurf source'able again from wish8.5 prompt
--fix path typos in NOTES.txt doc about how to install fsaverage-adds.tgz
--N.B.: v9->v10 change can cause csurf crash on system w/mixed v9/v10 paths
--change Mac X11 compile to req XQuartz libX11.6.dylib vers10.0 (prev only Tix!)
--lib/help/tksurfer/{label_timecourses,xtrans,ytrans,restore}: update doc
--lib/help/csurf/tksurfer: update doc
--tksurfer.c: remap GL shift-R-click => ctrl-mid-click, directmanip => justshift
--csurf: if empty surfext, surf-missing popup notes opposite hemi surfs there
--lib/help/tksurfer/script: clean up doc typos/duplications
--calcvert.c: warn -padvalfile assumes oldcurv, warn >250K vtx, suggest meant nc
--calcvert.c: 04d: allow {swap}floatin -> all-vertices ascii

### UPDATE: 07 Dec 2014
--update to tcl/tk 8.5.17
--lib/help/tksurfer/script: document all 5 standard tcl scripts
--offsetmovie.tcl: update to be parallel phasemovie.tcl
--phasemovie.tcl: options: immed make mpg1 *or* dump simple num'd frames for QT
--lib/help/csurf/{tksurfer,tkmedit}: calcimg help for MGH read non-0 workaround
--calcimg.c: change pixsize=0 from error to report if option is -spacing
--movie360.tcl: fix intro'd bug (drawnflag missing '$'), allow/note save tiffs
--tksurfer.tcl: warn truncphasemin > truncphasemax: <Ret>in entries & tick->ON
--lib/help/tksurfer/truncphase -- N.B.: warn truncphasemin,max *don't* wrap
--csurf: VOLUME-STATS doesn't replace 3D _f with _h if StatMask Paintfile is _f
--csurf: fix 3 stale 'ps' options for Linux (fix csurf startup crash Ubuntu!)
--csurf: prefix all afni cmds with: env AFNI_VERSION_CHECK=NO <cmd> ...
--ima2brik: setenv AFNI_VERSION_CHECK NO, else to3d hangs if AFNI server down
--csurf: if MGHTools enabled, rm back compat from MGHTools and Help menus
--lib/help/csurf/{smoothcurvinflatesulchires,flattensurface,compat,handnormaliz}
--lib/help/csurf/{mkfinalsurfshires,mkfinalsurfs,makerelaxationcuts}
--lib/help/tksurfer/{val_bi,truncphase,truncphasemin,truncphasemax} -- R/G rev!
--lib/help/tksurfer/label_read: better description HOWTO fix cut w/label
--csurf: readheader: read/correct actual mgz pixsize/thick (was default to 1.0)
--csurf: paintcmd: rm infixlist1,2 junk, allow ExtStats read mgz special case
--csurf: new functscanlists(def,statformat) mgzsingle, cbx:select_statimage sets
--csurf: mghflattencmd now recognizes full*.patch* input patch as a "full"
--csurf: also load inflated combo w/sphere.reg???? steps
--csurf: when flatten done, reset patch combo to outp if there (was reset->1st)
--csurf: debug/fix put new session inside existing subject
--tksurfer.c: don't also clear all vertex marks if direct manip translate
--tkregister.tcl,tkmedit.tcl,tkstrip.tcl: block attempt to run directly
--tksurfer.tcl: select_patch leaves curr pose if patchname same except stepnum
--csurf: trim running progress wintitle so end of long patch name not truncated
--tksurfer.c: export rightclick_vertex, add float cmp_ for qsort TODO
--lib/help/csurf/csurf: hi-res offscreen render tcl script example (also:rgb)
--tksurfer.tcl: select_patch leaves current pose if prev surface was 3D
--tksurfer.tcl: warn .origarea redefined upon "R" on "area:" line
--lib/help/tksurfer/area_{read,write}: explain read/write data-field asymmetry
--tksurfer.c: write_binary_areas: rm confusing commit (cp curr area->origarea)
--tksurfer.c: rm old div-by-2 from normalize_area report (no effect on funct)

### UPDATE: 02 Nov 2014
--lib/help/csurf/csurf: update
--mk0{.csh}: add new helpfiles to tksurfer help list
--lib/help/tksurfer/fill3d{_mm,_normmove,_pix,_col,_fat,_op,_fillim,_saveim}
--tksurfer.c: chk/block out-of-bounds vtxnum (e.g., stale patch) in 3 readpatch
--tksurfer.tcl: block attempt to directly run tksurfer.tcl interface file
--tksurfer.tcl: chkwritefillim: warn no fill yet, no mgz read (get header vals)
--tksurfer.c: export fillimloaded, onemgzfileloaded for tksurfer.tcl checks
--tksurfer.tcl: F3 3dfill interface: normmv/pix/col/"fat"/fill_surf/writeims
--tksurfer.tcl: rm defunct "2d Vectors" line from F3: room for 3d fill at bot
--tksurfer.tcl: read patch (select_patch) no longer does viewcuts-like 180 rot
--tksurfer.tcl: RESTORE a *.patch.3d no longer rotates like a flat patch
--mk0{.csh}: add lib/help/tksurfer/{patch_mask,patch_cut}
--lib/help/tksurfer/{patch_mask,patch_cut}: new files
--tksurfer.tcl: add "C" (cut) button for read_binary_patch_to_cut
--tksurfer.c: read_binary_patch_to_cut: don't restore any, just cut away
--tksurfer.tcl: "M" (mask) button for read_binary_patch_to_mask,READ,WRITE->R,W
--tksurfer.c: read_binary_patch_to_mask: use patch as mask on current surface
--lib/help/tsurfer/{fill,label_write,label_read2val,label_read2valcut}: updates
--tksurfer.c: export fillcolor3d (def=128)
--tksurfer.c: export fillpix, fix fill_surface to recenter 3D if not eq st/ps
--tksurfer.c: fix norm_move_vertices arg: int -> float (accidental atoi)
--tksurfer.c: add/tclexport fill_surface option: includeintersectingflag
--N.B.: last fixes 512 ps/st def->1: to restore old, mv aside T1 CORdir (T1.mgz)
--tksurfer.c: read_image_info also look for dims/pix in T1.mgz before def=256/1
--inflatemovie.tcl: add initzrot parm, rm rot dependence between frontbak blks
--tksurfer.tcl: check{read,write}labeldir ret val, warn/block label read/write
--tksurfer.tcl: fix intro'd bug in checklabeldir (rename to checkwritelabeldir)
--nmovie.c: display/center tiffs if diff size than first, at exit free img mem
--csurf: wmfilterhirescmd: warn CORdir precedence (try 3 pairs before fail)
--csurf: fillcmd/surfhirescmd: warn CORdir precedence both CORdir,mgz present
--tkmedit.tcl: fix TEST1 crasher in 8 F3-interface manual norm panel entries
--tksurfer.tcl: warn missing label subdir in session dir
--csurf: freshen list of binaries used and/or included in top notes
--csurf: mghflatten: ?h.full*.patch.* => "full", else stringent "occip" parms
--no-surf-data-change movies now use one redraw followed by all redraw_cached
--runra.{sh,csh.tcl}: report name of subject (prompt/log) also when finished
--mpeg_play (gdith.c): spacebar/p also stop (was just start)
--tksurfer.c: linrampphase2vtxcol also caches color
--tksurfer.c: minimum direct manip scale size 5% of original

### UPDATE: 18 Oct 2014
--lib/help/csurf/tksurfer: update help
--tksurfer.c: update help
--tksurfer.c: direct manip scale has to restore zf because glLoadMatrixf doesn't
--tksurfer.c: fix direct manip to transform w.r.t to pose saved at down-click
--csurf: runahiddencmd nmovie,mpeg_play: log, avoid write on csurf cmdline
--csurf: runahiddencmd: run cmd in bg, logged, but w/o button
--csurf: omit broken "no panel" checkbutton til surftestrendernopanel updated
--lib/help/csurf/{tksurfer,tkregister}: ctrl-click in trough rotate help

### UPDATE: 17 Oct 2014
--nmovie.c/tksurfer.c/tkmedit.c/tkregister.c/mytoppm.c/sgiimagelib.c: iclose bug
--tksurfer.c: set_*_color functs cache calc'd col, use if move (overlay:spd=6x)
--tksurfer.c: make unselect vertex show up (was: not visible til next redraw)
--tksurfer.c: block shift-left-clk show curvim (vs select!) unless curvimloaded
--lib/help/csurf/tksurfer: update live rotate/zoom/translate
--mk0{.csh}: add new helpfile, Hiroshi's color LUTs to $CSURF_DIR/lib/lut
--lib/help/tksurfer/val_w3: new file
--tksurfer.tcl: add lib dir LUTs to "lut:" dropdown
--tksurfer.tcl: add w3 colscale to F3 interface, move jet up to make room
--tksurfer.c: better error on read non <float> <0-255> <0-255> <0-255> lut
--tksurfer.c: mv: req ctrl-shift-R-click-drag: don't overlap ctrlscale,tcourse
--tksurfer.c: Hiroshi magenta-blue-cyan-green-yellow-red mirr wheel
--tksurfer.c: direct right-click-drag up/down translate up/down
--tksurfer.c: direct mid-click-drag scale up/down around startclick
--tksurfer.c: direct left-click-drag surface rotate (curv:OK overlay:slow)
--csurf: add AFNI button to rawaverage panel
--tksurfer.tcl: expose noninteccendiskflag (ecc inset) "ecp" chk F3 interface
--tksurfer.tcl: expose logtransflag (for ecc inset) as "exp" chk F3 interface
--tksurfer.tcl: turn curv scalebar on automatically when displaying area ratios
--tksurfer.c: fix low brightness cm scale bar when not draw_colscalebar
--tksurfer.tcl: cmplx/olay/fixcolscale update bar/disk butt only scalebar=OFF
--tksurfer.tcl: init/change scalebar butt disk->bar if realval or no overlay
--lib/help/tksurfer/fill: HOWTO/why kill fill
--fourier.c: if !statssubsamp, faster clearer BRIK read (no stats,buff/unbuff)
--nmovie.c: space for start/stop loop, slightly diff logic than click
--mpeg_play: 'p' (or space) for play, 'l' for play+loop, better usage, defaults
--mpeg_play: live adj mpeg_play frame rate with up/down arrow
--movie360.tcl: run mpeg_play in background to not hang tksurfer interface
--tksurfer.tcl: init/change scalebar control button "disk"=>"bar" if real-val'd
--mk0{.csh}: add val_lt to mk all-in-one helpfile
--lib/help/tksurfer/val_lt: better explanation of colscale12->14
--tksurfer.tcl: unset overlayflag or calc arearatios: force redo autocolorscale
--tksurfer.c: display curvature color scalebar, autonorm scalebar limits
--tksurfer.tcl: "D" ops reinstate curr surf area (.area) compute_normals_areas
--lib/help/tksurfer/{area_disp,area_lab}: area_disp: new helpfile, revise a_lab
--tksurfer.tcl: change mid-clk overload area label to mid-clk overload of "D"
--lib/help/tksurfer/labelalpha: document change of "alph" to "tran" for squish
--tksurfer.tcl: "area:" line "D" button disp distortion w/curr2orig arearatio
--tksurfer.c: compute_curr2orig_area_ratio (write w/write_binary_areas)
--lib/help/csurf/tkmedit: hotkeys update
--tkmedit.c: change {cmd-}k to 1-time bigcursor, removed at next redraw
--inflatemovie.tcl: add rotpump option (multiple inf/def while rotating)
--nmovie.c: add -scale, -redrawframes options
--tksurfer.tcl: re-expose normalize_area function on F3 interface bottom
--mk0{.csh}: add flattenmovie.tcl to dist (skips missing intermediate)
--lib/tcl/flattenmovie.tcl: new script to make basic flatten movie
--lib/help/csurf/makenewsubj: update to reflect mostly MGH recon-all
--csurf: surfaces combo also filled with inflated????, sphere????
--setdefpatchview.tcl: make "occ*" (e.g., occsm) synonym of "occip"
--csurf: mghspherecmd: $bindir -> $mghbindir (never used!)
--csurf: ExpertPrefs reorder mris_flatten -distance parms into cmdline order
--csurf: block singlequote,redirects in runacmd cmd string, popup error
--lib/help/tksurfer/label_read: document overloaded "D" button
--tksurfer.tcl: overload "D" button with read_label_to_undo_cut
--tksurfer.c: read_label_to_undo_cut
--tksurfer.c: killfillflag for hi-res too-long-running fill
--mk0{.csh}: add inflatemovie.tcl to dist
--lib/tcl/inflatemovie.tcl: new script to make inf/def/inf/def movie loop
--tksurfer.tcl: tcl log: "turn ON/OFF" => "turned ON/OFF"
--lib/help/csurf/smoothcurvinflatesulc: fix stale other help ref
--csurf: widen "custom" translate fields 2->3 (too easy to miss 100)
--mk0{.csh}: compile new nmovie, mv/retain MGH version to nmovieMGH
--nmovie.c: write csurf vers: static tifflib, Mac click-drag works, clean quit
--mv dist/precompiled-other/lib/Darwin-x86_64/libX11.dylib back (XQuartz=vers10)
--lib/help/csurf/reconall: update (bash, MPRAGE TR, back to NIFTI example
--mpeg_play,mk0: mpeg_play ctrlbar.c patch for R-arrow=Step, L-arrow=Rewind
--csurf: runacmd explicitly blocks/warns single quote or redirect in $command
--movie360.tcl: redirect mpeg_play output to avoid write pipe error

### UPDATE: 06 Sep 2014
--FreeSurferEnv.sh: rm set disabling append Linux LD_LIBRARY_PATH for libjpeg62
--mv dist/precompiled/lib/Darwin-x86_64/libX11.dylib to precompiled-other (?)
--calcvert.c: outtype: -{swap}floatout for -valfilein only
--calcvert.c: -scinot_{e,E} flags to printf e,E sci notation (val->ASCII only)
--mk0.{csh}: add CentOS 64bit libjpeg.so.62 for tk{*} (curr Ubuntu14->ver8)
--install CentOS-5.9 64-bit into Mac 10.6 VirtualBox, new 64-bit csurf compile
--test 64-bit compile on buc13 Ubuntu -> OK: csurf0.8-linux64-YYMMDD.tgz
--add: dist/precompiled/bin/Linux-x86_64/{mri_convert,mri_surf2surf,nmovie}
--lib/help/tksurfer/val_bi: update
--tksurfer.c: make trunphaseflag/max/min work with "bi" colscale
--tksurfer.c: isocontours: GLX alt/cmd-L thickens linewidth (no thin, restart)
--tksurfer.c: isocontours: GL_LINE_LOOP better gap-filling than GL_LINES
--csurf: fix crash: need braces on varname with "..<dash><num>..": ${paint-3D_f}

### UPDATE: 10 Jul 2014
--csurf: try/undo set name fsaverage reload combos: too many surftestrend hacks
--csurf: if fsavg, check surf in fsaverage (N.B.: need Return in surface combo)
--mk0{.csh}: include fsaverage-adds.tgz in $srcdir/dist (14M)
--fsaverage: fix inflate_avg poles, make new flattenings (not in distro)
--wrappers.tcl: new positionpopup defpos above rootwin so visible w/root infront
--tksurfer.tcl: click FILL w/no vertex warns/reports prev FILL/ROI/N/A/R sum
--csurf: {mgh}flattencmd warns/allows re-flatten already flat
--csurf: fix {mgh}flattencmd mis-handle Use Existing response
--lib/help/tksurfer/shrink: NEWFILE, begin doc, fix mk0{.csh}
--lib/help/csurf/setuprender: doc full order of color wheel operations
--tksurfer.tcl: add locklabel check (shrink unlabeled only) to F3 shrink panel
--tksurfer.c: locklabelflag for local shrink
--lib/help/tksurfer/fill: edge vertices, sum area tcl vars, report last
--lib/help/csurf/tksurfer: better interactive click documentation
--tksurfer.c: subst areafile at flat bordvtxs w/undef flat->3D offedge faceareas
--NOTE: inflated_avg (but not inflated) has huge tri's at icos poles
--tksurfer.c: compute_normals_areas: recover full cutedge area for 3d patch
--tksurfer.tcl: sort patch,surf dropdowns at end
--tksurfer.c: f.ripflag => f.fripflag easier search vs numerous vtx ripflag

### UPDATE: 24 Jun 2014
--lib/help/csurf/setupsphavg: add documentation for AVGSURF button
--csurf: avgsurfcmd: run make_average_subject Cross Subj Average panel subjlist
--csurf: paintcmd: if 3D _f file, paint it, else old square amp of painted _r,i

### UPDATE: 16 Jun 2014
--csurf: paintcmd defaults missing permtestcnt (PAINT 1st action on old config)
--lib/help/tksurfer/smooth_valonly => new file; mk0*: add file, fix read_rgb ref
--lib/help/tksurfer/smooth_val => update w/real-valued tcl example
--tksurfer.tcl: rarely used "vo" smoothtype only on F3 panel
--tksurfer.tcl: new "vo" smoothtype: smooth val or val/val2 but *not* stat mask
--tksurfer.tcl: "val" smoothtype now also smooths stat if statloaded+maskflag
--tksurfer.tcl: "label:" combo also includes label files from current scandir
--tksurfer.tcl: middle-click "C" read_label_cut_clearvals 1 (hole): wfile edit
--tksurfer.tcl: change "C" left-click to read_label_cut_clearvals 0 (label)
--tksurfer.tcl: rm last read_label_to_annot_using_col arg: cutlabelflag
--tksurfer.c: read_label_cut_clearvals 1 cuts hole instead (mask wfile artifact)
--tksurfer.c: put recut label into read_label_cut_clearvals 0 (don't DISPLAY)
--tksurfer.c: read_label_cut_clearvals clears .val/.val2 zeros cut-out parts
--tksurfer.c: read_label_to_annot_using_col: rm cutlabelflag arg, rm recut label
--tksurfer.tcl: bug: forgot shift in bind mid-clk lab "W" write_labeled_vertices
--lib/help/tksurfer/{label,label_read,label_readcut}
--calcvert.c: 04a: new op: -maskvalfile: mask any valfile vtx from label to 0.0
--calcvert.c: do_operation req's packed possibly sparse vtxs array
--calcvert.c: write_binary_values req's packed possibly sparse vtxs array
--calcvert.c: read_binary_values => read_binary_values_{justvtxs,justvalues}
--calcvert.c: bug: sparse wfile=>ASCII=>wfile fails (was assume all vtx present)
--lib/help/tkmedit/{all,test1} update
--tkmedit.tcl: TEST1=>TEST, norm all slicesim2; ALL=>APPLY, flip to editable
--tkmedit.c: wrap norm_allslices_to_imnum(): 1=>editable/im, 2=>comparison/im2
--new helpfile: lib/help/tksurfer/rgb_read, update mk0/mk0.csh
--lib/help/tksurfer/{rgb_write,rgb_write2} update
--tksurfer.tcl: add "R" button to display bitmap, WRITE->W, W->WN
--tksurfer.tcl: rgbcombo, liveload dropdown for chk/overwrite/modexist,-listcmd
--tksurfer.c: GL window start ypix higher to accomodate new rgb combobox
--tkmedit.tcl: fix bug in read curv setfile
--tkmedit.c: GL_LINE_LOOP vs. GL_LINES fills surf cont gaps (N.B. 1 loop/face)
--csurf: single subj -> fsaverage: check/warn fsaverage surface missing

### UPDATE: 07 Jun 2014
--lib/help/csurf/setuprender
--lib/help/tksurfer/restore
--tksurfer.tcl: middle-click-RESTORE to re-cent surf (recalc_surface_center)
--tksurfer.c: recalc_surface_center(): for new surface read in over init
--csurf: View Functional Data "fsavg" chk does mri_surf2surf, load to fsaverage
--lib/tcl/setdefpatchview.tcl: cortex* synonym of "full" (tksurfer.tcl already)
--csurf: for fsaverage: add/rec inflatedext2=inflated_avg, load to surfacecombo
--tksurfer.tcl: warn fthresh>fmid on fthresh/fmid Return w/BRy
--tksurfer.tcl: popup reports filled_{curr,orig}area area for FILL/ROI/N/A/R
--tksurfer.c: make filled_{orig,curr}area global for tcl export
--tkmedit.tcl: wm geometry now uses exported glxwin{x,y,h,w} vs. abs nums
--tkmedit.c: export glxwin{x,y,h,w}
--tksurfer.tcl: wm geometry now uses exported glxwin{x,y,h,w} vs. abs nums
--tksurfer.c: export glxwin{x,y,h,w}
--csurf: shrinkcomboarrows, squish labels/buttons, lengthen entries => smaller
--tksurfer.c/.tcl: tighten GLX/tk startup positions left/up, match new tkmedit
--tkmedit.c/.tcl: GLX/tk win startup pos left so csurf panels don't fully cover
--lib/help/csurf/setupfour: better 2D and 3D cluster filter documentation
--csurf: fouriercmd: also run 3Dclust _f=>_h w/AFNI 3dmerge for brainstem mask
--csurf: medtestrender mask checks/uses _h if found (N.B.: requires at least _f)
--csurf: fourier panel: expose existing 3D Cluster vars clusterrad/clustervol
--tkmedit.c,tksurfer.c,csurf: def:{s}fslope=1.5,fmid=1.1,sfmid=3,{s}fthresh=0.3
--tkmedit.tcl: combobox for LUT, load w/default lut if none found in scandir
--tkmedit.tcl: set roi combo to passed-by -label (MY_AREA+orig.BRIK), see suff
--tkmedit.tcl: view right end of value in valn/mskn entries (just init load)
--tkmedit.tcl: set valn/valup/mskn/mskup combos to -real/-upread/-mask/-upmask

### UPDATE: 18 May 2014
--tkmedit.tcl: add CLR button left of interpolLUT to clear up-sampled buffers
--tkmedit.c: clear_upsamp_stat() clear any already upsamp'd (0-3)
--lib/help/tkmedit/roi_fill: document mask-defined ROI
--tkmedit.c: if mask loaded and in use, FILL above sfthresh instead of fthresh
--tkmedit.tcl: fix_statpatt_m_if_bfloat before readnativemask
--tkmedit.tcl: readnativemask: mk dbl entries, overlaymaskflag=1 before upsamp
--tkmedit.tcl: block read nonconforming (not 256/512^3) as upsamp stat/mask/ROI
--tkmedit.tcl: read{native,upsamp}mask: better err if select imag of cplx pair
--wrappers.tcl: add shrinkcomboarrows more (for tkmedit.tcl)
--tkmedit.tcl: valn/valup entry: add combobox dropdown loaded w/BRIKs,bfloat
--tkmedit.tcl: mskn/mskup entry: add combobox dropdown loaded w/BRIKs,bfloat
--tkmedit.tcl: roi: add combobox dropdown loaded w/BRIKs
--tkmedit.tcl: fix incorrect entry read on readnativemask (was reading valfile)
--lib/help/tksurfer/fmid: document basic per-vertex squash color scale pipeline
--lib/help/tksurfer/smooth: general diff between complex vs. real smoothing
--csurf: select_complexstatsource: catch -no_mask-, better error check/messages
--csurf: fixswfileprefs: 1sub phase sig+mask: order: _f,_h,_p,_q, else no mask
--csurf: paintcmd: if permtest, run surfclust on _p to get _q (re-use F parms)
--csurf: select_complexstatsource ask reset Data Type cplx (callbk does cpx chk)
--lib/help/csurf/setupfour: doc diff effect smoothing on perm _p vs. amp(_r,_i)
--lib/help/csurf/{setupfour,setuprender}: doc _p file
--csurf: getuniqcomplexstemlist: don't trim _p
--csurf: paintcmd: if permtest, overwrite amp(r,i) '_f' wfile w/real _f from 3D
--csurf: paintcmd: if permtest, also paint _p (fourier mks _f BRIK if permtest)
--fourier.c: also output _p BRIK if permtestcnt>0 (turnoff/warn if bfloat out)
--csurf: cpregcmd copies/reports/updates rounding policy
--csurf: fourier always -fout: N.B.: won't match _r,_i if permute test (for cf.)
--lib/help/csurf/setupfour: add help for permutation test, _f output
--fourier.c: sigim[1] redefined: a=>f, -fout (def) saves F ("a" not read/output)

### UPDATE: 4 May 2014
--register.tcl: if round policy change accepted, update roundregorigflag
--lib/help/csurf/{csurf,setuprender} update
--wrappers.tcl: incr okclose win name (crash from double-click upper left 'x')
--tksurfer.c: invphase flips MATLAB_JET, silently correct flip scale limits
--lib/help/tksurfer/{val_jt,label} update
--lib/help/csurf/{makerelaxationcuts,tksurfer} update
--tksurfer.tcl: DSP->D, add C: like DSP, but recuts label for 2+ labels overlap
--tksurfer.c: read_label_to_annot_using_col can recut (with no restore)
--newhelpfile: lib/help/tksurfer/label_readcut
--lib/help/tksurfer/{smooth_steps,smooth}
--lib/help/tksurfer/{label_write,label_read,label_clear,label,fill,cuts}
--tksurfer.tcl: DSP->D, add C: like DSP, but also re-cuts label to get overlap
--tksurfer.c: read_label_to_annot_using_col can recut: find AND of 2+ labels
--### conflicting internal varname fix done: [i]session/[i]scandir var rename
--tkstrip.tcl: match new tkstrip.c name: $session->$isession (incl "image")
--tkstrip.c: srname->sename, tclexp sename: $session->$isession
--csurf: add redundant/safe "set iscandir $page" (usu. done by browse notebook)
--tkregister.tcl: match new tkregister.c name:$session->$isession (incl "image")
--tkregister.c: rename [p]srname->[p]sename, tclexp sename: $session->$isession
--tkmedit.tcl: match new tkmedit.c name: $session->$isession (incl's "image")
--tkmedit.tcl: rm unused proc setsession
--tkmedit.c: rename tcl export of sename: $session -> $isession
--wrappers.tcl: $session -> $isession (affects tkmedit, too)
--{movie360,phasemovie,offsetmovie,fs-make,borders}.tcl: $session -> $isession
--{eccen,polar,fs,real,twocond}-{flat,views}.tcl: $session -> $isession
--tksurfer.tcl: rm unused proc setsession
--tksurfer.tcl: match new tksurfer.c name: $session->$isession (incl's "image")
--tksurfer.c: rename tcl export of sename : $session -> $isession
--csurf: rename global $scandir to $iscandir (usu. includes "image")
--csurf: rename proc getfunctscandirslist -> getfunctiscandirslist
--tksurfer.tcl: rm tksurfer.tcl trace setting exported $scandir to no-image $dir
--csurf: $session="130503MS"
         $scandir -> $iscandir="image/polar1" (w/"image")
--C/tcl: sename=$session -> $isession="/usr0/fspace/130503MS/image" (w/"image")
         scname=$scandir="polar1"
--### begin fixing conflicting internal csurf vs. C/tcl var meanings
--lib/tcl/fs-make.tcl: also write fs/fm as wfiles, now uses setfile, needs $dir
--csurf: fieldsigncmd: pass dir=[trimoneparent $page] for fs-make setfile
--update lib/help/tksurfer/val_w1
--newhelpfile: lib/help/tksurfer/val_jt
--tksurfer.tcl: F3 MATLAB jet "jt" colscale, scale ends: truncphasemin/max
--tksurfer.c: MATLAB_JET=15 colscale (e.g. fs), fade, {s}f{thresh,mid,slope}
--tkregister.c: add 1/10 micron offsets to xform matrix to fix zoom=2 aliasing
--tkregister.c: left ifdef'd out ROUNDTARG code in drawslice/select_pixel
--lib/tcl/real_{views,flat}.tcl: if floatstem is *.mgh, *don't* append -$hemi.w
--csurf: getuniqwfilelist accepts *.mgh files (put into Paintfile dropdown)
--csurf: getuniqwfilelist checks -[rl]h.w there before stripping it
--lib/tcl/{polar,eccen,twocond}-{views,flat}.tcl: use $maskfloatstem if exists
--csurf: functscan READ HEADER reads mgh/mgz header w/tkmedit to fill in panel
--csurf: change confusing check label on main interface: surfload -> load2surf
--csurf: allow FUNCT=>SUBJ button to pass .mgz file to tkregister as MOVEABLE
--tkmedit: make -header also work w/-f or no -f, update help
--tksurfer.c: read_binary_values accepts 1frame-1D-float-.mgh file
--tksurfer.tcl: also load .mgh files to "val:" dropdown
--tkregister.c: fixed select_pixel bad bounds chk crashing SAG right edge click
--tkregister.c: fix bad imnr1_2 select_pixel bounds check
--tkregister.tcl: double click tkwin raises gl window (replace rm'd POP GL)
--tkregister.tcl: showvisible after 'set overlay blah' update TARGET/MOVEABLE
--csurf: fix addfunctscan showstopper: setinitroundflag before defaults created
--lib/tcl/setdefpatchview.tcl: "cortex" made synonym of "full" for fsaverage
--tksurfer.tcl: add cortex to patch look list
--tksurfer.tcl: use shrinkcomboarrows
--wrappers.tcl: add shrinkcomboarrows (height:18->17/14Fedora, width:15->13)
--edit: lib/help/csurf/{setupfunct,tksurfer}

### UPDATE: 15 Apr 2014
--edit: lib/help/csurf/{setupfunct,tkregister,tkmedit,tksurfer}
--tkmedit.tcl: bold "tcl:" if clk'd to log interface tcl cmds, bold if startup
--tksurfer.tcl: bold "tcl:" if clk'd to log interface tcl cmds, bold if startup
--tkregister.tcl: updated help panel bindings
--new files: lib/help/tkregister/{savereg,readreg,round} => add to mk0{.csh}
--csurf: "init round" tick allow INIT old/new regdat, report current, else def=1
--tkmedit.c: roundreg for do_regupsamp_stat,get_timecourse,write_roi_timecourses
--tksurfer.c: read regdat round, use in paint_surface,normdsamp_timecourse_stat
--paint.c: read regdat round, use in paint_surface
--tkregister.tcl: move/uncover gl window w/interface size change
--tkregister.c: export func/vars to save GL winxy for interface size chn
--tkregister.tcl: popup warn change round policy on SAVE REG
--tkregister.tcl: F3 omit unused top line widgets (POP GL, READENV), squish
--tkregister.tcl: F3 tick report/override roundregflag read from register.dat
--tkregister.c: tcl export roundregflag so tkregister.tcl can change on the fly
--tkregister.c: optional rint() vs. 2 int truncates (reversed) and one floor
--tkregister.c: read/write optional register.dat "round" to match tkregister2
--tkmedit.tcl: logcmd all button/entry/check/radio
--tkmedit.tcl: logcmd: {r,w}{native,upsamp}{mask,stats},gettseries,do_imim2op
--tkmedit.tcl: logcmd: setfile,test_{write,read}_images,run_wmfilter,check*,def*
--tkmedit.tcl: turn off incorrect pixval when zoomed (TODO: fix, turn back on)
--tkmedit.tcl: tkmeditlogflag, enabledisablelog, setfile does logcmd
--wrappers.tcl: proc controls does logcmd's for its entries,checks
--lib/help/tkmedit/imim2op, lib/help/csurf/csurf
--tkmedit.c: add 2nd imim2op twocol oper: new:1=ell2on (existing:0=ell2off)
--tksurfer.tcl: floss fieldsign tk, fixcolscale: fix fieldsignflag, report flags
--tksurfer.c: export fieldsignloaded: tksurfer.tcl test fail read, fs scalebar
--csurf/tk{surfer,medit,strip}.tcl: rm procs foundbywhich, canwriteormakefile
--wrappers.tcl: add foundbywhich, canwriteormakefile, cleanup/reorder/comment
--tkstrip.tcl: rm canwriteormake, foundbywhich (now in wrappers.tcl)
--tksurfer.tcl: rm foundbywhich, canwriteormake (now in wrappers.tcl)
--tkmedit.tcl: rm canwriteormake, foundbywhich (now in wrappers.tcl)
--csurf: Preferences -> Log tksurfer actions as tcl cmds
--tkmedit.c, export/option tkmeditlogflag so csurf can pass
--tksurfer.c: if tksurferlogflag, send tcl command to log left_click x,y
--tksurfer.c, export/option tksurferlogflag: tksurfer can chk, csurf can pass
--tkmedit.tcl: pidnamerunning now uses ps uxww for Linux, too
--tkmedit.tcl: rm xhost+ req send inter-proc tclcmd + findsendto from SEND PNT
--tksurfer.tcl: rm xhost+ req send inter-proc tclcmd + findsendto from SEND PNT
--tksurfer.tcl: tksurferlogflag: logcmd every interface action -> tksurfer.log
--tksurfer.tcl: logcmd: setfile,{r,w}{vc,val,stat,surf},paint,smooth,roi,shrink
--tksurfer.tcl: clicking "tcl:" toggles enable/disable tksurferlogflag
--wrappers.tcl: testreplace uses logcmd (wraps many interface commands)
--wrappers.tcl: add open/write/close log interface tcl cmds
--paint.c: fix read opts bug disabling -bok (tksurfer:paint_surface() OK)
--mk0{.csh}: install extra precompiled below
--nmovie: Linux: older bin (newer 395K not compat w/Fedora7,Centos5.9 32b libs)
--dist/precompiled/lib/Linux-i386 libs for (just!) 32b nmovie on def 64bit OS
--add5: libXaw.so.7, libXi.so.6, libXxf86vm.so.1, libglut.so.3, libtiff.so.3
--lib/help/csurf/makerelaxationcuts (redo/multipleLINE)
--fourier.c: CACHE_SPACER for randstate: 1.25x speedup (overall now 4x 1thread)
--fourier.c: non-thread-safe-random => nrand48: 3x speed w/36 threads (was0.5x!)
--fourier.c: multithread loop calling compute_fourier_stat_slice(n) 
--fourier.c: funcptr wrapper for loop of threads for compute_fourier_stat_slice
--fourier.c: afs/cfs/ts->loc, sigim,rawim(big=0.3G)->4D for threaded (5% slower)
--fourier.c: permute freq, recalc F, p=fraction-permuted w/higher F => better

### UPDATE: 07 Mar 2014
--mk0{.csh} -- afni/progs/dist/inst: 32b libs AFNI/tk{surf,med,reg} on 64b OS
--mk0,mk0.csh: better dist/inst/afni/ for precompiled libs
--FreeSurferEnv.{csh,sh}: linux add LD_LIBRARY_PATH (centos 32bit for 64bit)
--fourier.c: read AFNI float too (to short buff), was: read as short w/o warn!
--rm unused -lGLU from tk{medit,register,strip} => still in tk{surfer,wheel}
--paint.c: add subvoxel -offset for testing
--paint.c: also read 256^3 or 512^3 float .mgz/.mgh (OK for -complex, too)
--runra.sh: fix 'which' response testing
--lib/help/csurf/tkmedit
--tkmedit.c,tcl: opencursorflag, cmd-O (overlay forces open)
--tkmedit.tcl: if -pf,-tr infix already there and $force, overwrite
--tksurfer.c: bad neighbors warnings in read_binary_surface, find_neighbors
--tksurfer.c: find_neighbors catches >100 nei vtmp overflow (vtx=0:surf bug?)
--brik2cor.c,fill.c,orig2cor.c,regcor.c,surfcombine.c,wmfilter.c =>void *lcalloc
--surlib.c,tkmedit.c,tkregister.c,tksurfer.c,tkstrip.c => void *lcalloc
--surf.c: fix overflowing pack tables w/512: read actual image size (bucky bug)
--surf.c: increase max vtx/faces 4M->6M for unsplit hemis cerebellum recon
--tkmedit.tcl: pass/warn kcnt from F2 panel
--wmfilter.c: add -kcnt to allow 7x7x7 kernel, -kcnt clamps to 5 or 7
--lib/help/tkmedit/{wmtrunc,wmfiltergau,wmfilterstd}
--tkmedit.tcl: catch attempt to add second infix
--tkmedit.tcl: planefilter done popup says how to save, warns infix name change
--tkmedit.tcl: check tmp wmfilter outfile exists before create, rm when done
--tkmedit.tcl: middle-click on TRUNC button applies trunc to editable buffer
--mk0,mk0.csh: add 3drotate to saved-from-AFNI
--tkmedit.tcl: report GaussPlaneFilter kfwhm and order ops: Trunc+PlaneFilter
--tkmedit.c: allow 'no -f' tcl script, quit tkmedit local if COR-001 not found
--tkmedit.c: fix flip_corview_xyz crash w/512
--brik2cor.c: noresampflag: hires-aware override HEAD for 1pix=>1pix
--tksurfer.tcl: add bokflag/sulfrac/gyrfrac to "NormSamp, Clust Controls" popup
--tksurfer.c: add -bokflag/-sulfrac/-gyrfrac, paint.c:paint_surface Bok correct
--tksurfer.c: read_binary_curv saves curvmin/max in globals
--csurflibs/csurflib.h: add .thickness to vertex structure (!)
--paint.c: Bok correct: use curv and middle-of-cos bump, req's dfrac{min,max}
--paint.c: copy thickness read into curv field to new csurflib .thickness memb
--calcvert.c: no strsep() in IRIX: back port to strtok()
--calcimg.c: no rintf() in IRIX, ifdef IRIX rint()
--mk0: IRIX insttmp: fix tar z flag
--*.cpp Makefiles: rm -Wall from IRIX CFLAGS since just here use CC, not gcc/g++
--all Makefiles: IRIX CFLAGS: add "-n32 -mips3", LIBS: -lm,-ljpeg after -ltiff
--IRIX csurflibs/clustlib.h: ifdef C++ header files:
    => /*<iostream>*/,<CC/new.h>,/*<cstdlib>*/,<CC/fstream.h>,/*<cctype>*/
--mk0: gmake using IRIX CC won't accept .cpp, so mk0 prog moves files to .cc
--IRIX tifflib patch: rm C++ style comments from tiff2pdf.c,tiff2pdf.c
--IRIX tifflib patch: tif_stream.cxx: ios::iostate old_state; => int old_state;
--IRIX tifflib patch: libtiff/tif_stream.cxx: #include <iostream> => <string>
--mk{.csh}: $makeprog set but not used (found w/IRIX compile), report set env
--mk0{.csh}: rm double AFNI install, req confirm use existing AFNI if not force

### UPDATE: 05 Feb 2014
--README.txt: updated to remove csh compile requirement
--mk0: port to sh, save working csh script as mk0.csh (can now compile w/o csh)
--mk: port to sh, save working csh script as mk.csh
--getonearch: port to sh, save working csh script as getonearch.csh
--brik2bfloat.c: fix write bfloat hdr file (y,x,t, not x,y,t) connectome DTi
--mk0: add new help file: area_lab
--lib/help/tksurfer/{area,area_read,area_write,area_lab}
--tksurfer.tcl: also load areafiles to curv dropdown, select_curv col autosets
--tksurfer.tcl: calcdisp_arat bound to middle-click "area:" label
--tkstrip.tcl: rm unneeded backslashes in curly brace -command args/logic
--tkregister.tcl: rm unneeded backslashes in curly brace -command args/logic
--tkmedit.tcl: rm unneeded backslashes in curly brace -command args/logic
--tksurfer.tcl: rm unneeded backslashes in curly brace -command args/logic
--tksurfer.tcl: bold "area:" label swaps with "area2" for read_binary_areas2
--tksurfer.tcl: overload "R" area with read_binary_areas2
--tksurfer.c: read_binary_areas2(), compute_area_ratio(), $area -> .origarea2
--mk0: cosmetic tidying
--csurf: add entry for sample surface for 3D stats to phase combine panel
--lib/help/tksurfer/{rect,labelalpha}
--tksurfer.tcl: labelalpha Return: reset alpha of all currently displayed annot
--tksurfer.c: set_annot_alpha: reset all labels alpha same
--tksurfer.c: read interface alpha at read_label_to_annot_using_col time

### UPDATE: 13 Jan 2014
--FreeSurferEnv.sh: rm bashism
--lib/help/csurf/{csurf,setuprawavg,reconall}
--revra.{tcl,csh,sh}: run up to n copies recon-all in bg for long subj lists
--lib/tcl/{eccen,polar,twocond}-{views,flat}.tcl -> fix log messages
--lib/help/tksurfer/{cuts,smooth,smooth_steps,label_write}
--csurf: fix setup rawavg panel rev time label
--tksurfer.c: kill confusing "###" warn if non-.val/.val2 empty before swap
--rawaverage.c: rewrite harmless/wasteful/confusing/signerr avg for non-padded
--tksurfer.c: clear_values, read_binary_surface: fixedval=1, undefval=0 (sparse)
--tksurfer.c: fix_nonzero_vals also undefval=0 (for sparse: was just fixedval=1)
--tksurfer.tcl: read_label_to_val (label: "R") does fix_nonzero_vals (sparse)
--tksurfer.c: write_annoted_vertices now uses curr .val (was 0.0) (for fill BA)
--tksurfer.tcl: shift-middle-click 2x overload label W: DSP'd vtx .vals to label
--tksurfer.tcl: add missing global abbrev's in proc's for val/label/insurf/fs/fm
--tkmedit.tcl: purple button feedback for long-running PF/PFGAU, purple kill
--tkmedit.tcl: wmfilter in bg, pidnamerunning proc to test bgproc finished
--tkmedit.tcl: fscolormap2lut defaults lut if MGH talaiarch labels file missing
--tkmedit.tcl: resolv val2rgblutsub -> val2rgblut in setfile (subjdir MGH lut)
--tkmedit.tcl: change uplevel setfile ... in procs -> add global abbrev to proc

### UPDATE: 06 Jan 2014
--tkmedit.tcl: force check update: readsurf, redraw-reset-of-failed-2dcol-flag
--mk0: add new helpfile: imim2op
--lib/help/tkmedit/{sphnorm,test1,imim2op[NEW],saveimg,smooth,smoothstats}
--tkmedit.tcl: add "OP" button plus entry to run imim2op's in F3-panel
--tkmedit.c: imim2op edits im (op=0: edit ellipse im,im2 space OFF), opts/usage
--wrappers.tcl: controls ents/cks: bind Return, locREDRAW|redrawbutton|redraw
--lib/help/tkmedit/{label,imentry,im2entry}: im2alpha ->overlayalpha, 2Dcol doc
--tkmedit.tcl: add F4 {im,im2} 2D col ctrls, toggle 2D coloverlay, redraw logic
--tkmedit.c: live color elliptical region of im,im2 space w/transparent label
--lib/help/tkmedit/{wmfilterstd,wmfiltergau} -> help for new buttons
--wmfilter.c: rm read/write wmfilter.dat: avoid accid redo last, no gausstrunc
--wmfilter.c: gaussflag skips nearzero, gauss opt bug, report read wmfilter.dat
--csurf: Shift-{left,middle} click PFGAU adds trunc to editable/COMPARE
--tkmedit.c: rm wmfilter_corslice(): stale, tkmedit.tcl run_wmfilter replaces
--mk0: update helpfile list
--add lib/help/tkmedit/{wmfilterstd,wmfiltergau}, rm lib/help/tkmedit/wmfilter
--tkmedit.tcl: PFILTER -> R-click PF,PFGAU->editable, mid-click output->COMPARE
--tkmedit.tcl: run_wmfilter: std/trunc or gau, load output editable or 2nd buff
--wmfilter.c: add notrunc/nocfrac Gauss convolve in plane of lowest variance
--wmfilter.c: rm im2, f2->f, cfrac[n]z parms, rename func, better datfile read
--csurf: fixed bug in singlsub randblock not auto-updating StatMask Paintfile
--csurf: report commented-out, tmptcl surf/med script name/cmds in cmdsonly log
--csurf: popup reports name of cmdsonly file on close
--mk0: dist/insttmp new 64-bit fs binaries
--dist/precompiled/bin/Darwin-x86_64/{mri_convert,mri_surf2surf,nmovie}
--tksurfer.tcl: block (harmless) callback to redrawbutton before GL window made
--lib/help/csurf/setuprawavg: time shift help
--csurf: add TR shift parameter to rawaverage, bakcompat default=0
--rawaverage.c: add shift by TR's in reversed tseries before avg (pad w/end2)

### UPDATE: 13 Dec 2013
--lib/help/csurf/setupsphavg: document phasetype=w updates
--tksurfer.tcl: blk {patch,curv,area} config -value callback (even w/disabled!)
--tksurfer.tcl: setfile {patch,curv,area} blks select_{curv.patch,area} callbak
--csurf: putback mk{3d,flat}script setfile's (blk'd callback tksurfer.tcl works)
--tk{surfer,medit,register,strip}.c -- flush report run interface,cmdli scripts
--csurf: add mris_sphere (all default) to MGH Register sequence
--bresize.c: help a little better: TODO: both-way example!
--csurf: samp2subj pass1: if real, don't skip surf2surf
--csurf: samp2subj pass2: if real, don't skip surfclust (N.B. tstat => _h)
--csurf: samp2subj pass2: if real, look for AFNI -tstat- not csurf-intern -stat-
--csurf: mghsphereregcmd warns missing morph register targ (.tif)
--lib/help/tkmedit/valn2up: vals typo
--tksurfer.c: fix crash: raise_window w/o open gl window open
--tksurfer.tcl: TODO: setfile mk abbrev trigs select_{curv.patch,area} callback
--tksurfer.tcl: tixcombo -variable {curv,patch,area}abbrev so setfile updates
--tksurfer.tcl: make select_patch act like viewcuts on read *.3d
--setdefpatchview.tcl: don't apply flat xforms to *.patch.3d (we want viewcuts)
--lib/tcl/{curv,eccen.fs,polar,real,twocond}-flat.tcl: readenv bef. setdefpatch
--lib/help/tksurfer/{scripts,rgb,tksurfer} -- funcs/vars, offscreen render, "S"
--tksurfer.tcl: rm hack to for old fixcolors missing entries ending in .e*
--wrappers.tcl: fix fixcolors to (mostly) check widget class
--lib/tcl/movie360.tcl: add diag rotation, zoomback
--lib/help/csurf/{csurf,makenewfunct}
--csurf: rearrange Preferences menu, add more separators
--csurf: Preferences -> Change Subj for Curr Session to change namefile
--lib/help/csurf/smoothcurvinflatesulchires => new helpfile, edited non-hires
--tksurfer.tcl: 3toggle inset: disk(but=rect) => rect(but=off) => off(but=disk)
--lib/help/tksurfer/cuts: add remake cuts w/label trick
--lib/tcl/setdefpatchview.tcl: accept $type*.patch.flat* to set patch view vars
--tksurfer.tcl: patch:match $hemi.$type*.patch.$suff*, curv:match $hemi.$type*
--lib/help/csurf/tksurfer -> bigcursor hotkey doc
--tksurfer.tcl: bind toggle bigcursor to Cmd/Alt-k
--tksurfer.c: change bigcursorflag to draw edges to each neighbor, bind Mod-k
--paint.c: accept AFNI short BRIK (for DWI), require BRICK_FLOAT_FACS=0
--tksurfer.c: eventloop: Tk_GetNumMainWindows(), static global window vars
--tksurfer.c: lower occluding white offscreen map window (not filled on Linux)
--tksurfer.c: fix openglxwindow renderoffscreen, XMoveWindow hack for Mac
--tksurfer.c: separate close_window(), export to tcl
--lib/help/tkmedit/all -> usage of ALL w/spherical ramp
--csurf: fix: add close $id accidentally rm'd back into writearrayparms (!)
--FreeSurferEnv.sh: fix execute-prevention test (no "-bash" broke Mac 10.7 bash)
--mk0: update helpfile list
--csurf: in medtestrender: sub{real,image} => up{real,imag}
--csurf: def missing tkmedit rawdata arg stimcycles (e.g., surfavg, notfour)
--libhelp/tkmedit:rm vals,vals_{write,read},mskn2s,valn2s,msks,msks_{read,write}
--lib/help/tkmedit: sfmid,sfslope,sfthresh
--lib/help/tkmedit: valup,valup_{write,read},valn_read,valn2up,smoothstats
                    roi_time,maskn2up,maskup,maskup_{read,write},mask_ck,fwhm
--tkmedit.tcl: use renamed functs/vars
--tkmedit.c: rename all subsamp/substat/2sub var/functs to upsamp/upstat/2up
--tksurfer.tcl: add alt-shift-arrow translate_brain help/keybindings
--lib/help/tksurfer/{xrot,yrot,xtrans,ytrans}
--lib/help/csurf/{rc-VOLUME,tksurfer}: doc tkmedit cmdline, tksurfer shift-arr
--csurf: pass nondef -wmfillthresh to tkmedit so edit->wht OK below wmfillthresh
--tkmedit.c: accept -wmfillthresh (def=2=WM_MIN_VAL), edit->wht if below
--tksurfer.c: add Shift-arrow -> translate keybindings (vs. no-shift -> rotate)
--surf.c: 1M->4M def maxvertices/maxfaces (bucky3), check overflow, add maxopts
--csurf: log csurf.dat writes (accid. deleted close $id here, fixed above!!)
--csurf: save/pass -wmfillthresh parm to reconditioned fill
--csurf: statbrikstem accepts *Coef*+orig.BRIK (in add. to *+orig_?+orig.BRIK)
--csurf: forcebrik LSB -> MSB HEAD fix message written to cmds-only file
--csurf: Preferences to open/close file into which only cmds are dumped
--FreeSurfer0.8: add lib/Linux-i386/{GLU,libjpeg so's} (!)
--FreeSurferEnv.csh,sh: replace lsb_release with parse /etc/issue, auto rh9
--wrappers.tcl: rm lsb_release (was crashing Fedora15!)
--tkmedit.c: correct FWHM report for 512^3
--fill.c: expose optional -wmfillthresh parm for smoothed upsamp wm (bucky3)
--lib/help/tksurfer/val3d_{paint,clust}
--tksurfer.tcl: add clust parms to NormSamp,Cluster Controls for live surfclust

### UPDATE: 05 Oct 2013
--csurf: init select "mm" or "frac" sets normdsampsearchflag (tksurfer PNT,T,S)
--tksurfer.tcl: add right-click "label:" for normd samp parmaters pop-up
--phasemovie.tcl,offsetmovie.tcl: add "SAVE", expand filename entries
--tksurfer.tcl: add "Norm Samp Controls" on R-click "lab:"
--wrappers.tcl: fixcolor controls, extend controls, tmpcontrols->wrapper,multOK
--lib/help/tksurfer/label_{timecourses,stat},setupfunct -> CSURF_HELP.txt
--lib/help/csurf/setupfunct
--tksurfer.tcl. add S butt (stat+timecourse), overload mid-click S -> just stat
--wrappers.tcl: fix helpwin bug w/arg varnotfile
--tksurfer.c: normdsamp_timecourse_stat no remallocs, stop per-vtx print err
--mk0: update help list
--lib/help/tksurfer/script_{run,edit},smooth
--lib/help/tksurfer/stattpatt,val,val3d_{read,paint,clust},val_lab,val_clear
--tksurfer.c: fix re-read current surface w/interactive 1vtx timecourse click
--tksurfer.tcl: mk printf fmt from selected file for read_native_stats stattpatt
--tksurfer.tcl: also load _???.bfloats into val3d
--tksurfer.tcl: 5 new help bindings for val3d entry line
--tksurfer.tcl: fix SMOOTH button bug: smoothing real component twice
--tksurfer.c: paint_surface/normdsamp_timecourse_stat: ensure load orignormals
--tksurfer.c: add clear_stats, inline mknativestatbufs and enforce init 3d dims
--lib/help/tksurfer/val_clear: updated for full clear
--tksurfer.tcl: overload "val:" middle-click CLR with clearall (val{bak}s,stat)
--paint.c: fixed incorrect "###" in successful thickness file read
--tksurfer.tcl: use default search for paint_surface (no current controls)
--tksurfer.tcl: add PNT (chk/autoread regdat, paint), CLU (run surf_cluster)
--tksurfer.tcl: toggle val<->val3d like tkmedit, autoread real/cplx 3d stats
--tksurfer.c: fix paint_surface (uniqvoxnumflag != normdsampuniqvoxflag)
--tksurfer.c: 3d normd stat averages sampled stats, but avg not yet used
--tksurfer.c: 5diffASCII: justtime/realstat/cplxstat/realstat+time/cplxstat+time
--tksurfer.c: normdsamp_timecourse_stat: stat: cp statdims->rawdata loop bounds
--tksurfer.c: normdsamp_timecourse_stat either timecourse+xyz or stat+xyz
--tksurfer.c: write_label_timecourses => write_label_timecourses_stats w/outtype
--tksurfer.c: get_timecourse -> normdsamp_timecourse_stat: add outtype arg
--tksurfer.c: add clear_valbaks (second position on complex stack)
--tkmedit.c: statnslices->stat_zdim, stat{x,y}res -> stat{y,x}_dim (whew!)
--tksurfer.c: statnslices->stat_zdim, stat{x,y}res -> stat{y,x}_dim (whew!)
--tksurfer.c: write_label_timecourses => write_label_times_stats w/outtype arg
--tksurfer.c: get_timecourse: don't reload orig surf for every vertex!
--tksurfer.c: get_timecourse: flag arg to just get xyz
--tksurfer.c: add native{real,imag,mask}loadedflag for 3D state
--wrappers.tcl: testreplace accepts args for funct to use if okreplace says go
--tksurfer.c: maintain/export/report val{2}{bak}loadedflag, statloadedflag
--lib/help/csurf/fourierflow.gif
--csurf: use new helpwin gif img display for helpwin setupfour
--wrappers.tcl: one inline (350 wide) or right (650 tall) gif img in helpwin
--tksurfer.tcl: glob statpatt/statpatt_m, rect<->disk on button
--tksurfer.c: get_timecourse: fix use bad normals (curr surf, not orig)
--tksurfer.c: verify tksurfer normal calc equivalent to surflib.c (whew!)
--tksurfer.c: function to run surfclust on complex 3D stats w/system()
--tksurfer.c: wrap paint.c:paint_surface(), use new normd{} opts, orig normcalc
--tksurfer.c: add statpatt (generic interface) and statpatt{r,i,m}, usage
--tksurfer.c: get stat{yres,xres,nslices} from readHEAD or count-bfloat+read-hdr
--tksurfer.c: new opts: -{real,imag,stat}3d signal live paint 3D stats
--tksurfer.c: read_native_stat, mknativestatbufs, statfileformat_from_suff
--tksurfer.c: swap_stat_val always set statloadedlfag (e.g., live re-read/swap)
--csurflib.c,h: add get_bfloatdims
--csurf: medtestrender: no longer pass -stat{yres,xres,nslices} to tkmedit
--tkmedit.c: rm -stat{yres,xres,nslices} usage (compat: left overridden getopt)
--tkmedit.c: get stat{yres,xres,nslices} from read HEAD or count-bfloat+read-hdr
--paint.c: setup write_label_stats framework => ABANDON (do in tksurfer)
--paint.c: rename tranform() => vtx2rawdata()
--slices.tcl: allow tick off different planes, cursors
--wrappers.tcl: tmpcontrols checkbox if var ends *flag, takes var "whitespace"
--tkmedit.c: add partial deriv gaussian filter to smooth_3d, save in bytebuffs
--tk{surfer,medit,register}.tcl: uniformize testclose
--help: lib/help/csurf/{setuprender,setupfield}
--borders.tcl: floodfill_retin_patches -> find_retin_borders, fix defaults
--csurf: floodfillretincmd -> findretinborderscmd, fix defaults
--tksurfer.c: floodfill_retin_patches() -> find_retin_borders(), fix defaults
--tkmedit.c: accept tkmedit *.mgh
--slices.tcl: add nocursorflag, bigcursorflag to tmpcontrols popup
--tkmedit.tcl: mv revphase left of angleoffset (=> angoff) like csurf/tksurfer
--help: lib/help/csurf/tkmedit
--help: lib/help/tkmedit/{roi,roi_read,roi_ckmask}
--tkmedit.tcl: labelmaskflag "m" checkbutton for ROI/label mask panel
--tkmedit.c: if labelmaskflag, mask overlay where label/ROI=0
--help: lib/help/csurf/{csurf,makenewfunct}
--csurf: mknewfunct can insert funct session inside an already-made subject
--csurf: fix chk cplxmask render (unrec'd single sub phase mask button var)
--tksurfer.tcl: ask autocreate missing subjdir labeldir
--tksurfer.tcl: ask autocreate missing functdir rgbdir (was only chk subjrgbdir)

### UPDATE: 02 Sep 2013
--lib/help/csurf/{setupfield,setuprender}
--csurf: fieldsign panel sorts complex wfiles to top, Show Progress tick
--borders.tcl: optional live display
--borders.tcl: swap_val_val2 and write val2 to polardir
--tksurfer.c: floodfill_retin_patches check openglwindow, cnt*seeds/tested->val2
--mk0: include borders.tcl in dist,inst
--lib/tcl/help/tkmedit/{bwslope,bwmid}
--lib/tcl/borders.tcl: new fs-make-like script to run floodfill_retin_patches
--csurf: revert0.9->0.8 in csurf.dat header to match tarfiles (TODO:newvers:1.0)
--csurf: borders output dumped into eccen and polar dirs used, *not* fsdir
--csurf: add GROWBORD/parms to run floodfill_retin_patches to fieldsign panel
--tksurfer.c: can run grow borders without openglwindow w/o error
--lib/help/tksurfer/swapstatval (explain overload below, document complex stack)
--tksurfer.tcl: overload swap stat/val with swap complex stack for middle-click
--csurf: expand the width of the fieldsign listbox dropdowns
--tksurfer.tcl: also look for scriptsdir *.lut, add dropdown divider, ignore it
--tksurfer.c: write_annoted_vertices, 0.0 for val: sav fill_annot_holes'd label
--lib/help/tksurfer/{label,label_clear,label_read,smooth,smooth_steps,rgb}
--tksurfer.tcl: overload smoothsteps: "valholes" (vs. num) -> fill_val_holes
--tksurfer.tcl: overload smoothsteps: "labelholes" (vs. num) -> fill_annot_holes
--tksurfer.c: clear_vertex_marks=>clear_vertex_marks_list, restore_ripflag enum
--tksurfer.c: floodfill_retin_patches: retinotopic region growing
--tksurfer.c: fill_{annot,val}_holes: fill single vertex voids in annot or val
--tksurfer.tcl: if read MGH lab + complexflag, ask reset disp (cpx,col,fmid,etc)
--tksurfer.c: toggle off statmaskampflag around disk/rect scalebars to see them
--tksurfer.tcl: read_and_color_labeled_vertices => read_label_to_annot_using_col
--tksurfer.c: read_and_color_labeled_vertices => read_label_to_annot_using_col

### UPDATE: 22 Aug 2013
--{curv,eccen,fs,polar,real,twocond}-{flat,views}.tcl => same as below
--{wrappers,pialwhitethk}.tcl: dolighting -> do_lighting_model
--csurf: added INIT/FLIP button to setup funct
--csurf: accidentally missing '#' broke VOLUME-STATS
--FreeSurferEnv.sh: ported from csh version, warn/bail PATH/LD_PATH w/space
--FreeSurferEnv.csh: warn if spaces, rm cleanup, warn/bail LD_PATH w/space
--randsurfclust.cpp: better help
--fourier.c: update/extend usage Examples
--csurflibs/cdflib/{cdflib.h,cdf_79.c}: "char*" => "const char*" to fix warn
--multiclust.cpp: better help
--surflib.c,h: "char *fmt" -> "const char *fmt" to fix Error,PrintMsg warnfest
--multiclust.cpp: cp surfclust growstack fix to here, just in case
--surfclust.cpp: stacksize 8M->48M  for deep recursive growCluster (e.g. 1 big)
--FreeSurferEnv.csh: "xset fp default" before add to clean (my) stale, no bloat
--lib/help/tksurfer/{xrot,yrot,zrot,winxy} help
--tksurfer.tcl: x,y,zrot, winxy help pop-ups

### UPDATE: 18 Aug 2013
--mk0: also write tk{medit,register,surfer} pop-ups help to CSURF_HELP.txt
--tkmedit.tcl: surf2col ("2" checkbutton), im{entry,R,W} R-click help
--lib/help/tkmedit/{surf2col,imentry,imread,imwrite,im2read}
--tksurfer.tcl: fix accept-suff-on-surf bug that was removing $hemi.sphere
--srcdir,mk0,FreeSurferEnv.csh: mv fonts/ISO8859-2 lib/fonts/ISO8859-2
--mk0: mk links to 32bit Linux bin/libdirs so 32bit CentOS compile runs on 64bit
--lib/help/tksurfer/{revphase,fill2area,fill2num,fill2rad,smooth,rgb}
--tksurfer.tcl: fix revphaseflag helpwin bind, fix R-click report of saved rgbs

### UPDATE: 10 Aug 2013
--tksurfer.c: add .mgz centoffset for Talairach to find_orig_vertex_coordinates,
   select_talairach_point,write_dipoles,write_timecourse,write_label_timecourses
--tksurfer.c: read c_{r,a,s} from orig.mgz at startup, warn missing (assume 0)
--tkmedit.c: add .mgz cent offset also to write_point, set_cursor, select_pixel
--brik2cor.c: added function to read ORIGIN, not yet used
--tksurfer.tcl: promote save_rgb_checkfirst, rm dolighting tksur2000 bakcompat
--tksurfer.tcl: ask to create rgb dir in save_rgb_checkfirst if missing
--csurf: offset startup of successive csurf's, include pid in title
--csurf: put better default rgbnames into SURFACE button tcl scripts
--tksurfer.tcl: bind redraws to last column of lights, blufact
--tksurfer.tcl: better right-click display of all existing rgb/tiff's, explain
--tksurfer.tcl: allow curv 2x read so re-read of same works (e.g. after smooth)
--lib/help/tkmedit/{kernelsize,fwhm,smoothstats} updated
--brik2cor.c: fix hi-res trilinear interpolate, change inp block center
--csurf: rendersurf: don't warn missing "-mean-" in bfloatpatt if single subj
--csurf: sigaveragecmd also copies preclustfthr,clustarea from firstdir
--tkmedit.c: tkmedit [-f] <file> ignores SUBJECTS_DIR if twoup dir doesn't match
--tkmedit.c: tkmedit <CORdir|mgzfile> works (duh!) (SUBJECTS_DIR or random dir)
--tkmedit.c: tkmedit -f <CORdir|mgzfile> works in random dir (or SUBJECTS_DIR)

### UPDATE: 02 Aug 2013
--lib/help/csurf/setuprender: document new single-subj F mask option
--csurf: fixswfileprefs: cplx xsubj selecting _x,_y now checks for _f if no _h
--csurf: fixswfileprefs: complex singlesub now auto-sets _h if sig+clustFmask
--csurf: fixswfileprefs: 4 cases: real/cplx + singlesub/xsubj (real xsubj empty)
--csurf: new 1sub tixsel: SingleSubPhaseMask: sig(none:amp=sqrtF) sig+clustFmsk
--csurf: fix missing not eq: sel phase data wasn't resetting colscale to "wheel"
--lib/help/csurf/setupfour: document cluster options
--lib/help/csurf/setuprender: add single subj sig-stats F table
--csurf: Mac DYLD setuid warn crashes surftestrenderexec ps uxww |grep => .. |&
--csurf: PAINT does surfclust at end if: (1) cplxdata, (2) _r,_i (3) _f there
--csurf: noticed StimProgNOTES var mangle -> change it to not use tix options
--csurf: fourierpanel: add SingleSub MinClust Area (mm^2) (clustarea)
--csurf: fourierpanel: Mean Delay=>SingleSub PreSurfClust F-thr (preclustfthr)
--paint.c: if complex, also auto-paint/maxmin/smooth:  _f=SQR(sig) (def=no)
--tkregister.tcl: F3 panel toggle save tiff/rgb
--tkregister/Makefile: add static libtiff
--tkregister.c: add savetiff (def), export tiffoutflag tk livetoggle, defzoom=1
--tksurfer.c: linrampphase2vtxcol detects eccen and doesn't blow it away
--lib/help/tksurfer/angle_offset: document linrampphase2vtxcol

### UPDATE: 19 Jul 2013
--tksurfer.c: fixed ancient canceled winxdsp-subst-for-winydsp bug:do_one_gl..
--tksurfer.c: print clicked window pix for script use (N.B.: GL-res dependent!)
--tkmedit.c: unoverlap F2 window GL following
--tksurfer.c, surflib.c: added (currently unused) .area2 to vertex structure
--lib/help/csurf/{setupfunct,tkmedit} updated
--csurf: debugged options passed for write_label_timecourses
--tksurfer.c: linrampphase2vtxcol (N.B.: don't wrap func args, use 0.9->1.1)
--tksurfer.c: fix non-unique dump all timecourses along normal
--tksurfer.tcl: fix bug in load scripts to scripts combo, add setfile vclabel
--tksurfer.tcl: rm readdrawvtxcols, middle-clk label CLR button clears vtxcols
--tksurfer.c: remove/unexport read_draw_vtxcol_label, clear_vtxcol_labels
--lib/help/tksurfer/{label_toggle,label_read2val,label_write,label_clear} new
--tksurfer.tcl: middle-click labelflag button toggles vtxcolflag
--tksurfer.tcl: change middle-click "R" to read_vtxcol_label, add a redraw
--tksurfer.tcl: testreplace vtxcols imitates label_to_vtxcol filename create
--tksurfer.c: each subsequent vtxcol polygon set 0.001 above previous
--tksurfer.c: read_vtxcol_label: faster: re-color vertex inside draw_surface
--lib/help/csurf/setupfunct updated
--csurf: rearrange funct:NormSearch parms before tcourseflags, mv CentOffset up
--csurf: add "tALLdx" for -normdsampallflag, BlkCntOff->Cent,PaintAllVtx->PntAll
--tksurfer.c: opt -normdsampallflag to dump multiple timecourses per vertex
--csurf: add INIT/FLIP button to addalignscan panel for standard tkregister flip

### UPDATE: 07 Jun 2013
--tkmedit.tcl: cmd-period toggle WMTRUNC, cmd-K toggle cursor visibility
--tkmedit.c: cmd-period toggle WMTRUNC, cmd-K toggle cursor visibility
--lib/help/tksurfer/{label, label_read2val, label_write}
--tksurfer.tcl: overload (middle-click) "W" label butt w/label_to_vtxcol_label
--tksurfer.tcl: overload (middle-click) "R" label butt w/read_draw_vtxcol_label
--tksurfer.c: read_draw_vtxcol_label: display is (TODO: lg is slow)
--tksurfer.c: label_to_vtxcol_label: convert label to vtx cols
--tksurfer.c: read_binary_stats, stfname/stat -- TODO: use
--tksurfer.tcl: add stat to setfile session directory globbing list
--lib/help/tksurfer/swapstatval, read_binary_stat, stfname=$stat

### UPDATE: 03 Jun 2013
--lib/help/csurf/setupfunct, lib/help/tksurfer/label_timecourses updated
--csurf: bakcompat create missing flags for older-configd init renderpanel open
--csurf: addfunctscan: tUniqVox (normdsampuniqvoxflag), pass to tksurfer
--csurf: addfunctscan: tNormSrch (normdsampsearchflag), pass to tksurfer
--csurf: if normdsampsearchflag, normd samps->min, maxs->max, else samps->mid
--tksurfer.c: -normdsampuniqvoxflag: force dump unique timecourses (w/1st vtx)
--tksurfer.c: -normdsampsearchflag: dstep search for uniq voxels along norm
--tksurfer.c: add/expt normd{frac}max, normddstep, normdsamp{search,uniqvox}flag
--slices.tcl: new lib script to save group of bitmaps around cursor
--tkmedit.c: add/export nocursorflag
--tkmedit.c: add -cor.tiff if no suff def "Saved Images Prefix" $rgbname

### UPDATE: 29 May 2013
--lib/help/tkmedit/{roi_fill,roi_rad}
--tkmedit.tcl: missing/misspelled overlay/surface checkbutton commands
--tkmedit.c: if !overlayflag, fill anatomical within WMTRUNC, optional fillrad
--lib/help/tkmedit/roi_rad
--tkmedit.tcl: add entry next to FILL button
--tkmedit.c: add fillrad, additional criterion on FILL
--lib/help/tkmedit/write_roi
--tkmedit.c: add/export label2, -label2 option, export write_roi_label
--tkmedit.c: write ROI also writes ASCII of curr stats overlay, real or complex

### UPDATE: 25 May 2013
--lib/help/setupsphavg
--csurf: nocallbk varcfg complex{statsource,ampmodtype} else redef sbfloatstem
--csurf: warn if re-SAMP2SUBJ on old SPHEREAVG run if missing _b bfloat
--csurf: add surfclust filter-resampled-F-stat to SAMP2SUBJ button => _h
--csurf: add "F:" and "mm^2:" entries to Cross Sess Sepherical Average panel
--tksurfer.tcl: warn original area file overwrite
--lib/help/{setuprender,cuts,area_read}

### UPDATE: 13 May 2013
--lib/help/tksufer: smooth, full
--tksurfer.tcl: localize all help binding, rm combotest, dup edlabvals
--tksurfer.tcl: mv new {surf/tcl,curv/area,patch,label,lut/fs,val} up
--tksurfer.tcl: add lut combo, mk surf combo patt-match at end -> smoothwm2,etc
--tksufer.tcl: rm show*file procs (combo dropdowns replace), leave no-combo rgb
--tksurfer.c: report divide by 2 area correction for old area file
--lib/help/csurf/tksurfer, lib/help/tksurfer/{fill2num,fill2area,fill2rad}
--tksurfer.tcl: add "R" for new radius option, squish: NOCUT->ALL, FLAT->FL
--tksurfer.c: fill_nearest_vertices: add type 2=RADFILL -> fill to radius
--tksufer.tcl: fix area/curv scroll to end (using 100ms delay)

### UPDATE: 11 May 2013
--lib/help/tksurfer/{num,fill2area} updated
--tksurfer.tcl: NUM->N, add A (area), space to group, add to F3 panel
--tksurfer.tcl: nclosestvertices->numvert_or_sqmm for renamed/gen fill_nearest
--tksurfer.c: fill_n_nearest -> fill_nearest: fill n vertices *or* fill to area
--tksurfer.c: report both orig and current area for FILL, ROI, NUM
--tksurfer.tcl: add area field/combo for rh.area, rh.area.mid, rh.area.pial
--tksurfer.c: compute_normals_areas fixed to return same as $hemi.area on white
--tksurfer.tcl: fix bug w/combopatch: write_binary_curv->write_binary_patch
--csurf: pass newareacurvoutputflag, add to Expert Perferences for revert/test
--tksurfer.c: add write new curv file format, make default (magic, float)
--tksurfer.c: add write new area file format, make default (magic, correct area)
--tksurfer.c: if detect new format area file, don't divide area by 2 at report
--csurf: CONVERT/AVERAGE warns non-zero spacingX,Y,Z MGH tkmedit incompat
--Makefiles: add/commented-out for eventual XQuartz: #LIB_X11 = -L/opt/X11/lib
--tkmedit.tcl: R-click mid tal label to zero, bottom to report in x,y,z order
--tkmedit.tcl: truncate Talaiarch to one decimal place

### UPDATE: 06 May 2013
--lib/help/tkmedit/pixcoords,talcoords: update for MGH
--tkmedit.c -- coords_to_talairach, talairach_to_coords use c_{r,a,s} origin
--tkmedit.c -- add read_invert_{mni,12}_tal for Talairach hacking
--tkmedit.tcl: revise tk wintitle (rm subject, add MGH vol ind)
--tkmedit.c: add/exp imtype2 (now just for title), GL wintitle subj both 1st/2nd
--tkmedit.tcl: tmp MGH Volume index popup
--tksurfer.tcl: roibutton showstopper: forgot to global statmaskampflag
--wrappers.tcl: add menurmlast (by name, checks if in fact last)
--csurf: make combolistbox adj, split/unsplit help menu work live

### UPDATE: 17 Apr 2013
--tksurfer.tcl: skip divider entries in scripts and label combo dropdowns
--tksurfer.tcl: surf/curv/val: warn read non-existent (3 diff logics!)
--tksurfer.tcl: add curv combo (diff logic than select_surf, fix Mac tap double)
--csurf: mk mpg panel sets mpgname w/stem first rgb/tiff (reqs 2 dialog calls)
--mk0: fixinst to fix mangled permissions in VirtBox/CentOS tarfile
--setdefpatchview.tcl: don't blow away existing patchname
--tksurfer.tcl: fix stale patchname on surftools read patch after start w/3D
--csurf: $newpkgtix bakcompat removed entirely
--csurf: prevent subj/sess w/space,semicolon, choosedir block semicolons
--csurf: mkscandirs/setupscans: blk scandirs w/space,semicolon (-raisecmd crash)

### UPDATE: 07 Apr 2013
--fourier.c: warn RAM usage (hi-res: 1.5G)
--rcxcombine.c: warn RAM ussage (hi-res: 2G), use 1/5 less RAM (free before amp)
--tkmedit.c: emulate tksurfer draw multiple graphs (but w/o glDepthFunct ON)
--tkmedit.c/csurf: add -stimcycles, csurf passes it, add draw collapse t-course
--tkmedit.tcl: unlabeled button next to W rgb for save frontbuffer w/timecourse
--tkmedit.c: add extract/color/write/display single rawdata timecourse

### UPDATE: 13 Mar 2013
--csurf: discovered 3dDeconvolve truncates BRICK_LABS to 32-chars! catch/warn
--csurf: finally, read TR's from HEAD (for Fourier and Rand Block Stats)
--help: update setupimport, setuprand, setuprender
--csurf: deconvcmd: use 3dDeconvolve output from new GLT panel output
--csurf: mkgenlintestmats: can now turn off vregregressflag
--csurf: mkgenlintestmats: use new vars, return success (for abort deconvcmd)
--csurf: Preferences simplediffsflag toggles orig/new
--csurf: addrenderscan: new alternate arbitrary GLT panel (vars don't overlap)
--csurf: F/tstat mask matching for surftestrendernopanel
--csurf: improve mask enable/disable wiring
--csurf: completely rewrite convertfunctcmd:
    AFNI files: 3dDeconvolve: (1) coef, (2) fstat/tstat
    AFNI files: 3dmerge: fstat/tstat -> (3) fstat/tstat-clustermask
    AFNI files: 3dcalc: mask (1) with (3) -> (4), mask (2) with (3) -> (5)
--csurf: coef operations:
    coef/nocluster/nothresh -> dump coef
    coef/nocluster/thresh -> thresh coef
    coef/cluster/thresh -> cluster stat, mask coef
--csurf: stat operations:
    stat/nocluster/nothresh -> dump stat
    stat/nocluster/thresh -> thresh stat
    stat/cluster/thresh -> cluster, mask stat + dump unclustered stat
--csurf: surf overlay fixswfileprefs (find statmask) w/new 3dDeconvolve labels
--csurf: paintcmdbrikmulti: simple thresh, clust stats (add/chk ,sbfloatstem)
--csurf: Import External also auto-defaults Tstats (old/new label versions)
--csurf: medtestrender/VOLUME-STATS accepts old or new 3dDeconvolve infixes
--csurf: sort *-stats+orig.BRIK(HEAD)'s to top of External Stats Image Set list
--csurf: auto-default ExtStats: Extract(all), Cluster(all), MaskThresh (0.01)
--csurf: AFNI-MULTI paintcmdbrikmulti accepts either bfloat or BRIK stats
--csurf: AFNI-SINGLE paintcmd does bskip prev done for bfloat by brik2bfloat
--csurf: fix load MaskFile combos to accept, default/match new label format
--csurf: readmultibriklabels demangling (bak compat), rm new # for nmovie choke
--csurf: accept new BRICK_LABS: <zz> LC[0] coef -> <zz>_GLT#0_Coef
--csurf: accept new BRICK_LABS: val,mask both have GLT (was LC)
--csurf: deconvcmd sets output stats filename ahead for init addextstats input
--csurf: BRIK in/out: addextstatscan, convertfunctcmd, paintcmd (AFNI-SINGLE)
--csurf: add realstatformat (bfloat,afnibrik) avoid dump large num real bfloats
--tkregister.c: finally allow sensible two-full-path-files as first two args
--csurf: phasestatformat: def statbrik output (SPH uses .w, VOLAVG req's BRIKs)
--csurf: add "rm full FT" button to cleanup large FTs

### UPDATE: 28 Feb 2013
--FreeSurfer0.8: use centOS5.9 tcltktix compile (Xft=off: more reliable fonts)
--wrappers.tcl: -activeforeground black for linux menus
--tksurfer.tcl: -selectforeground black *.e? ent missed by fixcolors for linux
--wrappers.tcl: fixcolors: -selectbackground to *.e entries
--csurf: -selectForeground black tixconfig combo-ent/combo-list/lab-ent linux
--csurf: -selectforeground black to *.e? entries for linux missed by fixcolors
--wrappers.tcl: help panel reports helpfile name (if std location)
--help/tksurfer/roi: updated
--phasemovie.tcl: %03d for more movie frames
--tksurfer.tcl: ROI button now respects statmask (overrides complex)
--tksurfer.c: floodfill_marked_patch STATFILL: to stat=sfthresh (was fthresh)
--tksurfer.c: bail reading too many bad lines cmplx label (prob MGH real-val'd)
--tksurfer.tcl: surf combo: load w/standard list (others OK to type in)
--tksurfer.tcl: tcl combo: load startup/std/funct/subj, add hack separators
--tksurfer.tcl: label combo: load $hemi*.label, separators for MGH vs UCSD/UCL
--tksurfer.tcl: val combo: load *-$hemi.w (should include statmask)
--movie360.tcl: use tiff2mpg, rm dependence on mpeg_play_opts
--tksurfer.tcl: tix combotest working for surf: and val:
--rcxcombine.c: -fullfouramp: write FTamp too if -fullFT, csurf pass from sigavg
--rawavg w/reverse has a 1/2 TR phase advance compared phavg (expected I think)
--update help/tksurfer/{surf,patch}, help/csurf/tksurfer, tksurfer -h message
--R-click tcl,patch,label,lut,val,rgb labels shows curr files
--csurf: fix introduced phasestatformat bug, fix contaminated fslope textvar
--wrappers.tcl: helpwin accepts help text also in a var (vs. file)
--update setupfour help
--tksurfer.tcl: dup revphaseflag left angle_offset like render panel, left orig

### UPDATE: 13 Feb 2013
--FreeSurfer0.8: fourier bfloat2brik brik2bfloat brik2cor calcimg paint
--FreeSurfer0.8: rcxcombine rawaverage csurf8.5 setupfour setupsigavg
--FreeSurfer0.8: tkmedit8.5 tkregister8.5 tksurfer8.5
--csurf: update setupfour and setupsigavg help, hide Fourier panel infixes
--csurf: [Select-to-Add gen'd "3D Stat Image Prefix" same for sigavg,fullFTavg]
--csurf: checkanalyseinput -> gettimeseriesinputstem
--csurf: sigavg fullFT two-stage: rcxcombine fullFT's, then fourier the avg
--csurf: sigaveragecmd: fullFT avg requires same stimcycles, timepoints
--csurf: sigaveragecmd: add sigoperation fullphavgsig
--csurf: fourier: tick "full FT" => statformat->afnibrik (not req'd,consistent)
--csurf: expose Hi-Freq cutoff (rm hi freq breathing above 100 w/256reps)
--rcxcombine: -fullFT: read full fourier, offset applied at stimfreq, reverse
--rcxcombine: read/average a set of full FTs (no t-tstats)
--fourier.c: rm defunct in-plane smooth opt/funct, better varnames,usage
--fourier.c: rm float fstimfreq, clamp hi end of noise freq bandpass to Nyquist
--fourier.c: opt -juststats: skip FTs, read 2 xyzf BRIKs, calc stats as before
--fourier.c: opt -fullfourier: dump full cplx FT (N.B.: 4x size of raw data)
--fourier.c: opt -fullfouramp: dump fourier amp (N.B.: 2x size of raw data)
--fourier.c: cp DELTA, ORIENT_SPECIFIC, ORIGIN from model HEAD for AFNI view
--fourier.c: write float stat BRIKS, larger parmtype/value for sscanf long
--csurf: VOLUME-STATS also passes complex stat BRIKs for overlay (TODO: real)
--csurf: "full FT" checkbox dumps 3 extra full FT BRIKs: real/imag/amp
--fourier.c: options to write allfreq complex FT BRIKs, allfreq amplitude BRIK
--csurf: stripbpatt generalized for +orig.BRIK, better filter (fix rcxcombine)
--csurf: paintcmd: pass bfloat or BRIK to paint (paint checks suffix)
   (above is cmd not mkpanel since PAINT is an extra button on several panels)
--csurf: paintcmd: config'd pre-phasestatformat w/bfloats -> set statfmt bfloat
--csurf: sigaveragecmd: {bfloat,BRIK}, -ext {bfloat/BRIK} to BRIK-OK rcxcombine
   (above in cmd not mkpanel because sigavg is cross scandir, dep on inputs
--rcxcombine.c: -ext BRIK to read/avg/write stat BRIKs
--sigaveragecmd: config'd pre-phasestatfmt w/bfloats+1stavg is bfloat -> same
--addfourscan: bfloat/afnibrik radio button, maybe pass -sigoutbrik to fourier
--addfourscan: config'd pre-phasestatformat w/bfloats -> set statfmt bfloat
--csurf: sigaveragecmd: COMBINE works with bfloat or BRIK
--csurf: paintcmd: bakcomp: if found bfloats set missing phasestatformat=bfloat
--csurf: bfloat/afnibrik radio button for FOURIER, pass -sigoutbrik to fourier
--csurf fix introduced overlay file bakcompat coeffsuffold check crash w/t-stat
--bigger parmtype[]: fourier.c, bfloat2brik.c brik2bfloat.c, brik2cor.c,
    calcimg.c, paint.c, rawaverage.c, tkmedit.c, tkregister.c, tksurfer.c
--mk0: fix Linux AFNI auto download (bad comment-out, libver used before set)
--tk{surfer,medit,register,strip}.c: autotries 16bit depthbuffer if 24bit fails
--new linux compile: CentOS-5.9-i386 in VirtualBox on Mac OS X 10.6
--csurf/help/setuprender: updated
--tkmedit.c: tkmedit added options kfwhm/kcnt, smooth overlay if kfwhm!=0.0
--csurf: render panel passes kfwhm/kcnt for overlay smoothing to tkmedit
--tkmedit.c: tkmedit added options bwmid/bwslope and sfthresh/sfmid/sfslope
--csurf: render panel passes bwmid/bwslope underlay contrast to tkmedit
--csurf: render panel passes sfthresh/sfmid/sfslope options to tkmedit

### UPDATE: 07 Jan 2013 (twice)
--tksurfer.c: accept signed stat (missing fabs(fmid)) for complex data
--csurf: render panel display/save/pass/togglestate sfthresh/sfmid/sfslope
--tkmedit.c: accept signed stat (missing fabs(fmid)) for complex data
--csurf: fix togglestate (page-specif statmaskparmslist for non-sphavg render)
--csurf: fix intro'd bug in mk new renderscan (wait fix(s)wfile til vars exist)

### UPDATE: 04 Jan 2013
--tkmedit.c: fix im2 promote-to-mgz
--csurf: fix Extract/Convert help to reflect actual operations performed
--csurf: keep mritype radio buttons lit by re-trimming added .mgz/.mgh
--csurf: sphavg render panel: move XSub mask to below Data Type (renum widgets)
--csurf: select real+{Fmsk,tmsk} "Data Type" unsets complexvalflag, fixes col
--csurf: StatMask Paintfile combo under Paintfile combo, init by fixswfileprefs
--csurf: fixswfileprefs: search matching real/cplx statmask, reload StatMask
--csurf: select {r,i} vs. {x,y} swaps XSubPhaseMsk type only if mask on
--csurf: fixed missing-statfile bug that was preventing fieldsign display
--csurf: unoverlap surftestrender/fixswfileprefs (replinfix just fixswfileprefs)
--csurf: fix display of real mask (bak compat: accept #)
--csurf: select_{wfilepref,complexstatsource,complexampmodtype}=>fixswfileprefs
--csurf: selecting complex F vs. sig reset fourierampflag

### UPDATE: 28 Dec 2012
--don't mask colscalebar (no stat to cf.), tksurfer s{fthresh/fmid/fslope} help
--csurf: ADD ADDITION button in Rand Block Design
--tksurfer: report area of FILL or ROI patch to log
--tkmedit.c: im2lutoverlayflag to convert im2 to transparent label overlay
--tkmedit.tcl: "R" im2 detects, "la" toggles transparent label overlay
--tkmedit.tcl: detect/show label->im2, warn/prevent label w/o struct->im2, help
--tkmedit.c: import tksurfer non-binary curv color for surface line overlay
--csurf sphavg: save/paint/sampbak var (_b = _a^2, variance, orig F-ratio sig)
--csurf: t-test _b against t-val entry squared (out:avg-tstat-sph-sm1_b-lh.w

### UPDATE: 04 Dec 2012
--tkmedit.c,tcl: sphnormflag: spherical piecewise lin norm around click
--tkmedit.tcl: check/autoswap LSB BRIK (skip bfloat), set overlayflag statread
--tkmedit.tcl: changed "reg:/val:" to "valn:/vals:", "h": hardstatfthreshflag
--tkmedit.tcl: toggle "mskn:/msks:", read native and read/write regsubsamp mask
--tkmedit.c: toggle native/sub fabs stat mask w/optional 2nd squash
--tkmedit.c: rm hardstatfthreshflag set_*_color hack, use s{fthresh/fmid/fslope}
--tkmedit.tcl: rm "h", overlaymaskflag toggles visiblity s{fthresh/fmid/fslope}
--tksurfer.c: fix real/complex 2nd squash like tkmedit, rm hardstatfthreshflag
--tksurfer.tcl: rm "h", statmaskampflag toggles visib s{fthresh/fmid/fslope}
--tkmedit.c: add color LUT to set_{real/complex}_color, read/write functs, vars
--tkmedit.tcl: squish, add real/complex edit/read/write colorLUT/controls
--csurf: fix csurf Help for Import 3D Stats (setupimport)
--csurf: tkmedit/tksurfer read t- or F-mask logic
--real-{views/flat}.tcl: csurf passes opt maskname to them via env (no "all")

### UPDATE: 05 Nov 2012 
--csurf: pass testrender $rgb to tkmedit/tksurfer via option -rgbname
--tkmedit.c: read_float_stats -> read_native_stat, global native res, exports
--tkmedit.tcl: "val:"<->"reg:" re-{read,reg,subsamp} nativestats, bfloat/BRIK
--lib/help/tkmedit: popup for "val:"<->"reg:", "reg:" entry

### UPDATE: 02 Nov 2012
--tkmedit.tcl: hack to fix cursor position during brainstem 2x zoom/unzoom
--tk{med,surf,reg,strip}.c: rm 32/64 ambig "long" -> "int" or "long long"
--all: bufsize -> size_t (official ambig), fseek offset still ambig long
--tkmedit.tcl: zoomflag: disable wrong intrinsic/Talairach coords, SEND/GOTO
--calcimg.c: allow append arbitrary tag to .mgh/.mgz
--tk{surf,med,reg,strip}.c: adj zbuff depth option (for VMware), singlebuff opt
--tk{med,reg,strip}.c: -followglwinflag opt, csurf passes if smallscreenflag
--csurf: new Expert Prefs: zbuff 24->12, doublebuffer->singlebuffer, menu separ
--tksurfer/tkmedit.c: option: -rgbname

### UPDATE: 25 Oct 2012
--tksurfer.c: shrink: calc_gradamp/gradampfac/chkgradampflag:3Dgrad->gradamp.mg
--tksurfer.c: double-click in GL window raises tk window
--tksurfer.tcl: add ckgrad (squish: rm shri:'s,area->ar), add selfd ($selfstilt)
--tksurfer.tcl: make shrink button, purple/killable (can disable killability)
--tkmedit.c: read_binary_surface/draw_surface: can read/draw 2nd surface
--tkmedit.tcl: checkbutton "2" next to "R" surf: to read 2nd surface
--tkmedit.tcl: rm untested bak compat for tkmedit2000 (tcl7.4)
--curf: SubjTools->MakeFinalSurf (hi-res) vs MGHTools->[same]: diff ExpertParms
--tkmedit.tcl: all2views+zoom unzooms before GOTO PNT to avoid broken
--read/report, write/default/warn optional mgz footer (except tags):
   brik2cor,calcimg,cor2brik,fill,surf,wmfilter,tk{surfer,medit,register,strip}
--new 32/64 compat swapLong
--SWAP_LONG -> SWAP_FLOATINT, rm ambiguous unused "long" member from union
--vi tkmedit/tkmedit.c brik2bfloat/brik2float.c calcimg/calcimg.c \
    tksurfer/tksurfer.c calcvert/calcvert.c cor2brik/cor2brik.c fill/fill.c \
    fourier/fourier.c mytoppm/mytoppm.c phasecombine/phasecombine.c \
    rawaverage/rawaverage.c surf/surf.c surfcombine/surfcombine.c \
    tkregister/tkregister.c tkstrip/tkstrip.c wmfilter/wmfilter.c
--tkmedit read/dump .mgz tags, just -header works for non-{256,512}^3 files
--tkstrip.c: cp input tags to outfile, append curr cmdline, tclscript if there
--wmfilter.c: cp input tags to outfile, append curr cmdline
--calcimg.c: cp input dircos/parms/tags to outfile, append curr cmdline tag
--brik2cor.c: append brik2cor cmdline tag to .mgz footer
--better consistency: char -> unsigned char all progs using 8bit bytebuffers
--tkmedit.c: cp input tags to outfile and append curr cmdline (still report)
--tkmedit.c: fix HORIZ overlay (I/S flipped, because overlay i already flipped)
--csurf: fixed introduced (functional!) viewsavebitmaps hemicurr bug

### UPDATE: 04 Oct 2012
--compiled tcltktix on Linux, not yet pasted into FreeSurfer0.8
--tk{med,reg,surf,strip}.c: intercept wm close GL win event w/testclose
--tkmedit.c: mv startup GLwin to right for interface onscreen (441 + 10 + 1024)
--tkmedit.c: correct (ignored on read) ORIENT_SPECIFIC in write ROI/regsubsamp
--tkmedit.c: fix all3+zoomflag curs drawslice/drawslice2 (revert:rm zoomflag=1)
--tkmedit.c,tcl: fix draw_surf/updnslice w/all3+zoomflag (HOR:scaletrough->thk)
--tkmedit.tcl: unset all3views unsets/hides zoomflag (no non-3views zoom)
--tkmedit.c: max intens all3flag shows planefocus, stop tkwin jump Mac resize
--tksurfer: Linux: don't raise GL win if just Expose event (was irritating)
--tkmedit.c: 512^3 fix: piecewise lin norm, write_regsubsamp_stat, write_roi
--calcimg.c: simple average, subtract, divide :-}
--csurf/fill.c: add opt -clipfeedback, def changed to 0, add to ExpertPrefs
--csurf: RH/LH fill color in ExpertPrefs WMFill, Surf tabs (same var, no edit)
--csurf: incr nbrs for hires inflate (long parm search, 15min/hemi), selecthemi
--csurf/wrappers.tcl: hotkey menuflash, menubind(was overridden)-> menuacceltxt
--tksurfer.c: read second mri data set (fix MRIloaded) (TODO: third/last)
--tksurfer.c: write_images .mgz, export write_self_images, tkstripshell->quads
--tksurfer.c: shrink: toggle/clear/test/write istilt self-intersect shell
--tksurfer.tcl: update SHRINK: add forcemode, flag/CLR/W selfinter, rm bot
--tksurfer.c: export read_images() -> read_images/read_images2, $inim/$inim2
--csurf: add interactive load inim2 (filled.mgz, no adjustable starttime load)
--wmfilter.c: fix gray line 1 pix from edge (zero SUBSAMPLE_BOUNDARY)
--tksurfer.c: im3/inim3/MRI3flag/MRI3loaded/chkthirdflag/chkthird_{hi,lo}lim
--tksurfer.tcl: add interactive load third 3D image set, ck3:lo,hi
--brik2cor.c: cmdline floatfac now combined with HEAD floatfac (if found)
--tk{surfer,medit,register}.c/.tcl: accept equals key as a plus (scale hotkey)
--csurf: 6 new help files for entries/buttons on main csurf interface

### UPDATE: 14 Sep 2012
--tkmedit.tcl,lib/help/tkmedit: talcoords,pixcoords,overlay,surf_ck,im2entry
--tkmedit.c/tkmedit.tcl/use/fmidhelp/medithelp: Alt-i,I fmid up/dn like tksurfer
--csurf: select_session does focus . (focus on init select_session in listbox)
--log hotkey on setupscans(+bitmaps)/sphavg/reconall toplevels, move popups back
--File -> back to 3 lines for each kind of action
--Ubuntu12: apt-get install libx11-dev (else can't compile Xlib!)
--update Mac tcl/tk to 8.5.12 (fixes 8.5.8 wish coredump on Ubuntu12)
--refurbish hi-res fill/wmfilter/fill pop-up ExpertPrefs tabs
--csurf: surfparms->Expert "Surf" tab, newquadoutputflag used by hi-res surf
--csurf: add $pddir=PD, $pdbraindir=PDbrain to VOLUME line, rm mkdir svit
--csurf: SubjTools -> StripSkull (hi-res), ExpertPrefs:addparms,use/view script
--csurf: SubjTools -> WMFIlter (hi-res), ExpertPrefs: use parms
--csurf: SubjTools -> Fill WM (hi-res), ExpertPrefs: use parms
--tkmedit: fix read_second_images for hi-res .mgz, fix auto-add suff, PR's
--csurf: SubjTools -> Create Orig Surf (hi-res), ExpertPrefs: use parms
--csurf: Smooth/Curv/Inflate/Sulc menu: mghsmooth/mghinflate (both hemis)
--csurf: fix view subject bitmaps by tmp auto-set hemi=BOTH
--calcimg: also read/write .mgz (in addition to BRIK,CORdir), add hard thresh
--tkstrip: 512/0.5mm fill/peel punctures shell, add opposite dir shell test
--tkmedit.tcl: fix cleanup introduced bug that shows 0.0 for init Talairach
--brik2cor: option -zeropixwidth (mgz out) workaround/hack for MGH tkmedit bug
--tkmedit.c et al.: read_images properly flushes pipe (no broken pipe error)
--calcimg/fill/surf/tkmedit/tkregister/tksurfer/tkstrip/wmfilter:
   readMGHhead: ignore/warn zero pixsiz, writeMGZhead: cp any to out, warn if 0
   propagates initial pixsize set by e.g., brik2cor, OK when MGH tkmedit fixed
--tkmedit.c: fix bugs in second image max intens image
--calcimg.c: opts -spacing, -setspacing <mm> to read/change spacingXYZ
--all.c: check error on open pipe for read or write

### UPDATE (minor bugfix): 28 Aug 2012
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-120828.tgz
--/home/inverse/freesurfer/tarballs/csurf0.8-mac-120828.tgz
--csurf: fix tkregtargdir var/entry missing for alignscan, if align->no invert
--tkregister.{c,tcl}: harmonize/Mac-ize/usage tk/glx key bindings,help/csurf/reg
--tksurfer.{c,tcl}: harmonize/Mac-ize/usage tk/glx key bindings, help/csurf/surf
--tkmedit.{c,tcl}: harmonize/Mac-ize/usage tk/glx key bindings, help/csurf/med
--help: tkmedit: val,val_read,val_write  csurf: setupsphavg VOLAVG doc

### UPDATE: 24 Aug 2012
--surf.c: -newquad option to write new quad (float) surfaces
--tksurfer.c: {find,select}_orig_vertex_coords OK w/NEW_QUAD_FILE_MAGIC_NUMBER
--tksurfer.c: write trisurf, new/oldquad from div'd-to-tri if undividequadsflag
--tkmedit.c: also read NEW_QUAD surfaces
--tksurfer.c: finally -real/-imag/-stat/-smoothsteps for cmdline load overlay
--tkmedit.c: "tkmedit -f cor/mgz" works, fix Linux tearing: mov win, 1st update
--tkmedit.c: read_images saves mgz headvals in globals, write_images req's read
--tkstrip.c/wmfilter.c/fill.c/tksurfer.c(readonly): same read/write_images fix
--add 3dcopy to included AFNI for convert *.nii to *.BRIK/HEAD
--brik2cor.c: repl orig2cor, gen 512^3/0.5mm^3, read ORIENT_SPECIFIC, trilin/nn
--tkmedit.c in/display/out 512^3
--cor2brik.c conv 512^3 back to BRIK
--calcimg.c in/out 512^3
--tkstrip.c in/out 512^3
--wmfilter.c in/out 512^3
--fill.c in/out 512^3
--surf.c in 512^3
--tksurfer.c: -loadmri1 option requests load this 3D dataset
--csurf: onetime checkbutton right of VOLUME to make SURFACE load selected 3D
--csurf: new hires SubjectTools menu (old+mgz tkstrip/wmfilter/fill/surf)
--csurf: use brik2cor (currently: AFNI align full BRIK only)
--tkregister: accept 512^3, fix old off-edge bug
--tkmedit: working mgz cube check (copy fixed primary/second from tkregister.c)
--mk0: leave otherarch myinstall libs, csurf.tgz to dist, cp arch-specific AFNI
--tksurfer.tcl: val: "R" auto-reads/pushes if complex data (_r,_i or _x,_y)
--tksurfer.tcl: val: "W" auto-write/swaps if complex data (_r,_i or _x,_y)
--csurf/tkregister.c: use/save/edit target-image TR entry on Setup Functscan
--csurf: VOLAVG volume Don complex-F test implemented (on _x,_y only)
--tksurfer.c: fix non-interpolate color LUT ends, fix help (val2rgb,intplut)
--tkmedit.c: -real/-imag in addition to -real/-complex
--tkmedit.c: re-wrire substatpatt: cmdline/intern: _{r,i,m}, interface: onevar
--csurf: tkmedit cmd: use -real/-imag vs. -real/-complex, -substatpatt_{r,i,m}
--csurf: VOLUME-STATS autoloads VOLAVG cross subj subsampled if there
--tkmedit.c: fix offedge cursor crash/1x-fail (maxk2),Linux key1-4 resize redraw
--clean compile of csurfsrc.tgz on myrtos inserted into FreeSurfer0.8

### UPDATE: 04 Apr 2012
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-120416.tgz
--/home/inverse/freesurfer/tarballs/csurf0.8-mac-120416.tgz
--csurf: allow 1 input to 3D Raw Average (for reversing time in single scan)
--csurf: VOLAVG 3dttest avg of r,i and x,y
--csurf: allow reset sphavg dir back to functscan (but not other way)
--tk{surfer,medit}.tcl: catch missing label/regdat/rawdata before C does
--tkregister.c/csurf: allow float BRIK (bbregister, other output)
--tkmedit: subsampstat: cmdline (xsub) else cp from non-subsamp (singlesub)
--tkmedit/csurf: -complexvalflag opt for subsampstat (-real,-complex autoset it)
--csurf: double-click on "subject:" or "surface:" label raises csurf subpanels
--tksurfer.c: dist(gauss)+dens weighted smooth_val_weighted (halfweightdist=0.4)
--tksurfer.tcl: SMOOTH "w"=smooth_val_weighted,vsp->sp,curv->cv, cplx OK but cv
--mk0: onearch-afnilink: ask to make link to existing AFNI
--rawaverage.c: detect/accept/write float BRIK
--fill.c: onefile, ANSI-ify, byteorder+Darwin, read/write .mgz, fix args
--mksurface: fix -wmfilter,-initfill,-dofill,-tessellate for new fill/surf args
--fill.c: options to completely replace fill.dat, fill.dat still works
--tksurfer.c: fix crasher on redraw colscale=LUT with no LUT read in
--tkstrip.c/tkstrip.tcl: port ANSI/OpenGL/Darwin/tk8.5/tiff/mgz/fixopts/squish
--tkmedit.c/tkmedit.tcl: safer write, can re-read vol1, warn no .mgz before fail
--tksurfer.c: plain arrow keys in GL window (finally!) rotate brain
--tkstrip/tkmedit.c: fix crash on can't write COR files
--tkstrip.c: shrinkmode/flatten/momentum opts, comment shrink(), better help
--cor2brik.c: now writes AFNI HEAD w/proper ORIENT_SPECIFIC: 0 5 2
--bfloat2brik.c: inverse of *fourier* (and brik2bfloat)
--bfloat2brik.c: -cphead (DELTA, ORIENT_SPECIFIC, ORIGIN), chk HEADdims=nslices
--orig2cor.c: -noresamp to stop trilinear interp (for just crop)
--tkmedit.c: read second images now ignores missing COR-.info, assumed same
--calcimg.c: pixelwise image math on COR or BRIK
--wmfilter.c: onefile, ANSI-ify, byteorder+Darwin, read/write .mgz, fix args
--write_images() now writes COR-.info, read_images set ptype, tksurfer read mgz
--tkmedit.c: mk cordir if not there
--tkmedit.c -- side follow window w/lg GL, write_images writes COR-.info!
--tkmedit.c -- also allow Gaussian smooth editable underlay
--tksurfer.c: read/write new quad (float) surfaces (output init stages MGH)

### UPDATE: 25 Feb 2012
--help: csurf=tksurfer; tksurfer=rgb*,label_read/clear,tiffout; tkmedit=fill
--csurf: menu: add Make Occip/Full Cuts if MGHTools, rm oldsubjtools help
--csurf: menu: add Make Cuts, Hand Prenormalize to MGHTools
--mpeg_play: fix compile on Darwin Intel: #if defined(__{BIG/LITTLE}_ENDIAN__)
--csurf: block sphavg sub/sess/scan callbacks to postpone errs till panel done
--tkmedit/csurf: read_rawdata, curf passes imagepatt to tkmedit
--tkmedit: write_roi_timecourses from subsamp ROI, uniq w/subsamp votes
--tkmedit.tcl: "T" write_roi_timecourses (cp C-strhandling for test overwrite)
--tkmedit.tcl: 17 new help pop-ups

### UPDATE: 18 Feb 2012
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-120218.tgz
--/home/inverse/freesurfer/tarballs/csurf0.8-mac-120218.tgz
--tkmedit.c: clean up 3D buffer situation
--tkmedit.c,tkregister.c: ReparentNotify->resize_window_intstep 10.7 white fix
--tksurfer.c: ReparentNotify->redraw fix Mac 10.7 init white problem
--wrappers.tcl: fix bold Xft fonts on Mac 10.7 (arial bold -> no longer bold!)
--mk0: def flag compile w/disable Xft (Mac: back to reliable bitmap fonts!)
--mk0: 10.4=both, 10.5=??, 10.6=both, 10.7=bit, F7=xft, F15=bit, Ubuntu=??
--tk{surfer,medit}.c: no memory leak on re-malloc 3D,4D bufs; bufs now contig
--tkmedit.c: fill_roi, write_roi, read_roi, labelflag
--tkmedit.tcl: add FILL,roi lower left, replace outim WRITE w/label R/W/T
--tkmedit.c: setfile-like fixes to exported tcl filename vars, -scandir option
--csurf: get/pass -scandir option to tkmedit
--tkmedit.tcl: auto-read/write complex subsampled stats w/just _r/_x in entry
--tkmedit.c/.tcl: fix BRIK +orig.BRIK filename policy
--csurf: unique-ize AFNI-ALL links (problem if multiple avgs)
--randsurfclust.cpp/mk0: add cdflib to csurflibs, fix Darwin compile
--tkmedit: rm HISTO,SAGMIRR, add new statmask entry line (currently no-op)
--tksurfer.c: frame2tiff(), tiffoutflag, black2transparentflag, interface
--mk0: also include/compile libtiff, static compile into tksurfer (300K->1Meg!)
--mytoppm.c: convert tiff to ppm, too (uses libtiff, no longer self-contained)
--csurf/tclscripts: Preferences -> Save .tiff, save img/movie scripts respect
--csurf: black->transparent menu, fix nmovie puke briklabel (braks -> @, not #)
--tkmedit.c: libtiff/tiffoutflag, GL_FRONT -> cursor now saved in bitmaps
--phase/offsetmovie.tcl: abspath rgbname OK
--csurf: re-wrote Help->csurf, incl tiff help, View Log to top of menu
--tiff2mpg: new script (no scale/tile/crop), left mri2mpg using rgb's

### UPDATE: 5 Jan 2012
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-120105.tgz
--paint: added: -dump normals of a label, improve help message
--tksurfer: allverticesflag, val2newcsurvflag (same write_binary_values funct)
--paint: non-surflib write_binary_values w/o relpath default out -> SUBJECTS_DIR
--paint: accept float BRIK(s), -curvout (newcurv) option, major code cleanup
--csurf: fix CMD w/no scandir, config'd missing sigavgdir, def frac dstep->0.1
--paint/surflib: -allvertices option to write all vertices to wfile
--csurf: fix saving of finalparms, fix saving paintdmin/max for Ext Stats Scan
--rawaverage: fix bfloat average
--calcvert: fix ASCII file column-reading (was always reading column 1!)
--calcvert: allow diff on wfiles, even w/diff num vertices
--csurf/{tksurfer,tkmedit}.tcl: refix findeditor: new which: no resp to missing
--csurf: catch/report unreadable sessions (fixes View All Scandirs crash)
--rawaverage: also accept/write bfloat, fix bug in writing (usu. ignored) .hdr
--csurf: begin cplx vol avg: wire up StatBrikPrefs entry, VOLAVG still empty
--tksurfer.c: Mac10.5: cursor glDrawBuffer(GL_FRONT) ignored, GL_FRONT_LEFT OK
--csurf: re-write/fix MGH recon-all errors/cmdline/re-run
--csurf: omit SubjectsTools menu: Darwin or not FreeSurfer0.8
--FreeSurferEnv.csh: reports FSURF (N.B.: reset rh9compile=1 for FreeSurfer0.8!)
--mk0: makes fallback instdir subjects/sessions
--calcvert: -convert newpatch->oldpatch (bak compat for old tksurfer)
--paint.c: compile w/updated surflib: ASCII dump new patch now works
--surflib.c: update MRISreadPatchNoRemove like read_binary_patch
--csurf: Help->Csurf: document formats old/new binary patch, fieldsign/mask
--csurf: SURFACE, SURFACE-STATS passes flattenparms(writefloatpatchflag)
--tksurfer.c: read new/float patch too, def write new, !writefloatpatchflag->old
--csurf: default 3d patch view is medial only if occip.* or flat.*
--tksurfer.c,tkmedit.c: clean up, harmonize make_filenames args/placement
--tkmedit.c: read/write_regsubsamp_stat (r/i/s, maybe smooth) 256^3 float BRIK
--mk,getonearch: hack to autofix ld cycle opengl mess on Mac OS X 10.5
--mk: mk clean now works (explicit clean prog all Makefiles)
--csurf: add Rayleigh test to SPEREAVG cross sub stats _e calculations
   Rayleigh p pos expon = -log10(exp(sqrt(1 + 4*n + 4*(n^2 - R^2)) - (1+2n)))
   n=samples, R=vectsum (not avg) of normed2unit vectors for each sample angle
--csurf: AFNI-ALL SetupFunct cmd to make links + view allBRIKs in curr session
--tksurfer.c: read/write complex phase LUT (now def: complex amp script-only)
--tkregister,tkregister.tcl -- add raise_window, pop GL on plane change
--tkmedit.tcl: pop GL on change plane
--tksurfer.tcl: pop GL on REDRAW
--mosaic2brik: hack tcl script to unpack Antoine's 3D EPI DICOMs w/AFNI imcutup
--tkmedit.c: clamp BLUE_TO_RED_SIGNED rgb because cast before glColor wraps
--tkmedit.c: openglxwindow: omit 24-bit depth buffer, and depth bit from glClear
--csurf: block/warn spaces: mkavgdirs/CSURF,SUBJECTS,FUNCTIONALS_DIR/browsedir
--csurf: use bfloatstem verbatim for tkmedit overlay if real file (no add _f)
--csurf: add -stimcycles env/opt (functscanlists) surftestrender, def missing
--tksurfer.tcl: add hardstatfthreshflag checkbutton,repl/mask/mult all visible
--tksurfer.c: export sfthresh/sfmid/sfslope, tmphack:mask:use fthresh for sfmid
--csurf: begin new Statfile: combobox (not yet exposed)
--add: afni/bin/imcutupbin, noarch/mosaic2brik: convert 3D hack
--csurf: colscaletype forces compatible complexvalflag/tclscripts/colscale
--csurf: surftestrender warns Data Type (colscaletype) and Color Scale mismatch
--csurf: write complicated complex+stats mod/source consistency check (3errpan)
--csurf: 2nd rendersphavg-only tixSelect for repl/mask/mult statsource(12combos)
--csurf: change csurf repl/mask/mult to tixSelect, conv to tksurfer binaryflags
--csurf: cplxfname->cplxstatname1,cplxfname2->cplxstatname2,cplxstatname3=amplnm
--csurf: replace statsfromsigflag with renderscanlists($page,complexstatsource)
--csurf: add single value (def=0.0) to compare 1-sample ttest of _a with
--csurf: resamp avg/tstat of _a to dispsubj, skip resamp (_x,_y)(_r,_i) t-tests
--csurf: save avg/tstat of amp=hypot(_r,_i) as zz-{mean,tstat}-sph-sm1_a-$hemi.w
--csurf: repl w/simple suff-based headreader for BRIK,bshort,bfloat: readheader
--csurf: rm flipbrik, convalign/CONV=>COR, classify{str,fnct}+children,mri_head
--csurf: auto-create make{scan/orig}dirs panel and 2 blank entries
--csurf: finish/test interface for RECON-ALL (curr:no csurf.dat parms saved)
--csurf: start editor errs->null, catch other which errors (like tksurfer.tcl)
--csurf: force all calculations in sphavg to output float briks
--csurf: mvlog: fix "set own/grp(was: 501/0):not perm" work-but-crash-tcl:catch
--csurf: new mri_surf2surf requires .w suffix even w/recog'd src_type w
--csurf: if cmplx amp mod set, try subst -mean- to -stat- for _f,_g lookup
--csurf: handle 3 types of complex amp mod: precedence: replace, mask, multiply
--csurf: disable oldsubjtools if Darwin, if !oldsubjtools bakcompat to MGHTools

### UPDATE: 10 Oct 2011
--fixed dump raw timecourses for real data bug

### UPDATE: 08 Oct 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-111008.tgz
--tksurfer.tcl: "mask" checkbutton, error if stat not loaded 
--tksurfer.c: statmaskampflag: redefine fthresh as mask cplx if stat<fthresh
--tksurfer.c/tksurfer.tcl/csurf/tclscripts: change $ext->$surfext
--tksurfer.c: isocontours: xyz, latitudes, latitude/longitude
--mk0: more archs precompiled freesurfer: mri_{head,convert,surf2surf},nmovie
--tksurfer.tcl: isocontour button (tksurfer.c: lazy load sphere.reg, flat OK)
--tksurfer.c: AP/SI/RL isocontour drawing fixed for quad and tri surfaces
--tksurfer.c: clean up scalebar/disk autoscale/minstatcolscale handling 
--csurf: save/remember LUT colscale, interpolatelutflag
--tksurfer.tcl: to->complex: reset colorlut to complexamp; to->real: go back
--tksurfer.tcl: fix runaway transform (quick trough clicks) w/redrawbutton delay
--tksurfer.tcl: fixcolscale add real/complexamp color LUT
--tksurfer.c: colscale=12:realLUT  colscale=13:complexampLUT (after stat'd)
--tksurfer.c: read_val2rgblut (val r g b), interpolatelutflag vs. 1/2 to next
--mk0: fix/test insttmp and put it into 'mk0 onearch'
--tksurfer.tcl: fix kill persisting editor killing newly started tksurfer
--tksurfer.tcl: setfile sessionfiles uses $scandir (left case: subdir='.')
--csurf: load any scripts dir tclscripts into 3D/Flat (tksurfer completes paths)
--csurf: tkmedit rad:0->1, Update subj/sess keep curr, tkmedit surf by $hemi
--csurf: fix ps -[options] (finally broke for good on Mac OS X 10.6)
--help: setuprawavg, csurf (defaults chain)
--csurf: widen entries, squish buttons for Make Raw/Phase/Surf/Field Dir
--csurf: add reverse time checks to rawaverage panel (average only)
--rawaverage.c: write BRIK if first input is BRIK (dropped 'skip','brik' input)
--rawaverage.c: reverse time flags option
--wrappers.tcl: mv entry bg fix from fixcolors->tksurfer.tcl (broke tkmedit.tcl)
--tksurfer.tcl: cram label transparency control onto curv line
--tksurfer.c: make labels adjustably transparent, export labelalpha
--tksurfer.c: floodfill respects displayed labels (for no overlap -> eroding)
--tksurfer.tcl: ROI butt: eroding val (cplx:val/val2 amp) cmp w/thresh (vs.stat)
--tksurfer.c: new floodfill flags to compare val (cmplx:val/val2 ampl) w/fthresh
--tksurfer.c: fixed eroding floodfill (erodingfillflag=1 restores old behavior)
--tksurfer.c: write_labeled_vertices reinstate ripflags on origcorr/reread patch
--tksurfer.tcl: c2lab check patch line to ctrl usecurrcoordsflag (e.g. flat)

### UPDATE: 01 Sept 2011
[untar/tar: fix write label on flat patch bug]
--tksurfer.c: add usecurrcoordsflag (now: only write_labeled_vertices)
--tksurfer.tcl: R-click on "tcl:" displays/describes standard scripts
--tksurfer.tcl: add RC lab butt: read label to val (R), but also recut label
--tksurfer.c: add read_label_to_val arg (flag) to maybe also recut label
--tksurfer.tcl: add DIST button for calculating Euclidean distances
--tksurfer.c: print_dist_last2_selected -> Euclidean dist message in log
--tksurfer.tcl: rm clear_values R (label->val),val:addCLR/READ->R/WRITE->W,help
--tksurfer.tcl: NUM+entry+tclonlyvar:$nclosestvertices, fill_n_nearest_vertices
--tksurfer.c: export clear_vertex_marks, new exported: fill_n_nearest_vertices
--tksurfer.tcl: INIT->NOCUT NOCUTS->INIT, "FILL ROI"-> ROI, fix helps
--csurf: key updates of setuprender help
--csurf: manually change all tixSelect buttons to hfont (no defs for rnd names)
--csurf: statsfromsigflag: pick cplxfname F-stat to use in sphavg stat/mul mod
--csurf: make Hagler-like F-stat from 1subj sqrt-F (in addition to raw F amp)
--csurf: rm render cvfact/offset, expand chklabels, hide/sav renderscanlist copy
--csurf: subj-specific ExpertPref lights cntrls, trans cvfact/offset to there
--wrappers.tcl: helvetica->arial (old: no diff, new: helvetica too thick)
--csurf: configfunct(newpkgtix) TixButtonBox->hfont (decl), TixLabelFrame->tfont
--tksurfer.tcl: "R" label butt: clear values, read label (real/cplx) to val(2)
--tksurfer: new exported funcs: clear_values, read_label_to_val (real,complex)
--csurf: mk{orig,scan}dirs entries -> hfont(newpkgtix)
--csurf: add TixButtonBox hfont to config function(newpkgtix)
--csurf: config(newpkgtix) hlist->hfont: ph,surfavg//rndblk/view/batch/rgb/mpg
--csurf: config bare entries ffont, Make Dir entries tighter hfont
--wrappers.tcl: compact arial12 hfont for hlist/cbx (entries keep loose lucida)
--csurf: onfig default combox label ffont->tfont, override for main csurf panel
--csurf: add label/entry defs to configtixbookcbxent (TODO: add tixSelect fonts)
--csurf: [tix option get bold_font]->wrappers.tcl:$tfont (leave italic_font)
--csurf: tixlabelframe subwidget font config vs. -options
--csurf: combobox subwidget config vs. -options (see: "tix options bug")
--wrappers.tcl: fork pre-8.3 fonts mess
--FreeSurferEnv.csh: add path to F7 libs if new incompat Linux
--tksurfer.c: bi scale:bar->disk, heatscale:bar+disk
--tksurfer.c: write talairach coords into raw and selected timecourses
--tksurfer.tcl: fn-F3 interface entries to control bi ON/OFF cols
--tksurfer.c: 6 new parms to control bi ON/OFF cols
--mk0: fix Mac10.6 Tix compile (link to fix can't find -lX11)
--csurf: fix missing brightness parm on phase average redo paint
--tksurfer.c: timecourse display options: -rawdatarange, -showavgcycflag
--tksurfer.c: get phase color for average timecourse from average val,val2
--tksurfer.c: draw average timecourse for write_label_timecourses
--tksurfer.tcl: better pose/cuts control (restore) on live swap between 3D/flat

### UPDATE: 02 July 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110702.tgz
--tksurfer.tcl: "T" button to right of label WRT button: write_label_timecourses
--tksurfer.c: always read thickness,export read_binary_thickness/thfname(=thick)
--tksurfer.c: write_timecourse: append single timecourse to $hemi.selected.raw
--tksurfer.c: write_label_timecourses to $hemi.<area>.raw, export to tcl
--tksurfer.c: add .origx,y,z to vtx, load if surf==orfname, get_timecourse uses
--tksurfer.tcl: no-redraw "W" button right of rgb WRITE: saves cursor,timecourse
--tksurfer.c: frame2rgb: if(doublebufferflag) glReadBuffer(GL_FRONT), save curs
--tksurfer.c: shift-R-click: draw_timecourse (front buffer) + dump to ASCII
--tksurfer.c: get_timecourse search->1depth (same vox for all t)
--tksurfer.c: rename stem->hemi, add scname[], =$scandir, =$dir (TODO:use!)
--{polar,eccen}-views.tcl: 'setfile rawdata,regdat ...' (TODO:others!)
--tksurfer.c: add -regdat/rgfname/W_read_regdat
--tksurfer.tcl: add rawdata,regdat to setfile sessionfiles
--tksurfer.c: read_rawdata: read HEAD, alloc short/float, read rawdata->buf
--tksurfer.tcl: tmp backcompat: trace write $dir, copy it to scname[],$scandir
--save Linux 32-bit libs needed to make FreeSurfer0.8 bins work F15
--rearrange FreeSurfer0.8 minc dirs, fix csurf, FreeSurferEnv.csh{8.5,7.4}
--fix mk0 ref to be getonearch (not onearch) for mpeg compile
--csurf: add AFNI button/binding to Fourier panel
--fourier: rm crashing in-plane smoothing (arg still recognized, ignored)
--csurf: add Fourier panel pre-smooth3D, rm smoothtepsin (crashing fourier 2D)
--csurf: fix rev order and missing +orig 3dmerge args in DECONVOLVE presmooth
--tksurfer.c, lib/tcl scripts: better swap/push funct names (old still bound)
--csurf: bind AFNI to Alt-f, fix setupfunct help, catch missing paintnormtype
--tksurfer.tcl: smooth val now transparently works for complex data
--tksurfer.c: fix ancient (2001) bug in never-used swap_value
--tksurfer.tcl: mostly-passed-by-opts cmdline works (if complexvalflag bad,fix)
--lib/tcl/*.tcl: comment out defaults (because they blow away cmdline opts)
--tkmedit: set default rgb to statstem in session rgb dir if overlayflag
--csurf: rm statflag, save invphaseflag, goto mostly-passed-by-opts cmdline
--wrappers.tcl: changed menubind to allow override hotkey annotation (Mac)
--csurf: figure out Mac alt/cmd tk key bind, fix a few (Preferences,ViewBitmap)
--tkmedit: omit cyan cursor center for less occlusion if overlay+all3views
--tksurfer: GOTO (select_orig_vertex_coordinates) prints vtx data same as click
--csurf: check fieldsign panel $fspatchext (was: use $fspatchext, chk $patchext)
--csurf: TruncFS (nonbinaryfsflag) control; no csurf fsslope control for now

### UPDATE: 24 May 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110524.tgz
--tkmedit: fix crash w/overlay=1 and no overlay loaded (tcl now catches first)
--tksurfer: add multiple, signed white phase contours
--tksurfer.tcl: add controls, help panels for multiple white phase contours
--calcvert: also dump ASCII of fieldsign
--tksurfer: write float fieldsign (was -1,0,1), set_fs_color now clamps (def)
--tksurfer: nonbinaryfsflag/fsslope -> near-0 valley on top of mod-by-fsmask
--lib/help/tksurfer,csurf -- documentation for fieldsign, new controls
--tksurfer: write_labeled_vertices -> x,y,z,val,(val2) not coord[0,1,2],stat(!)

### UPDATE: 28 April 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110428.tgz
--tksurfer.tcl: scalebar limits entries {min,max}statcolscale report/set
--tksurfer.tcl: add S/V button for swap_stat_val, Return does some READ/WRITE 
--tksurfer: cmid now affects light/dark gray underlay, too
--lib/help/tksurfer/setuprender -> fix description of dispersion index!
--csurf: frac/thick filetest catch BOTH, def sigavg normsearch if missing
--csurf: begin add MGHTools menu, FSURF_DIR, $mghbindir
--csurf: if chg normtype: to frac: 0-0.8 (avg=2.5mm), to mm: 0.0-2.0, else saved
--csurf: special-case runbatchstat sphavg/rendersphavg, special runsphavgpanel
--csurf setupsphavgcx returns, add kill proc, runsphavgpanel now presses buttons
--onearch: detect broken Ubuntu uname returning "unknown"
--noarch scripts: rgb2tiff, rgb2mpg, mk, mk0, dti2surf, sortmovie, labeldata

### UPDATE: 10 April 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110410.tgz
--tksurfer.tcl, lib/help/tksurfer/* -> 40 new tksurfer R-click help panels
--phasemovie.tcl, offsetmovie.tcl pop GL now works (add XFlush to raise_window)
--write_labeled_vertices now works w/triangle surfs (use 2 read_binary_surface)
--read_orig_vertex_coordinates -> call read_binary_surface instead (left funct)
--mk0: add precompiled Motif to mk0, better mk0 dist/prog/inst logic
--tksurfer: savergb pop after testreplace, manual scalebar lims, stop normcurv

### UPDATE: 06 April 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110406.tgz
--csurf: introduced 3D fourier stats avg bug fixed; thickness/frac catches BOTH
--tksurfer.tcl: pop redraw/save_rgb *after* possible overwrite dialog
--full source tree freshened/recompiled (after several month piecemeal updates)

### UPDATE: 31 Mar 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110331.tgz 
--csurf/paint can now use cort thick file for dfrac{min/max} paint (mm OK, too)
--fixed tksurfer->SEND->tkmedit/tkregister->GOTO axis swap with mgz file

### UPDATE: 18 Mar 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110318.tgz 
--csurf: Don complex F-stats now works in sphere average panel (finally :-} )

### UPDATE: 13 Mar 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110313.tgz 
--csurf: Don complex F-stats now works in sphere average panel (not quite!!)

### UPDATE: 10 Mar 2011
--/home/inverse/freesurfer/tarballs/FreeSurfer0.8-110310.tgz 
--csurf: Don complex F-stats now in sphere average panel

### UPDATE: 04 Mar 2011
--tkmedit: major update: display/subsample/3d-Gaussian-smooth complex stats
--csurf: render panel VOLUME-STATS button finally works!
--tksurfer: read_binary_values can read newcurv format file as valfile

### UPDATE: 16 Feb 2011
--tksurfer: fixed broken fieldsign blue :-}
--included in this tarfile: FreeSurfer0.8-110216.tgz

### UPDATE: 26 Jan 2011
--tkmedit: export editimgtype: always write same format as editable read
--tkmedit: read/write .mgz/.mgh 256^3 byteimg, -header, -noedit
--tkregister: read .mgh/.mgz, fpref's dir/COR- => dir, inline file_name
--tkregister: COR->mgz OK (reg.dat inside COR dir) but block moveable mgz for
--csurf: check for $cordir.mgz if 1st file in $cordir not found tkmedit/register

### UPDATE: 21 Jan 2011
--fourier: save raw stimfreq coefficients
--csurf: added Don's complex F (TODO: sample it back to indiv subj)
--csurf/tksurfer: multiply or replace Fourier amplitude w/stat field
--tkmedit: off-the-edge cursor bug
--various small fixes

### FIRST BIG UPDATE: 02 Jan 2011
--update tcl/tk/tix to 8.5
--Mac/Darwin port, Linux, IRIX re-compile of SessionTools binaries:
   asc2float bresize brik2bfloat calcvert cor2brik fourier mytoppm
   orig2cor paint phasecombine rawaverage rcxcombine regcor surfcombine
   tkmedit tkregister tksurfer wheel mpeg_play mpeg_encode
--csurf: new cross-subject real or complex spherical average panels
--tksurfer: color labels, ipsi pol color and phase trunc, live load new surf
--tkregister: invert and 3Dsmooth target, MIRR/SEND/GOTO/blink also on main


############################################################################### 
HOWTO compile csurf (also in READE.txt)
###############################################################################

### HOWTO compile csurf on Mac or Linux
tar xvfz csurfsrc-YYMMDD.tgz
cd csurfsrc
./mk0 onearch       # compile: includes auto AFNI download (takes a while)
./mk0 dist          # remake source distribution (e.g., if modified)
./mk0 insttmp       # make binary install tarfile in $CSURF_DIR/dist (and /tmp)

### HOWTO compile Linux binaries in Mac VirtualBox (CentOS 5.9 example)
# make VM
Oracle VM VirtualBox Manager -> New
type=Linux2.6/3.x(64 bit), name=CentOS-5.9-64bit, 3G RAM, 100G disk, 64M vidRAM
make new virtual disk:
  ~/VirtualBox VMs/CentOS-5.9-64bit/CentOS-5.9-64bit.vdi
mount CentOS-5.9-i386-bin-DVD-1of2.iso on hosereno

# install guest OS
VirtualBox Manager -> double-click CentOS-5.9-64bit -> start empty VM
VirtualBox VM -> Devices -> host-mounted CentOS-5.9-i386-bin-DVD-1of2.iso
default CentOS install ("desktop gnome", not "server")
SELnux -> Disabled (reboot), install create user sereno
Package Updater (incl kernel), reboot

# install devel tools, missing headers
yum groupinstall "Development Tools"  # gcc, g++, tools, kernel devel
yum install kernel-devel              # for compile VBox kern additions
yum install libX11-devel              # compile any X11
yum install libXp                     # run AFNI
yum install mesa-libGLU-devel         # compile tksurfer (just circular scale!)
yum install zlib-devel                # compile tksurfer (libz was there)
yum install libjpeg-devel             # compile tksurfer (libjpeg was there)
yum install libXext-devel             # compile mpeg_play
yum install bzip2-devel               # compile mapper (new FT, libbz2 there)

