Dear David Gutman,
Thank you very much for your kind help.
Best Regards
venkateswaran
________________________________
From: FSL - FMRIB's Software Library on behalf of David Gutman
Sent: Mon 5/12/2008 1:47 PM
To: [log in to unmask]
Subject: Re: [FSL] Interfacing FSL commands in Perl
I use perl for most of my FSL commands-- the backtick operator ` ` is particulary useful, as well as the "system" command. I'd just google around to familiarize yourself with the syntax.
http://www.devdaily.com/blog/post/perl/use-backtick-operator-access-system-commands
something like
#!/usr/bin/perl
$FILE_MASK = "*DATAFILES*.nii.gz"; ## WHAT FILE MASK TO LOOK FOR
@FILES_TO_RUN = glob($FILE_MASK);
# FILES_TO_RUN now contains an array of files to process
for($i=0;$k<=$#FILES_TO_RUN;$i++) ## WILL CYCLE THROUGH ALL THE FILES
{
$statement = " bet $FILES_TO_RUN[$k] $FILES_TO_RUN[$k]" . "skullstripped -m -f .2";
system($statement);
}
Basically the above example would take every file in your current directory matching whatever pattern you hard code (or you can make this a paramter), run bet on it, and basically take the original file, output a file with the same name with .skullstripped at the end, and also create masks/etc.. To get really fancy you also need to learn regular expression matching to strip out the file extensions/etc... but this will at least get you started. IF your not that familiar with programming Perl, Regular expression matching is a huge task in and of itself.
DG
On Mon, May 12, 2008 at 1:28 PM, Rajagopalan, Venkateswaran <[log in to unmask]> wrote:
Dear All,
I am using FSL tools to do registration, segmentation etc for processing my subject's images. I would like to automate this processing steps using PERL. I don't have experience with perl, I am just a beginner in perl programming. Can anyone please tell me how I can interface or call commands like BET, FAST into Perl so that I can automate these processing steps for all my data.
Thanks in advance
Regards
venkateswaran
===================================
P Please consider the environment before printing this e-mail
Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).
Visit us online at http://www.clevelandclinic.org <http://www.clevelandclinic.org/> for
a complete listing of our services, staff and
locations.
Confidentiality Note: This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law. If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If
you have received this communication in error, please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy. Thank you.
--
David A Gutman, M.D. Ph.D.
Department of Psychiatry & Behavioral Sciences
Emory University School of Medicine
P Please consider the environment before printing this e-mail
Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.
Confidentiality Note: This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law. If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If
you have received this communication in error, please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy. Thank you.
|