###################################################################
UPDATE: 27 May 2016
###################################################################

Cmdline paint can output uniq samp vertices label

The tksurfer function, find_uniqsamp_vertices,
finds a set of 'representative' vertices for a 3D
data set that has been sampled to the surface as
follows -- for each set of vertices that has
sampled the *same* 3D functional voxel, find the
vertex closest to average location of that set.

The same functionality was added to the command
line program, paint, via a new option, which can
be appended to the (long) command line:

  -uniqsampvtxs

The 'representative' vertices are written to a
label in the same directory as the other output
files:

  ?h-UniqSampVtxs.label

For more details (and to try this interactively),
click the "val:" label to toggle it to "val3d:"
and see the R-click help for UQ.


Calculate data gradients on curved surfaces

New overloads of the "GR" button allow calculating
and displaying gradients (of curv, val, or
complex-valued data in val,val2) on curved
surfaces.  This uses unit vectors to neighboring
vertices as a basis set.


'Normal' search along vector to same pial vertex

New option for paint (and tksurfer live paint) to
read pial surface and do 'surface normal' sampling
along line between equivalently numbered vertex
instead of default csurf search along local
cortical surface normals (e.g., using fractional
distances from thickness file).  The same-vertex
method is used in SamSrf.

For reference, the mris_thickness algorithm for
measuring cortical thickness is:

 foreach numbered vtx
    find minimum of
       dist from white vtx to equiv num pial vtx
       dists from white vtx to neighbors of equiv num pial
    find minimum of
       dist from white vtx to equiv num pial vtx
       dists from neighbors of white vtx to equiv num pial
    average above two minimums

The option is available using the "Same" tickbox
under "Normsearch:" at the bottom of the Setup
Functional Scans panel.  Also available for live
paint from tksurfer ("samevtxthickflag" tickbox on
popup from left click on "label:").

The slightly higher thickness estimates from the
same-vertex method sample slightly higher in the
cortical column compared to the cortex normal
search using fractional freesurfer thickness
(thickness from mris_thickness).


Convert SamSrf pRF subject to also be csurf session

New prf2sess script to convert a SamSrf pRF analysis
subject to have an embedded "image" directory containing
wfiles, so it can be read as a csurf session (e.g.,
for surface average).


-----------------------------------------------
Bug fixes, small changes
-----------------------------------------------

Fixed small error in sphere_morph surface normal

Flat *or* surface gradients arrows now zeroed when
amp below fthresh.

Block accidental opening of single subject with
single scandir as a cross-subj surface average session.

"X" (xcorr) pop-up autosaves corr output (_s), can set prefix

"X" (xcorr) pop-up can output z-score (_z) instead of correlation.

Random Block Panel formatting improvements

"All Help In One Panel" entry in Help Contents

tkmedit "m" untick to *not* also smooth 3D stats

3D cluster: better help, interface labels

fix "killbox error" on kill window w/title bar 'x'

##########################################################################
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: 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 (horrible) 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
...




