Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
=== Setting up Xgrid ===
In Progress...

=== Organizing Your Data ===
In order to use these script, you first need to organize your data into folders. Each folder should be named for the participant that you wish to analyze (e.g. Subj001). Inside each folder, place the NIFTI or MGZ file for their T1-weighted high-res anatomical image, also named after the subject (e.g. Subj001.nii). Your folder structure should look something like this:

{{{
-Subj001
---Subj001.nii
-Subj002
---Subj002.nii
-Subj003
---Subj003.nii
}}}

Line 9: Line 25:
To begin, copy the script example below and save the file somewhere handy. Call the file xgridFS_submit.sh. To begin, copy the script example below and save the file alongside your participant folders as xgrid_freesurfer.sh. Once saved, chmod +x the file to make it executable.
Line 31: Line 47:
At the most basic level, you can submit each folder individually using the following syntax:
{{{
xgrid -h <your xgrid controller> -p <your xgrid password> -job submit -in Subj001 xgrid_freesurfer.sh Subj001.nii
}}}

However you can also automate this process using a script, a Ruby script below can do this. I suggest saving this script alongside the xgrid_freesurfer.sh script.

{{{
#!/usr/bin/ruby

puts "Xgrid submission application for Freesurfer";

ARGV.each{|x|
    puts "xgrid -h <your xgrid controller> -p <password> -job submit -in #{x} xgrid_freesurfer #{x}.nii"
    system("xgrid -h <your xgrid controller> -p <password> -job submit -in #{x} xgrid_freesurfer #{x}.nii");
}
}}}

Using Freesurfer on Apple Xgrid


Under development.


Freesurfer jobs can be run on the XGrid. The advantage of this approach is that you can submit hundreds of jobs to run and the controller will automatically allocate each freesurfer instance to an available processor. This will maximize processing power and get the total number of jobs completed in the least amount of time.

Setting up Xgrid

In Progress...

Organizing Your Data

In order to use these script, you first need to organize your data into folders. Each folder should be named for the participant that you wish to analyze (e.g. Subj001). Inside each folder, place the NIFTI or MGZ file for their T1-weighted high-res anatomical image, also named after the subject (e.g. Subj001.nii). Your folder structure should look something like this:

-Subj001
---Subj001.nii
-Subj002
---Subj002.nii
-Subj003
---Subj003.nii

Generic Script

To begin, copy the script example below and save the file alongside your participant folders as xgrid_freesurfer.sh. Once saved, chmod +x the file to make it executable.

export NO_FSFAST=1

#setup Freesurfer
export FREESURFER_HOME=/usr/local/freesurfer
#source $FREESURFER_HOME/SetUpFreeSurfer.sh
. $FREESURFER_HOME/SetUpFreeSurfer.sh

SUBJECTS_DIR=$(pwd)

for FS in $*
do
   subjectID=$(/bin/echo $FS | /usr/bin/sed 's/.nii//')
   recon-all -s $subjectID -i $FS -all
done

Submitting Jobs

At the most basic level, you can submit each folder individually using the following syntax:

xgrid -h <your xgrid controller> -p <your xgrid password> -job submit -in Subj001 xgrid_freesurfer.sh Subj001.nii

However you can also automate this process using a script, a Ruby script below can do this. I suggest saving this script alongside the xgrid_freesurfer.sh script.

puts "Xgrid submission application for Freesurfer";

ARGV.each{|x|
    puts "xgrid -h <your xgrid controller> -p <password> -job submit -in #{x} xgrid_freesurfer #{x}.nii"
    system("xgrid -h <your xgrid controller> -p <password> -job submit -in #{x} xgrid_freesurfer #{x}.nii");
}

XgridNotes (last edited 2012-06-21 09:46:15 by 128)