JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for FSL Archives


FSL Archives

FSL Archives


FSL@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

FSL Home

FSL Home

FSL  June 2013

FSL June 2013

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: beta series correlation

From:

wolf zinke <[log in to unmask]>

Reply-To:

FSL - FMRIB's Software Library <[log in to unmask]>

Date:

Thu, 6 Jun 2013 16:19:20 +0200

Content-Type:

multipart/mixed

Parts/Attachments:

Parts/Attachments

text/plain (142 lines) , SglEvFsf (1 lines)

Hi,

Here is the post to the bigfsf script 
(https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=FSL;347a7573.1112), and 
attached my modification of it (this was work in progress, and for sure 
i can't promise that it is working correctly!). It requires, as Michael 
mentioned, to create an fsf template containing everything but the 
information about EVs and contrasts. My modification assumes, that 
events are numbered, so it was specifically tailored to what i needed. I 
was able to run initial tests, but feat_model crashed after using too 
many EVs - so apparently there still is some severe issue with my 
script. But maybe it gives you together with the Jim Porter's original 
version some ideas how to tackle the handling of large number of EVs.

Since I wanted just to test some different approach, i disregarded it 
after running into problems, because it was starting to create more work 
load when this test was worth it to me.

But thanks, Michael, for sharing that you have been able to run an 
analysis with a sufficient large number of EVs - so maybe with this in 
mind I will give it another shot when I have some spare time.

wolf

On 06/06/2013 03:16 PM, Tony Jiang wrote:
> Thanks Wolf and Steve.
> The Ram shouldn't be an issue. I have just installed 24G memory in my linux box. models should be fine as they are independent from each other. I think this might be the way of how GUI load a feat model from a file. I noticed the GUI behaves differently if you manually enter the EVs compared with loading them from a file. It could be the way i create the fsf files though. I will do a line-by-line check.
>
>
> Wolf, what appraoch did you end up with? I am very interested to learn how you handled this differently.
>
> Best,
> Tony
> ________________________________________
> From: FSL - FMRIB's Software Library [[log in to unmask]] on behalf of Stephen Smith [[log in to unmask]]
> Sent: Thursday, June 06, 2013 7:40 AM
> To: [log in to unmask]
> Subject: Re: [FSL] beta series correlation
>
> Hi - apart from any GUI display size issues, the only problems with large numbers of EVs should be if:
>
> - the model/analysis is then too large for your RAM/swap/etc.
>
> - the model becomes mathematically illegal - e.g. too many EVs given the number of timepoints, or having other rank deficiency problems.
>
> Cheers.
>
>
>
>
>
>
> On 6 Jun 2013, at 12:36, wolf zinke <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>
> Hi,
>
> I once tried to create automatically fsf files with a modifed version of the Bigfsf script posted by Jim Porter on this list a while ago. I also run into this Newmat issue and tried to figure out, when this problem occurs. If I remember correctly, it started after 32 EVs. Unfortunately, I gave up this approach, and thus did not dig depper into it. Bit I am also interested to learn about possible limitations in the number of EVs, and if there is a way to circumvent this problem.
>
> cheers,
> wolf
>
> On 06/06/2013 12:11 AM, Tony Jiang wrote:
> Hi, Michael
>
> Thanks for the suggestions. Do you know if there is a limit of the number of EVs feat can handle?  I tried to include 20 EVs in the GLM and it ran fine. But once i put in 50 EVs (to estimate the first 50 trial's beta), feat_model threw an error of NEWMAT::INDEXEXCEPTION.
>
> I have double checked the .fsf file and dont see anything wrong here except the GLM has way too many EVs so the GUI can't display all the columns very well.
>
> Any sugestions?
> Thanks,Tony
>
>
>
> ________________________________________
> From: FSL - FMRIB's Software Library [[log in to unmask]<mailto:[log in to unmask]>] on behalf of Harms, Michael [[log in to unmask]<mailto:[log in to unmask]>]
> Sent: Wednesday, June 05, 2013 1:00 PM
> To: [log in to unmask]<mailto:[log in to unmask]>
> Subject: Re: [FSL] beta series correlation
>
> If you can create the .fsf file using scripts, then just skip the Feat GUI
> entirely and run
> feat design.fsf
> at the command line.
>
> cheers,
> -MH
> --
> Michael Harms, Ph.D.
>
> -----------------------------------------------------------
> Conte Center for the Neuroscience of Mental Disorders
> Washington University School of Medicine
> Department of Psychiatry, Box 8134
> 660 South Euclid Ave.           Tel: 314-747-6173
> St. Louis, MO  63110                    Email: [log in to unmask]<mailto:[log in to unmask]>
>
>
>
>
> On 6/5/13 11:23 AM, "Tony Jiang" <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>
> Dear All,
>
> I was wondering if there is a quick dirty trick to run beta series
> correlation in Feat.  My data has over 100 trials so I am trying to get
> an estimate of 100+ betas for each trial. but setting this up in Feat
> seems to overwhelm the GUI? I can create the .fsf file using scripts then
> if I load it to Feat GUI, it will take forever to load the model if i
> click on Full Model Setup.
>
> any suggestions are welcome!
>
> ________________________________
> The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
>
> Kessler Foundation is proud to be recognized as one of the Best Places to Work in New Jersey.
>
> The information in this transmission is intended for official use of the Kessler Foundation.  It is intended for the exclusive use of the persons or entities to which it is addressed.  If you are not an intended recipient or the employee or agent responsible for delivering this transmission to an intended recipient, be aware that any disclosure, dissemination, distribution or copying of this communication, or the use of its contents, is strictly prohibited.  If you received this transmission in error, please notify the sender by return e-mail and delete the material from any computer.
>
>
>
> ---------------------------------------------------------------------------
> Stephen M. Smith, Professor of Biomedical Engineering
> Associate Director,  Oxford University FMRIB Centre
>
> FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
> +44 (0) 1865 222726  (fax 222717)
> [log in to unmask]<mailto:[log in to unmask]>    http://www.fmrib.ox.ac.uk/~steve
> ---------------------------------------------------------------------------
>
> Stop the cultural destruction of Tibet<http://smithinks.net>
>
>
>
>
>
> Kessler Foundation is proud to be recognized as one of the Best Places to Work in New Jersey.
>
> The information in this transmission is intended for official use of the Kessler Foundation.  It is intended for the exclusive use of the persons or entities to which it is addressed.  If you are not an intended recipient or the employee or agent responsible for delivering this transmission to an intended recipient, be aware that any disclosure, dissemination, distribution or copying of this communication, or the use of its contents, is strictly prohibited.  If you received this transmission in error, please notify the sender by return e-mail and delete the material from any computer.




#!/bin/bash # # SglEvFsf # # created: 09.04.2013 # by zinke # Usage() { cat << EOF Usage: $0 <fsfbase> <subjlst> <runlst> <evpathtemplate> <evstems> [options] This function replaces defined patterns in the .fsf <fsfbase> file and reads in a set of event files <evstems> according to the <evpathtemplate>. replacement patterns: subject name - XXsubjXX run number - XXrunXX - as run0# if #<10 run number - XXrnumXX - as run# run number - XXrrrXX - as r# it expects that the event files are in three collumn format ('set fmri(shape1) 3') and applies convolution with a gamma HRF, temporal filtering and temporal derivative. Modified from the MakeBigfsf script of Jim Porter. OPTIONS: -ext event file extension (default: .ev) -dir Output directory for the .fsf files -m alternative mask file -ev additional event files to be included ########################################################### ## (c) wolf zinke (2013) - part of the MaFIA toolbox ## ## > MAcaque Functional Image Analysis < ## ## for comments and questions: [log in to unmask] ## ########################################################### EOF exit 1 } if [ $# -lt 4 ]; then Usage else fsffl=$1 subjlst=$2 runlst=$3 evpathtmpl=$4 evstems=$5 shift 4 fi #__________________________________________________________________________________________# evext=".ev" wrtdir=`pwd` maskfl="" addevs="" while [ $# -gt 0 ] ; do case $1 in -m) maskfl=$2 shift 2 ;; -dir) wrtdir=$2 shift 2 ;; -ext) evext=$2 shift 2 ;; -ev) addevs="$2" shift 2 ;; -*) echo "Wrong option: <$1>" echo "" Usage ;; *) break ;; esac done #__________________________________________________________________________________________# if [ ! -d $wrtdir ]; then mkdir $wrtdir fi flstem=`echo $fsffl | cut -d. -f1` # get rid of the fsf extension for later renaming for cs in $subjlst do echo -n "$cs" for cr in $runlst do echo -n " $cr" #__________________________________________________________________________________________# # Edit the fsf file to match the curren subject/run dateXchng='sed' dateXchng=`echo "$dateXchng -e 's/XXsubjXX/$cs/g'"` dateXchng=`echo "$dateXchng -e 's/XXrrrXX/r$cr/g'"` dateXchng=`echo "$dateXchng -e 's/XXrnumXX/run$cr/g'"` if [ $cr -lt 10 ] then dateXchng=`echo "$dateXchng -e 's/XXrunXX/run0$cr/g'"` else dateXchng=`echo "$dateXchng -e 's/XXrunXX/run$cr/g'"` fi cstem="${wrtdir}/${flstem}_${cs}_${cr}" cfl="$cstem.fsf" fsfXchng=`echo "$dateXchng $fsffl > $cfl"` eval $fsfXchng evpathXchng=`echo "echo $evpathtmpl | $dateXchng"` cevpath=`eval $evpathXchng` #__________________________________________________________________________________________# # check number of volumes and adjust if required nvol=`cat $cfl | grep 'set fmri(npts)' | cut -d " " -f3` dtfl=`cat $cfl | grep 'set feat_files(1)' | cut -d\" -f2` fvol=$nvol if [ `imtest $dtfl` -eq 1 ] then fvol=`fslnvols $dtfl` fi if [ $nvol -eq $fvol ] then echo "feat $cfl" >> run_feat else echo " >>>> Data file differs in number of volumes:" echo " $fvol instead of $nvol" echo "# feat $cfl # different number of volumes ($fvol)!" >> run_feat cln=`cat $cfl | grep 'set fmri(npts)'` nvxchng=`echo "sed -e 's/$cln/set fmri(npts) $fvol/g' $cfl > ${cfl}_tmp"` eval $nvxchng mv ${cfl}_tmp $cfl fi #__________________________________________________________________________________________# # get total number of events nEVS=0 for cev in $evstems do ccnt=$(ls $cevpath/${cev}*$evext | wc -w) nEVS=$(echo "$nEVS + $ccnt" | bc -l) done # ngrps=$(echo "$evstems" | wc -w) # nCONS=$(echo "$nEVS + $ngrps" | bc -l) % if additional contrast combining all event types are implemented nCONS=$nEVS nreal=$((${nEVS}+${nEVS})) #__________________________________________________________________________________________# # set general information about the events and contrasts echo "" >> $cfl echo "set fmri(evs_orig) ${nEVS}" >> $cfl echo "set fmri(evs_real) $nreal" >> $cfl echo "set fmri(evs_vox) 0" >> $cfl echo "set fmri(ncon_orig) ${nCONS}" >> $cfl echo "set fmri(ncon_real) ${nCONS}" >> $cfl echo "set fmri(nftests_orig) 0" >> $cfl echo "set fmri(nftests_real) 0" >> $cfl #__________________________________________________________________________________________# # set specifications for each event evcnt=0 for cev in $evstems do cevlst=$(ls $cevpath/${cev}*$evext) ccnt=0 for cevfl in $cevlst do evcnt=$(($evcnt+1)) ccnt=$(($ccnt+1)) echo -n "${cev}${ccnt}" echo "" >> $cfl echo "set fmri(evtitle$evcnt) \"${cev}${ccnt}\"" >> $cfl echo "set fmri(shape$evcnt) 3" >> $cfl echo "set fmri(convolve$evcnt) 2" >> $cfl echo "set fmri(convolve_phase$evcnt) 0" >> $cfl echo "set fmri(tempfilt_yn$evcnt) 1" >> $cfl echo "set fmri(deriv_yn$evcnt) 1" >> $cfl echo "set fmri(custom$evcnt) \"$cevfl\"" >> $cfl echo "set fmri(gammasigma$evcnt) 3" >> $cfl echo "set fmri(gammadelay$evcnt) 6" >> $cfl echo "" >> $cfl for A in `seq 0 ${nEVS}`; do echo "set fmri(ortho$evcnt.${A}) 0" >> $cfl done # for R in `seq 1 ${nINPUTS}`; do # VAL=$(head -n ${R} ${XMAT} | tail -1 | awk '{print $'$evcnt'}') # echo "set fmri(evg${R}.$evcnt) ${VAL}" >> $cfl # done echo "" done done #__________________________________________________________________________________________# # set specifications for the contrasts echo "" >> $cfl echo 'set fmri(con_mode_old) orig' >> $cfl echo 'set fmri(con_mode) orig' >> $cfl # contrast real evcnt=0 for cev in $evstems do cevlst=$(ls $cevpath/${cev}*$evext) ccnt=0 for cevfl in $cevlst do evcnt=$(($evcnt+1)) ccnt=$(($ccnt+1)) echo "" >> $cfl echo "set fmri(conpic_real.$evcnt) 1" >> $cfl echo "set fmri(conname_real.$evcnt) '${cev}${ccnt}'" >> $cfl cpos=`echo "(2*$evcnt)-1" | bc -l` for C in `seq 1 $nreal` do if [ $cpos -eq $C ] then echo "set fmri(con_real$evcnt.${C}) 1" >> $cfl else echo "set fmri(con_real$evcnt.${C}) 0" >> $cfl fi done done done # contrast orig evcnt=0 for cev in $evstems do cevlst=$(ls $cevpath/${cev}*$evext) ccnt=0 for cevfl in $cevlst do evcnt=$(($evcnt+1)) ccnt=$(($ccnt+1)) echo "" >> $cfl echo "set fmri(conpic_orig.$evcnt) 1" >> $cfl echo "" >> $cfl echo "set fmri(conname_orig.$evcnt) '${cev}${ccnt}'" >> $cfl for C in `seq 1 ${nEVS}` do if [ $evcnt -eq $C ] then echo "set fmri(con_orig$evcnt.${C}) 1" >> $cfl else echo "set fmri(con_orig$evcnt.${C}) 0" >> $cfl fi done done done #__________________________________________________________________________________________# # set specifications for the F tests (unsed) # # echo Setting F-test values... # for C in `seq 1 ${nFTESTS}`; do # for R in `seq 1 ${nCONS}`; do # VAL=$(head -n ${R} ${FMAT} | tail -1 | awk '{print $'${C}'}') # echo 'set fmri(ftest_real'${C}'.'${R}') '${VAL} >> $cfl # done # done #__________________________________________________________________________________________# # set specifications for the F tests (unsed) # Contrast masking is ususally easier to setup via the GUI. # Just set all to 0, and do it by hand later if desired. echo "" >> $cfl echo "set fmri(conmask_zerothresh_yn) 0" >> $cfl # echo "set fmri(conmask1_1) 0" >> $cfl for A in `seq 1 ${nCONS}` do for B in `seq 1 ${nCONS}` do if [ ! $A -eq $B ] then echo "set fmri(conmask${A}_${B}) 0" >> $cfl fi done done echo "set fmri(conmask1_1) 0" >> $cfl #__________________________________________________________________________________________# # set the hidden options echo "" >> $cfl echo "set fmri(alternative_example_func) \"\"" >> $cfl echo "set fmri(alternative_mask) \"$mask\"" >> $cfl echo "set fmri(init_initial_highres) \"\"" >> $cfl echo "set fmri(init_highres) \"\"" >> $cfl echo "set fmri(init_standard) \"\"" >> $cfl echo "set fmri(overwrite_yn) 0" >> $cfl done # for cs in $subjlst done # for cr in $runlst feat_model $cstem

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager