###################################################################
LATEST EMAIL UPDATE: 22 Mar 2015
###################################################################

Some new functions, interface/doc improvements, bug fixes.
See UPDATES.txt excerpt below for details.


Pearson Correlation Searchlight

A new button ("X" on the "label:" line) performs a Pearson
product-moment correlation between two loaded data sets over
a set of local surface-based 'searchlights' specified by a
label or annotation color.

For each vertex, a correlation is done in a 'searchlight'
defined as a set of nearest vertices to each vertex in a
label.  The size of the searchlights can be controlled by
vertex count (num), area (mm^2), or radius (mm).

The vertex-wise result is put into the .stat field and
displayed when done.  The data to be compared can be real or
complex.  In the complex case, the amplitude is used (circ
correlation for phase coming next update -- UPDATE 24 Mar:
now included in back-dated 22 Mar tarfiles).  The region over
which to calculate spotlights can be specified by a regular
label or by a single color in a loaded MGH annotation file.

Here is an example of how to get a searchlight correlation
between a real data set and the amplitude of a complex data
set using a regular label to define the searchlight centers:

  1) load 2nd (real) data set ("R" on "val:" line)
  2) shift-middle-click "S/V" => swap to bottom of stack
  3) load 1st (complex) data set ("R" on "val:" line)
  4) select labelfile from "label:" dropdown
  5) click "X" on "label:" line:
  6) set parameters in popup:
        fillneartype -> 2 (radius)
         num_sqmm_mm -> 7.0 (mm)
         cmptype -> 1 (compare complex-amp to real)
       click "Ready"
  7) view output (auto changes colscale to real)


Use MGH annotation to extract stats/timecourese from 3D files

The previous update allowed reading MGH annotation files and
using them to extract surface data to a label.  The current
update extends this to extracting stats and raw timecourses
from 3D data (more functions added to "T" and "S" buttons).
Previously, extraction from 3D files required a label.  An
example is:

  1) load vertex data (to decide which 3D data to extract)
  2) select MGH annotation file in "label:" dropdown
  3) left-click the "D" (label display) button
  4) click vertex in colored region to pick it (load r,g,b col)
  5) middle-click "T" or "S" buttons to extract data to ASCII files


Display SamSrf (pRF) data analysis in csurf

Sam Schwarzkopf released a MATLAB toolbox to calculate and
display population receptive field (pRF) analysis using
freesurfer surfaces here:

  http://figshare.com/articles/SamSrf_toolbox_for_pRF_mapping/1344765

The results are saved in ASCII label files in a "prf" subdir
of a freesurfer subject.  These are now loaded (along with
other subjects and sessions labels) as a group at the bottom
of the tksurfer "label:" dropdown.  Sam's labels have an
underscore (e.g., 'rh_') after the hemisphere (instead of a
'rh.' for an MGH label, and a 'rh-' for a csurf label).  If
the label is part of a complex-valued pair such as:

 ~/prf/rh_pRF_sf_pol_r.label
 ~/prf/rh_pRF_sf_pol_r.label
           or
 ~/prf/lh_pRF_sf_ecc_r.label
 ~/prf/lh_pRF_sf_ecc_r.label

reading the data from either one using "R" on the "label:"
line will automatically load the other (and auto-reset color
scale settings appropriately).  Note that csurf labels ('rh-'
prefix), by contrast, usu. store real and imaginary values
in a single label file (6 entries per line instead of 5).


Small updates

Can display just borders of MGH annotation or single labels
(shift-middle-click the check to the left of "label:").

When RECON-ALL is purple/running, it now properly kills a
partially done reconstruction.

There is a new pfbrik script to conveniently run the
Gaussian plane filter on an AFNI BRIK.

On Mac, TextEdit will be used as an editor (best with X11
*not* in fullscreen) as opposed to Paleolithic xedit.


### 22 Mar 2015 (corr searchlight, data extract w/MGH annot, read SamSrf
#1) "X" butt: Pearson corr 2 datasets (searchlight every vtx label/annotcol)
 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


###################################################################

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
#########################################

---------------- 22Mar2015 FreeSurfer0.8/csurf0.8 tarballs -------------------
--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: 18 lines each vs. 7 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 9 cases to buttons: "T" (3 cases) and "S" (6 cases)...
--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
---------------- 06Mar2015 FreeSurfer0.8/csurf0.8 tarballs -------------------
--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
...




