#################################################
#################################################
 This is the default template for UCSD NOTES
 files.  The functional and subject versions of
 this file ($session/image/scripts/NOTES and 
 $subject/scripts/NOTES) can be retrieved with
 Alt-n, or with the corresponding File->NOTES
 menus.  Ideally, paper scanning notes should be
 transcribed (and these lines deleted!!) at the
 time that a set of scan is first unpacked.
#################################################
#################################################



#################################################
1/1/01 -- struct scan example: 2 sagittal MPRAGEs
#################################################
# transcribe session notes from paper
flip avoid:    [vitamin E capsule right cheek!]
subject name:  [sabrina]
patient num:   [2517]
slice plane:   [SAG]
pixel size:    [1x1x1 mm]
slice count:   [160]

# backup raw data to CDROM
[CDROM made]

# add new subject to database
File -> New Subject

# copy raw files into blank subject dir
cd $SUBJECTS_DIR/sabrina/mri/orig
mkdir mprage1 mprage2
set rawftpdir = /tmp/cdrom17/sabrina
cp $rawftpdir/2517-2-*.ima mprage1
cp $rawftpdir/2517-3-*.ima mprage2

# basic surface reconstruction, sphere align
SubjectTools -> Setup Structural Scans
  [align MPRAGE's; sag->cor flip: -z y x]
SubjectTools -> Process/Create/Fix/Final (1 day)
  [Edit Segmentation, redo Create/Fix/Final]
SubjectTools -> Make Full Surface Cuts
SubjectTools -> Flatten Surface (1 day)
SubjectTools -> Register Surface (1 day)

# notes on state of reconstruction 
...
...
...
...


#################################################
1/1/01 -- funct scan session example: face/cars
#################################################
# add new session to database
File -> New Functional -> YYMMDDII

# setup notes
subject name:  [claudia]
video sets:    [upside down]
screen setup:  [Boynton w/foam nose blocker]
RF coil:       [small flex, placed low]
slice plane:   [COR]
stabilize:     [bite-bar]
misc:          [mprage default pos, not CHANGE'd]
backup:        [CDROM made]

# stimulus notes
  --retinotopy
  --polar angle

# run countem in raw directory to get bounds
-------------------------------------------------
1643-2  130  4 ->    133   512x512 imgs   530432
1643-3  130  134 ->  263   512x512 imgs   530432
1643-4  130  264 ->  393   512x512 imgs   530432
1643-5  130  394 ->  523   512x512 imgs   530432
1643-6  240  524 ->  763   256x256 imgs   137216
-------------------------------------------------

# set csh vars for cut/paste
newdefs
set patient = 1643
set session = 010930CF
set rawftpdir = /usr1/tmp/ftpscan/cdrom25/$session
set firstfunctnum = 2
set mpragenum = 6
set slices = 26
set slicenum = 6
set allreps = 130
set inplane = 3
set thickness = 4
set shiftmean = -61.6
# convention: {scannum}-{stimprog}/{type}-{rep}
set scandirlist = ( \
  1-facestim1/faces1-1 \
  2-facestim1/faces1-2 \
  3-facestim2/faces2-1 \
  4-facestim2/faces2-2 \
)

# link to raw funct data, copy only align scan
cd $FUNCTIONALS_DIR/$session/image
ln -s $rawftpdir raw
mkdir mprage
cp raw/$patient-$mpragenum-*.ima mprage

# mk scandirs, de-mosaic functs, conv to realbrik
@ goodreps = $allreps - 2
cd $FUNCTIONALS_DIR/$session/image
foreach scan ($scandirlist)
  mkdir `dirname $scan`
  thor0 raw/$patient-$firstfunctnum $slicenum \
    $goodreps $scan -no_int
  brik2BRIK $scan.brik $slices $goodreps \
    $inplane $thickness -rmident
  @ firstfunctnum++
  @ slicenum = $slicenum + $allreps
end

# cleanup CDROM'd raw data
rm -r $rawftpdir
echo "cdrom'd data rm'd `date`" > $rawftpdir-NOTE
cd $FUNCTIONALS_DIR/$session/image/mprage
rm $patient-$mpragenum-*.ima

