###################################################################
UPDATE: 21 Jun 2018
###################################################################


Improved annot2roi.tcl script

This script provides a way to gain most of the
advantages of individual surface-defined areas
(e.g., from the HCP parcellation), while still
mostly operating in 3D.

This script first resamples an fsaverage
annotation (e.g., HCP-MMP1) to an individual
subject surface, then makes single-subject 3D ROIs
from it.

The popup now has a dropdown to simplify picking
an fsaverage annotation to resample, and the
script is better documented in the R-click help to
the "tcl:" entry.

The default is now to *not* to go all the way to
making single-subject AFNI 3D ROIs, but instead,
only to resample the selected fsaverage annotation
to the current subject.  A tickbox on the pop-up
enables the adjustable parameters (e.g., normal
search limits) for making the AFNI 3D ROIs.


Display .annot file as colored ribbon on 2D slice

The SURFPAINT panel on the large [fn]-F4 interface
of tkmedit can display an MGH annotation as a
colored ribbon on a 2D slice.  This extends the
previous facilities for displaying curvature
(curv, sulc) and fieldsign as a colored cortical
ribbon on a 2D slice.  Any .annot file in the
current subject's label directory will be loaded
into the "annot:" dropdown.

A new "an:" entry (just right of SURFPAINT),
allows displaying only one annotation region
(picked by its idnum) at a time.  To find the
idnum of an annotation region, display all the
regions on the surface in tksurfer and
double-middle-click one to get a pop-up.  A
complete table of idnums (and their names and
colors) is also printed in the tkmedit log when
the annotation file is first read.

The cursor will move to the average position of
surface vertices in this annotation region.

The default is -1, which means, show all
annotation regions.  Region 0 is Unknown.  A
too-high idnum shows all regions.


De-mean and variance-normalize vtx .val data

An alternate middle-click on the "R" button on the
"val:" line reads vertexwise data into the
.val field, (like a default left-click on "R"),
but then also subtracts the mean and divides by
the standard deviation using the C/tcl function:

  demean_varnorm_val

That operation only applies to currently visible
(uncut) data, so that the mean and stdev can be
constrained to any surface region.

A related function is:

  meanamp2one_valval2

which scales the average complex amplitude of
displayed complex data to 1.



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

tkregister.c doesn't biff existing register.dat w/tkregister 1.mgz 2.mgz

better logic for REDRAW button turn on/off stereo viewing

better err/explain Mac10.11+ env problems w/tksurfer etc in Mac shell script


##########################################################################
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
--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/scripts: 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]

##########################################################################
PREVIOUS 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 convergent stereo
--tksurfer.c: add/export convergentflag for convergent stereo
--tksurfer.tcl: middle-click REDRAW toggles stereoflag
--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 helpfiles to All Help Contents
...




