User:Jadrian Miles

From VrlWiki
Jump to navigation Jump to search

I started my PhD in CS at Brown in Fall 2006. I work on data processing, measurement, and model reconstruction from diffusion MRI of the brain.

You can find me elsewhere online:

There are a number of directories related to me on the CS filesystem, all of which are linked from file:///map/gfx0/users/jadrian

Personal Documents

Draft pages / notes

Nifty code snippets

  • Generate a random filename from the command line:
    set tmpfile=/tmp/`head -q -c 8 /proc/sys/kernel/random/uuid`
  • Convert stdin to lowercase on stdout:
    tr '[A-Z]' '[a-z]'
  • Rename files into consecutive zero-padded integers in bash:
    let i=0; for f in *.JPG; do mv $f `printf "%04d" $i`.jpg; let i++; done
  • Test for host availability in tcsh (for loop demo; see here for bash example):
foreach h ( `cat hostlist` )
  ssh $h uname -n
end

First, figure out the size of the bounding box:

 gs -q -dBATCH -dNOPAUSE -sDEVICE=bbox orig.pdf 2>&1 | grep -v HiRes
%%BoundingBox: 134 158 471 715
...

The resulting bounding box is in the form B_x B_y T_x T_y, where B and T are the coordinates of the bottom and top corners, respectively, measured in points. The bounding box lies on a page of a certain size. One point is 1/72", so letter size is 612x792pt. In this case, we'd like to leave a 10pt margin on all sides. That means offsetting the page down and left by 124x148pts, and then cropping to a page size of (471-134)+20=357pts wide and (715-158)+20=577pts tall. The command is:

 gs -o cropped.pdf -sDEVICE=pdfwrite -g3570x5770 -c "<</PageOffset [-124 -148]>> setpagedevice" -f orig.pdf

Note that the argument to -g is in tenths of a point.

  • Recache TeX search paths:
    sudo mktexlsr
  • Perceptually uniform random coloring in Matlab
C = makecform('lab2srgb');
plot3(X,Y,Z,'Color', applycform([50+rand*50, -100+rand*200, -100+rand*200], C));
  • Recursively download a website using wget (see the man page for more)
    wget -r -np -nH http://www.site.com/subdir
  • Recursively download a remote directory via SSH, preserving modification times (note the trailing slash on the remote directory!):
    rsync -ra -e ssh <server>:<dir>/ <local_path>

Bookmarks

Tutorials

Miscellaneous notes

  • High b sensitizes to short length scale (Assaf & Cohen 1998, 2000).
  • The cingulum bundle looks like a long, skinny tube (that wraps around the top and back of the CC) in a gross segmentation, and fibers run along the long axis of this tube for most of this length. Their projections into the GM, though, are actually along the side of the tube, on mid-sagittal gyri. This is a really weird shape when it comes to inferring fiber paths from the bundle shape, so it should be a smoke test for any proposed system.
  • Sculpture might be a good choice for the second outside minor course. 3D reasoning, malleable shapes...