###################################################################
UPDATE:  14 Jun 2021
###################################################################

----------------------------------------------
Basic tests on new Mac processor
----------------------------------------------

To run this MacOS 10-compiled binary on Mac0S 11,
you have to install Rosetta.  Some basic tests
suggests it works OK.  Once I get an M1 machine, I
will work on a native compile.

----------------------------------------------
Display data in subset of MGH annotation regions
----------------------------------------------

Once an MGH annotation has been loaded (with
left-click "D" on the "label:" line), a second,
alternate shift-R-click of the same "D" button
will generate a context-sensitive popup.

If no data overlay is present, the popup allows
picking a subset of annotation regions to display
(by idnum), for example, to show which region
subset you may be using for an analysis.

If a data overlay has been loaded, the requested
subset of areas will mask the data (i.e., will
only show data in listed areas).  This is useful,
for example, to see phase encoded data from
annotation regions (easier than when using colored
annotation borders, which partially overlap the
data)

----------------------------------------------
Extract single MGH annotation region to label
----------------------------------------------

A new function can extract a single MGH annotation
region along with any overlaid data to a label
(e.g., to edit it):

  write_annotcol_to_label <r> <g> <b>

Once an MGH annotation has been loaded (using the
"D" button), a shift-ctrl-R-click on the "label:"
line "W" button generates a single ASCII label
file from the currently clicked annotation region.

To pick which region to extract, first click it,
which loads its r,g,b values (into r,g,b fields
right of "MESH" button).

This also saves any displayed data currently in
the .val(.val2) into the label (else zero if none
displayed).

The label file is auto-named using the current
annotation region name, and is written into the
subject's label directory, for example:

  ~/label/rh-R_a9-46v_ROI.label

----------------------------------------------
New tksurfer entry to adj red in red/green curv
----------------------------------------------

A new (unlabeled, right) entry on the "cmid:" line
adjusts the brightness of the red in the red/green
curvature display.  For example, changing the
default (=1.0) to 0.80 will dim the red (sulcus),
which provides better luminance contrast for full
color illustrations, better conversion to B/W, and
better visibility for red-green colorblind.

----------------------------------------------
Better popup panel, functions for write_mgh_annot
----------------------------------------------

The pop-up panel for generating MGH annotation
files from an MGH-style color lookup table, and a
group of correspondingly-named individual-area
labels has been improved.

Here is an example of the format of the MGH-style
color lookup table:

  #id    region(=labelinfix)   R   G   B   A
  #-------------------------------------------- 0
  0 Unknown               0   0   0   0
  1 V1_lower              150 0   100 0
  2 V1_upper              150 0   120 0
  3 V2_lower              240 0   200 0
  4 V2_upper              240 0   220 0
  #--------------------------------------------

This is a small portion of the default LUT file:

  $CSURF_DIR/lib/lut/CsurfColorLUT.txt

The corresponding label files to be assembled
have to use the dash convention after the
hemisphere, and would look like this for the
right hemisphere (the same LUT file can be used
for both hemispheres):

  $SUBJECTS_DIR/fsaverage/label/rh-V1_lower.label
  $SUBJECTS_DIR/fsaverage/label/rh-V1_upper.label
  $SUBJECTS_DIR/fsaverage/label/rh-V3_lower.label
  $SUBJECTS_DIR/fsaverage/label/rh-VP_upper.label

You get the popup panel by ctrl-mid-clicking the
"W" on the "label:" line.

The new panel shows the the input ColorLUT file
(all *.txt files in $CSURF_DIR/lib/lut are loaded
into dropdown) and the output *.annot file (all
existing *.annot files in
$SUBJECTS_DIR/$subject/label are loaded into the
dropdown).

The default output *.annot name was changed to:

  $hemi.MY_ANNOT.annot

to avoid accidentally overwriting the label file
currently selected in the "label:" dropdown.

The function read_mgh_colorlut() now catches and
blocks duplicate annotation region id numbers or
duplicate region colors.

The function write_mgh_annot() now ignores missing
individual label files, omitting them from the
output annotation (the interface reports any
missing).



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

default NormSearch in Setup Funct panel now "frac" (80%)

alt mid-click-GOTO finds equivalent opposite hemi point (best for fsaverage)

"D" (display) MGH annotation generates name/regid/LUT-colors popup

ima2brik uses to3d EPI -tpattern => FROM_IMAGE, also ignores scans 101-109

input patch/surf names visible before start sphere/flatten

movies tcl scripts now interruptable

L-Shift select "patch:" to block auto-load (for using patch as surf mask)

script control of meshline thickness (for hi-res offline render)

xterm cover/uncover hack works less well, now used if Yosemite->HighSierra
(can still force w/csurf -hack)

added hacked recon-all for 7.1.1 to allow restart w/edited orig.mgz

new popup panel arrows/gradients control (R-click tick at bottom of "phc")

report/allow missing label files for MGH color LUT used by write_mgh_annot



##########################################################################
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 plain "D" warns missing file (vs. just log)
--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
--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)

##########################################################################
PREVIOUS UPDATE: 28 Jun 2020
##########################################################################

--csurf: fix bug in -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
...

