Unix Tutorial for Free Surfer Users Allison Stevens
- Slides: 77
Unix Tutorial for Free. Surfer Users Allison Stevens
What is Unix/Linux? • An operating system (like Windows and OS X) • Linux is the free, modifiable, and redistributable version of Unix • Why use it?
What is Unix/Linux? • An operating system (like Windows and OS X) • Linux is the free, modifiable, and redistributable version of Unix • Why use it? – power to write many scripts with many commands to work with lots of data – to use computer resources on the network efficiently, such as clusters
Getting Started Communicate with operating system through a “shell” or terminal window. For course-provided Linux computers: Double click Terminal icon on Desktop For Macs: Applications > Utilities > XQuartz (double click) Applications > Utilities > Terminal
Warm Up Type: date and hit enter.
Warm Up Type: date and hit enter. Should see. Mon Apr 2009 6 8: 05: 24 EDT
Warm Up Type: date and hit enter. Should see. Mon Apr 2009 Type: cal and hit enter. 6 8: 05: 24 EDT
Warm Up Type: date and hit enter. Should see. Mon Apr 6 8: 05: 24 EDT 2009 Type: cal and hit enter. Should see April 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Directories • Unix uses a hierarchical file system (think folders in Windows)
Directories • Unix uses a hierarchical file system (think folders in Windows) Home is like “My Computer”
Directories • Unix uses a hierarchical file system (think folders in Windows) Home is like “My Computer” Like “My Documents ”
Directories • Unix uses a hierarchical file system (think folders in Windows) Home is like “My Computer” Like “My Documents ” Like “My Photos”
Directories • Unix uses a hierarchical file system (think folders in Windows) Home is like “My Computer” Like “My Documents ” Like “My Photos” picture. jpg
Location path: /My. Computer/My. Documents/My. Photos Type: pwd /home/nmrclass and hit enter. Should see OR /Users/Your. Name shows “present working directory” or current location as a path
Opening a Directory • Not double clicking • Type command to “open” • Commands to open files will differ
Navigating Directories cd __ “change directory”: move into a folder ls ls __ “list”: see contents of directory
Navigating Directories cd __ “change directory”: move into a folder ls ls __ “list”: see contents of directory Desktop matlab tmp TUTORIAL_DATA
Anatomy of a Command command -option 1 –option 2 command - -help file
Anatomy of a Command command -option 1 –option 2 command - -help Try: ls --help file
Directory Contents • List contents of directory you are in ls ls -a ls -lrt lists names of directories/files
Directory Contents • List contents of directory you are in ls ls -a lists names of directories/files lists hidden files too ls -lrt . cshrc. bashrc. alias
Directory Contents • List contents of directory you are in ls ls -a ls -l lists names of directories/files lists hidden files too lists file details ls -lrt drwxrwx--user group others
Directory Contents • List contents of directory you are in ls ls -a ls -lrt lists names of directories/files lists hidden files too lists file details lists recent files last
Save Some Time Filename Completion hit Tab key should see ls Desktop History hit key should see ls Desktop hit enter
Changing Directories mkdir practice makes a new directory “practice” ls -lrt pwd should see cd practice pwd should see ls should see /home/nmrclass changes to directory “practice” /home/nmrclass/practice Nothing!
Changing Directories
Changing Directories mkdir stuff makes folder “stuff” inside practice ls should see “stuff”
Using an Editor emacs mynotes. txt If using a Mac: open -e mynotes. txt Type: I could write a script. File > Save (Buffer) File > Exit emacs ls should see “mynotes. txt” Format > Make plain text File > Save
Using an Editor gedit mynotes. txt If using a Mac: open -e mynotes. txt Type: I could write a script. File > Save (Buffer) File > Exit emacs ls should see “mynotes. txt” Format > Make plain text File > Save
Using an Editor
Copying files cp cp --help is the copy command learn all the options or “arguments” cp mynotes. txt stuff cd stuff ls more mynotes. txt
Copying files cp cp --help is the copy command learn all the options or “arguments” cp mynotes. txt stuff cd stuff ls less mynotes. txt
Changing Directories ls. . /. . shows one directory up goes up two! can also do (but don’t right now): on cd. . /. . pwd should see /home/nmrclass/practice/stuff
Copying / Moving files Could also use do: cp mynotes. txt myothernotes. txt mv hernotes. txt . .
Removing Files pwd ls should be in “stuff” rm mynotes. txt ls
Things to know • Case sensitive • Does not like spaces in file names (e. g. filename. txt vs. file name. txt) • • Ctrl+c kills a process & brings back command prompt Type ‘q’ to quit the program ‘less’ Highlight & middle click to copy & paste Use ‘&’ to open a program in the background Cannot open a 2 nd program if do not have a command prompt
Review • • no double clicking mkdir ls cd pwd emacs, gedit, vi, pico cp rm
Using Free. Surfer With Free. Surfer, certain variables must be set in order to use it correctly: FREESURFER_HOME tell Operating System where Free. Surfer is SUBJECTS_DIR tell Free. Surfer where data is
Required Variables • To use Free. Surfer you’ll have to do: setenv FREESURFER_HOME /home/apps/freesurfer tell Operating System where Free. Surfer is source $FREESURFER_HOME/Set. Up. Free. Surfer. csh source this script to get your computer ready to use Free. Surfer (sources other scripts & sets other variables) setenv SUBJECTS_DIR /path/to/data
Required Variables • To use Free. Surfer you’ll have to do: export FREESURFER_HOME=/home/apps/freesurfer tell Operating System where Free. Surfer is source $FREESURFER_HOME/Set. Up. Free. Surfer. csh source this script to get your computer ready to use Free. Surfer (sources other scripts & sets other variables) export SUBJECTS_DIR=/path/to/data
Required Variables setenv SUBJECTS_DIR /path/to/data To go to location of your data: cd $SUBJECTS_DIR $ means take the value of the variable
Required Variables setenv SUBJECTS_DIR /path/to/data To go to location of your data: cd $SUBJECTS_DIR aka cd /path/to/data $ means take the value of the variable
$ How ‘echo’ works: echo Allison is cool. To set a variable: setenv TEST_VARIABLE yourfirstname To check what a variable is set to: echo $TEST_VARIABLE
Required Variables With Free. Surfer, certain variables must be set in order to use it correctly: FREESURFER_HOME tell Operating System where Free. Surfer is SUBJECTS_DIR echo tell Free. Surfer where data is To check variables $FREESURFER_HOME echo $SUBJECTS_DIR
More Help http: //surfer. nmr. mgh. harvard. edu/fswiki/Fs. T utorial/Command. Line. Navigation Links on Wiki under “Unix Tutorial” Glossary of Unix commands
The End Good Luck!
Intro to Free. Surfer Jargon voxel surface volume vertex surface-based recon cortical, subcortical parcellation/segmentation registration, morph, deform, transforms (computing vs. resampling)
What Free. Surfer Does… Free. Surfer creates computerized models of the brain from MRI data. Input: T 1 -weighted (MPRAGE) 1 mm 3 resolution (. dcm) Output: Segmented & parcellated conformed volume (. mgz)
Intro to Free. Surfer Jargon voxel
Intro to Free. Surfer Jargon surface
Intro to Free. Surfer Jargon surface
Intro to Free. Surfer Jargon vertex
Recon “recon your data” …short for reconstruction …cortical surface reconstruction …shows up in command recon-all
Recon
Volumes orig. mgz T 1. mgz brainmask. mgz wm. mgz filled. mgz (Subcortical Mass)
Cortical vs. Subcortical GM cortical gm subcortical gm sagittal coronal
Cortical vs. Subcortical GM subcortical gm sagittal coronal
Parcellation vs. Segmentation (cortical) parcellation (subcortical) segmentation
Intro to Free. Surfer Jargon voxel surface volume vertex surface-based recon cortical, subcortical parcellation/segmentation registration, morph, deform, transforms (computing vs. resampling)
Free. Surfer Questions Search for terms and answers to all your questions in the Glossary, FAQ, or Free. Surfer Mailing List Archives
Registration Goal: to find a common coordinate system for the input data sets Examples: • comparing different MRI images of the same individual (longitudinal scans, diffusion vs functional scans) • comparing MRI images of different individuals
Inter-subject, uni-modal example target Flirt 612/13/2011 DOF subject Flirt 9 DOF Flirt 12 DOF
Linear registration: 6, 9, 12 DOF target subject Flirt 12 DOF 9 DOF 6
Linear registration: 6, 9, 12 DOF Flirt 6 dof 9 dof target subject Flirt 12 DOF
Linear registration: 6, 9, 12 DOF Flirt 6 DOF 9 target subject Flirt 12 DOF
Intra-subject, multi-modal example before spatial alignment after spatial alignment
before spatial alignment after spatial alignment
before spatial alignment after spatial alignment
Inter-subject non-linear example target CVS reg
Some registration vocabulary • Input datasets: – Fixed / template / target – Moving / subject • Transformation models – rigid – affine – nonlinear • Objective / similarity functions • Applying the results – deform, morph, resample, transform • Interpolation types – (tri)linear – nearest neighbor
Writing Scripts • Putting multiple commands together. • Automatically running a sequence of commands • Example: create a file named my_first_script. csh with the contents: #!/bin/csh setenv name Free. Surfer echo I love $name ! % chmod u+x my_first_script. csh %. /my_first_script. csh
Loops in Scripts • You can create loops, if statements, … • Example: create a file named my_first_loop. csh with the contents: #!/bin/csh foreach name (‘Bill Murray’ ‘Wes Anderson’) echo I love $name ! end
Inputs to Scripts • You can create take inputs from the command line • Example: create a file named my_first_IO. csh with the contents: #!/bin/csh echo The $0 command is called with $#argv parameters echo parameter 1 is $1 echo parameter 2 is $2
Required Variables • To use Free. Surfer you’ll have to do: setenv FREESURFER_HOME /home/apps/freesurfer tell Operating System where Free. Surfer is source $FREESURFER_HOME/Set. Up. Free. Surfer. csh source this script to get your computer ready to use Free. Surfer (sources other scripts & sets other variables) setenv SUBJECTS_DIR /path/to/data
Registration -align subjects -common space -reference points b/w subjects will be same transforms template deform morph warp compute resample
More Help alias e emacs man alias ls file* lists file 1, file 2, file 3 ls file[12] lists file 1 and file 2 but not file 3 command >>& file. txt save output to screen and errors in text file
- Stevens unix
- Stevens unix network programming
- Free surfer
- Seal surfer by michael foreman
- Unix tutorial ppt
- Surfer kriging
- Newton's 3 law
- Surfer
- Surfer
- Surfer
- Free
- Tksurfer
- Surfer
- Surfer
- Random surfer model
- Surfer's myelopathy
- Interpersonal skills in soul surfer
- Fermi surfer
- Fermi surfer
- Usc innovation
- Peace train cat stevens lyrics meaning
- Lake stevens school district
- Cs 541
- Smart and stevens cohabitation
- Bryn stevens
- Smart and stevens cohabitation
- Evelyn stevens marianismo
- Liesbet pluym
- Inge holsbeeks
- Stevens institute of technology
- Unmasking freemasonry
- Dave stevens palo alto networks
- Bison ranch sustainability
- Reel to reel institute
- Legge di stevens
- Implizit
- Robert stevens manchester
- Stevens johnson syndrome
- Sami yusuf nationality
- Olivia stevens death
- Marybeth murphy stevens institute
- Wally stevens
- Fromme423
- Dr lauren stevens
- Stevens school
- Stevens power law
- Serc stevens
- New frontiers beliefs
- Cat stevens hallelujah
- Allison janowski
- Allison tayler
- Takedown allison van diepen
- Now allison dean
- Avatrombopag
- Professor robert allison
- Allison fansler
- Allison lorenz
- Allison lackie
- King of all media
- Graham allison models
- Allison rislov
- Dr lee allison
- Jerry allison
- Allison rossett
- Htc grid mammography
- Holman frenia allison, p.c.
- Allison corbat
- Allison beth quillin
- Jerry allison
- Jerry allison
- Scenario examples
- Allison
- Allison bloodworth
- Allison morgan ts
- Allison maclaurin
- Allison mumbleau
- Allison
- Greatest lower bound and least upper bound