###################################################################
LATEST EMAIL UPDATE: 04 Oct 2012
###################################################################

hi

I will update the distributions after I do more
testing to make sure I haven't broken anything.

Hi-res (0.5mm^3) csurf updates

I finally got MGH mris_inflate to work with hi-res 600K
vertex surfaces.  Their code is *extremely* optimized
for the standard size meshes derived from 1x1x1mm data.
It always stops inflating at a curvature criterion that is
too high for a hi-res surface (which on a per vertex basis
is smoother).  The *only* way to fix this was to increase
the neighborhood size (since the curvature criterion
couldn't be changed).  This causes the curvature to be
estimated over a larger region -- taking an extra 30 min
computation!).  Eventually, I will persuade the MGH guys
to add another option for "desired_rms_height".

After even more effort, however, I was not able to get the
MGH mris_make_surfaces to make a pial and white, which is
critical for estimating cortical thickness (mris_make_surfaces
reads the orig surface, brain.mgz, wm.mgz, and filled.mgz).
The problem could be the broken MGH code for reading the
pixel size out of the .mgz header -- all MGH .mgz files
made by MGH freesurfer have a pixel width of 0 in their
header!  If you use something else, their tkmedit bails...

So... after a crazy weekend of hacking, I fixed up the
stale read 3D images part of tksurfer.  You can now read
in up to three 3D image set into tksurfer in addition
to a surface (user interface added to the large, F3,
interface), and there is a 4th self-intersect-prevention
buffer generated online, and flags for consulting them
during SHRINK.  I have been using:

  brain.mgz  (made w/PD and refurbished tkstrip)
  filled.mgz (with my explicit cutting planes feedback)
  T2.mgz (quantitative T2*)

The pial algorithm samples the T1 data and tries to move
toward a particular value (e.g., 55) that characterizes
the pial surface.

That alone, however, results in bulges all over the place,
and opposite banks of the sulci bulging past each other,
esp.  with young subjects :-}

To avoid crossing sulci, the outwardly moving smoothwm
surface leaves a trail of where each vertex has been in
a 3D buffer.  This prevent-self-intersect buffer is then
consulted during shrink to stop the opposite bank surface
from interpenetrating I think mris_make_surfaces uses
something simliar, but I didn't look at it in detail.

To stop bulging across the midline and out the bottom of
the brainstem, a second volume, filled.mgz is consulted.
My refurbished old-style manual cutting planes are written
into filled.mgz with a darker color (so they are not used
to make the surface).  During shrink, *any* non-zero data
-- including the cutting planes -- stops the shrink force.

Finally, with quantitative T1 data, a real problem is the
dura under the cerebellum, which unlike in a T1-weighted
images is unfortunately the same color as the gray matter
of *both* the cerebral cortex and cerebellar cortex (i.e.,
the standard MGH algorithms actually rely on a T1-weighted
artifact).

Since we also generate a quantitative T2-star image that
does have a different color there, that bulge is now
stopped by reading in an consulting a third 3D volume.
The standard MGH pathway failed on these images at the
same point -- that is, after sampling from 0.8^mm3 data to
1x1x1mm).  This means that the Bayesian tissue classifier
was also fooled.

cheers,
marty

##############
UPDATE DETAILS
##############

### UPDATE: 04 Oct 2012
--compiled tcltktix on Linux, not yet pasted into FreeSurfer0.8
--tk{med,reg,surf,strip}.c: intercept wm close GL win event w/testclose
--tkmedit.c: mv startup GLwin to right for interface onscreen (441 + 10 + 1024)
--tkmedit.c: correct (ignored on read) ORIENT_SPECIFIC in write ROI/regsubsamp
--tkmedit.c: fix all3+zoomflag curs drawslice/drawslice2 (revert:rm zoomflag=1)
--tkmedit.c,tcl: fix draw_surf/updnslice w/all3+zoomflag (HOR:scaletrough->thk)
--tkmedit.tcl: unset all3views unsets/hides zoomflag (no non-3views zoom)
--tkmedit.c: max intens all3flag shows planefocus, stop tkwin jump Mac resize
--tksurfer: Linux: don't raise GL win if just Expose event (was irritating)
--tkmedit.c: 512^3 fix: piecewise lin norm, write_regsubsamp_stat, write_roi
--calcimg.c: simple average, subtract, divide :-}
--csurf/fill.c: add opt -clipfeedback, def changed to 0, add to ExpertPrefs
--csurf: RH/LH fill color in ExpertPrefs WMFill, Surf tabs (same var, no edit)
--csurf: incr nbrs for hires inflate (long parm search, 15min/hemi), selecthemi
--csurf/wrappers.tcl: hotkey menuflash, menubind(was overridden)-> menuacceltxt
--tksurfer.c: read second mri data set (fix MRIloaded) (TODO: third/last)
--tksurfer.c: write_images .mgz, export write_self_images, tkstripshell->quads
--tksurfer.c: shrink: toggle/clear/test/write istilt self-intersect shell
--tksurfer.tcl: update SHRINK: add forcemode, flag/CLR/W selfinter, rm bot
--tksurfer.c: export read_images() -> read_images/read_images2, $inim/$inim2
--csurf: add interactive load inim2 (filled.mgz, no adjustable starttime load)
--wmfilter.c: fix gray line 1 pix from edge (zero SUBSAMPLE_BOUNDARY)
--tksurfer.c: im3/inim3/MRI3flag/MRI3loaded/chkthirdflag/chkthird_{hi,lo}lim
--tksurfer.tcl: add interactive load third 3D image set, ck3:lo,hi
--brik2cor.c: cmdline floatfac now combined with HEAD floatfac (if found)
--tk{surfer,medit,register}.c/.tcl: accept equals key as a plus (scale hotkey)
--csurf: 6 new help files for entries/buttons on main csurf interface
...




