1. About Scraper

Attached is a python script which scrapes ( parses ) all the tutorial wiki pages and just outputs the command lines in them. This is useful for tutorial testers because they can just execute these scripts instead of copying and pasting every command.

To be easy for the scraper ( as well as the tutorial takers), any commands you want them to copy-paste should be enclosed in the following structure:

----
{{{
<command 1>
<command 2>
...
}}}
----

2. Installation and Running

Just copy scraper.py to a new directory ( name the directory scraper), give it execute permission ( chmod +x scraper.py ) and run it like

$./scraper.py
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/OutputData?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/GroupAnalysis?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/QdecGroupAnalysis?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/TroubleshootingData?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultiModalRegistration?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultiModalFmriIndividual?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultiModalFmriGroup?action=raw
scraping http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MultiModalDtiIndividual?action=raw

The output csh scripts are

AnatomicalROI.csh
GroupAnalysis.csh
MultiModalDtiIndividual.csh
MultiModalFmriGroup.csh
MultiModalFmriIndividual.csh
MultiModalRegistration.csh
OutputData.csh
QdecGroupAnalysis.csh
TroubleshootingData.csh

A sample script looks like the following:

$ cat OutputData.csh
#!/usr/bin/tcsh
set echo

tcsh
setenv TUTORIAL_DATA /media/disk

setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs
cd $SUBJECTS_DIR

tkmedit good_output brainmask.mgz lh.white \
        -aux T1.mgz -aux-surface rh.white \
        -segmentation aseg.mgz $FREESURFER_HOME/FreeSurferColorLUT.txt

tksurfer good_output lh inflated

Note: The names and count of the Tutorial wiki pages are bound to change


2011-06-02 10:38