Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, 21 December 2011

Batching FSL tools and utilities using Applescript and bash script "2" (SIENAX)

This script has been written to automate and simplify SIENAX tool (FSL) without writing any command line. User only needs to specify data directory and to select options at the beginning. To download this script please click on the following link


I wrote a bash script to automate and simplify SIENAX tool. It works on both Linux and MAC, user needs to copy script to data directory and execute it from there. This script works on bash shell only where it can be executed using "chmod +x" command as following;

chmod +x sienax_bash.command or chmod +x sienax_bash.sh
Bash script


SIENAX estimates total brain tissue volume, from a single image, normalised for skull size. It calls a series of FSL programs: It first strips non-brain tissue, and then uses the brain and skull images to estimate the scaling between the subject's image and standard space. It then runs tissue segmentation to estimate the volume of brain tissue, and multiplies this by the estimated scaling factor, to reduce head-size-related variability between subjects.




Please leave your feedback if you like this tool or a suggestion if you think it needs to be improved!



Related links

Thursday, 17 March 2011

Using bash script to convert freesurfer stats2table (asegstats2table & aparcstats2table)

At the previous entry, I presented how we can use applescript to control asegstats2table and aparcstats2table commands in order to generate text/ascii tables of freesurfer stats data for all subjects in the directory at once. At this entry I will show how we can write a bash script to control both asegstats2table and aparcstats2table commands. This bash script can be used in both Mac OS X and Linux.





freesurferstats2table_bash.zip



The following script uses aparcstats2table and asegstats2table to extract cortical thickness, surface area and volume of manually defined regions of interest using stats files that resulted from qdec.



http://surfer.nmr.mgh.harvard.edu/fswiki/freesurferstats2table

Please leave your feedback if you like this tool or a suggestion if you think it needs to be improved!



Related links

Tuesday, 1 March 2011

Multiple DICOM to NIfTI converter using dcm2nii and AppleScript



dcm2nii is used to convert from DICOM format to various data format such as; 
Compressed 4D NIfTI nii.gz, 4D NIfTI nii, 3D NIfTI hdr/img and 3D Anlyze hdr/img. Or even it modify NIfTI format. There are two versions; the dcm2niigui and command line dcm2nii. This software was written by Dr. Chris Rorden. It can be downloaded with mricron package;
(http://www.cabiatl.com/mricro/mricron/install.html), 
where mac version link is;
For more information about dcm2nii please visit 
MAC gui version is user friendly but it can convert one data set at a time. Therefore, I wrote an applescript to convert multiple DICOM data sets to NIfTI/Analyze format at one instance using dcm2nii command.


Click below to download script
Multiple dcm2nii converter

For converting Nifti to Analyze and vice versa please visit the following entry;
http://www.easyneuroimaging.com/2012/01/batching-fsl-tools-and-utilities-using.html

And for splitting compressed or single images please visit the following entry;
http://www.easyneuroimaging.com/2011/12/batching-fsl-tools-and-utilities-using.html




Bash script works on both Linux and MAC.
user needs to copy this script to data directory and execute it from there using chmod +x to make it executable as following;
chmod +x dicom2nii.command or chmod +x dicom2nii.sh 
If you will use dicom2nii.command file copy it to your subjects' directory then execute it using dicom2nii.command. dicom2nii.sh you can do the same thing but you cant double click dicom2nii.sh.
Note: If mricron directory is not **** /Applications/mricronmac ****
Please do not forget to change it in **dicom2nii.command**  or  **dicom2nii.command** using any text editor



Please leave your feedback if you like this tool or a suggestion if you think it needs to be improved!