###################################################################
LATEST EMAIL UPDATE: 12 Sep 2015
###################################################################

Pearson/circular searchlight correlation updates

The Pearson/circular searchlight correlation was
updated to also output a p-value (in positive exponents
of 10).  To make the results visible after running "X",
do swap_pval_val (see R-click help for "X" button).

A new function, find_uniqsamp_vertices finds
'representative' vertices for lower resolution data
upsampled to higher resolution surface meshes.  On
interactive paint, each vertex records the uniq 3D
voxel it sampled. Then, this information can be used to
find the 'representative' vertex for each voxel, which
is defined as the vertex in the set sampling one voxel
that is closest to the average location of all the
vertices in that set.

The searchlight correlation can optionally restrict
itself to these 'representative' vertices.  This option
will eventually be extended to other kinds of analyses.

To see them, you have to interactively paint 3D data in
tksurfer as follows:

  1) open scandir w/analyzed functional data in it
  2) click "val:" to change it to "val3d"
  3) select a BRIK (not a wfile) from the dropdown
  4) read it with "R"
  5) sample to surf w/"PAINT" (clk "label:" for paint parms)
  6) don't smooth so individual voxels still apparent
  7) get 'representative' unique vertices with "UQ"

To run the correlation searchlight, use the "label:"
line "X" button.


Interactively run surfclust

The button to run surfclust (multiple comparison
cluster exclusion filter) interactively was moved from
the "val3d:" line (where it was called "CLU") to the
"val:" line where it belongs (being a surface
operation).  To interactively run it, read in an
unfiltered stats file (e.g., _f infix). Then click
"label:" to get parameter controls.  Then click "CS".
The output will be a file with an _h, which you can
read in and view with "R".


Display surface-wide percent response

If the raw Fourier amplitude at the stim freq has be
read onto the surface (infixes _x,_y), it can be
converted to percent response.  This requires knowing
the corresponding raw brain data average (e.g., ~800)
and the number of timeseries points (e.g., 256).

This can be used even when there is no raw 3D data in
the directory (e.g., cross subject averages), as
opposed to shift-left-click on the "T" button, which
does this for a label in a scandir with timeseries
data.

This is accessed by a middle-click on the "val:" line
"W" button.


Help updates

A large number of help panels (40) were updated.  In
particular, all the parameters in the "label:" popup
now have help, and all overloaded button warn/explain
when an alternate function is about to be performed.


Bug fixes

One bad, sometimes-crasher in tksurfer from a click in
the black background has been fixed.

A bug in some pop-ups hung the surface window if you
closed the pop-up with the upper left 'x' button, now
fixed.

Gory details below.

### 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 vtxs, interactive surfclust)
 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 '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 :-}

To install the new csurf:

cd <dir-where-csurf-currently-installed>
  mv csurf csurf-YYMMDD
  tar xvfz csurf0.8-{mac,linux}-YYMMDD.tgz

cheers,
marty

#########################################
Latest addition to $CSURF_DIR/UPDATES.txt
#########################################

### 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 for 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 uniqvoxdata
--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: 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
...




