From 0c91a0e2689c2badf3d1220be159f4b8f69d4022 Mon Sep 17 00:00:00 2001 From: Matthew Webster <mwebster@fmrib.ox.ac.uk> Date: Thu, 28 Sep 2006 14:03:42 +0000 Subject: [PATCH] quick detix from old melodic --- melodic.tcl | 152 +++++++++++++++++++--------------------------------- 1 file changed, 56 insertions(+), 96 deletions(-) diff --git a/melodic.tcl b/melodic.tcl index 3b380de..20a2033 100644 --- a/melodic.tcl +++ b/melodic.tcl @@ -3,9 +3,9 @@ # MELODIC - Multivariate Exploratory Linear Optimized Decomposition into # Independent Components # -# Christian Beckmann and Stephen Smith, FMRIB Image Analysis Group +# Christian Beckmann, Stephen Smith and Matthew Webster, FMRIB Image Analysis Group # -# Copyright (C) 2004 University of Oxford +# Copyright (C) 2006 University of Oxford # # TCLCOPYRIGHT @@ -31,32 +31,22 @@ wm iconbitmap $w @${FSLDIR}/tcl/fmrib.xbm frame $w.f -tixBalloon $w.bhelp -initwait 5000 -options { background \#b0ffb0 } - -#set fmri(font) [ tix option get font ] -#set fmri(bold_font) [ tix option get bold_font ] #}}} - tixNoteBook $w.nb - $w.nb add data -label "Data" - $w.nb add filtering -label "Pre-stats" - $w.nb add melodic -label "MELODIC" + NoteBook $w.nb -side top -bd 2 -tabpady {5 10} -arcradius 3 + $w.nb insert 0 data -text "Data" + $w.nb insert 1 filtering -text "Pre-stats" + $w.nb insert 2 melodic -text "MELODIC" #{{{ Data - -set fmri(dataf) [ $w.nb subwidget data ] - +set fmri(dataf) [ $w.nb getframe data ] #{{{ multiple analyses frame $w.multiple set fmri(multiple) 1 - -tixControl $w.multiple.number -label "Number of analyses " \ - -variable fmri(multiple) -step 1 -min 1 -selectmode immediate \ - -options { entry.width 3 } - +LabelSpinBox $w.multiple.number -label "Number of analyses " -textvariable fmri(multiple) -range " 1 10000 1 " -width 3 set fmri(level) 1 set fmri(analysis) 0 set fmri(inputtype) 2 @@ -70,15 +60,7 @@ pack $w.multiple.number $w.multiple.setup -in $w.multiple -side left -padx 5 #{{{ output directory set fmri(outputdir) "" - -FSLFileEntry $w.outputdir \ - -variable fmri(outputdir) \ - -directory $PWD \ - -label " Output directory" \ - -title "Name the output directory" \ - -width 35 \ - -filterhist VARS(history) - +FileEntry $w.outputdir -textvariable fmri(outputdir) -label " Output directory " -title "Name the output directory" -width 35 -filedialog directory -filetypes { } #}}} frame $w.datamain @@ -89,15 +71,11 @@ frame $w.nptsndelete #{{{ ndelete set fmri(ndelete) 0 - -tixControl $w.ndelete -label "Delete volumes " -variable fmri(ndelete) \ - -step 1 -min 0 -selectmode immediate -options { entry.width 3 } - -$w.bhelp bind $w.ndelete -msg "The number of initial FMRI volumes to delete before any further +LabelSpinBox $w.ndelete -label " Delete volumes " -textvariable fmri(ndelete) -range {0 200000 1 } -width 3 +balloonhelp_for $w.ndelete "The number of initial FMRI volumes to delete before any further processing. These should be the volumes that are not wanted because steady-state imaging has not yet been reached - typically two or three volumes." - #}}} pack $w.ndelete -in $w.nptsndelete -side left @@ -108,12 +86,9 @@ pack $w.ndelete -in $w.nptsndelete -side left frame $w.trparadigm_hp #{{{ TR - set fmri(tr) 3.0 -tixControl $w.tr -label "TR (s) " -variable fmri(tr) \ - -step 0.25 -min 0.001 -selectmode immediate -options { entry.width 4 } -$w.bhelp bind $w.tr -msg "The time (in seconds) between scanning successive FMRI volumes." - +LabelSpinBox $w.tr -label "TR (s) " -textvariable fmri(tr) -range {0.001 200000 0.25 } +balloonhelp_for $w.tr "The time (in seconds) between scanning successive FMRI volumes." #}}} pack $w.tr -in $w.trparadigm_hp -side left @@ -134,57 +109,39 @@ pack $w.logo -in $fmri(dataf) -anchor e -side bottom -padx 5 -pady 5 #}}} #{{{ Pre-statistics processing -set fmri(filteringf) [ $w.nb subwidget filtering ] +set fmri(filteringf) [ $w.nb getframe filtering ] set fmri(filtering_yn) 1 #{{{ motion correction -frame $w.mc +LabelFrame $w.mc -text "Motion correction: " set fmri(mcf) $w.mc - -global fmri(mc) -tixOptionMenu $w.mc.menu -label "Motion correction: " -variable fmri(mc) -$w.mc.menu add command 0 -label "None" -$w.mc.menu add command 1 -label "MCFLIRT" -set fmri(mc) 1 - -pack $w.mc.menu -in $fmri(mcf) -side top -side left - -$w.bhelp bind $w.mc -msg "You will normally want to apply motion correction; this attempts to +optionMenu2 $w.mc.menu fmri(mc) 0 "None" 1 "MCFLIRT" +pack $w.mc.menu +balloonhelp_for $w.mc "You will normally want to apply motion correction; this attempts to remove the effect of subject head motion during the experiment. MCFLIRT uses FLIRT (FMRIB's Linear Registration Tool) tuned to the problem of FMRI motion correction, applying rigid-body transformations." + +set fmri(mc) 1 + + #}}} #{{{ slice timing correction -frame $w.st +LabelFrame $w.st -text "Slice timing correction: " set fmri(stf) $w.st - set fmri(st) 0 - set fmri(st_file) "" -FSLFileEntry $w.st_file \ - -variable fmri(st_file) \ - -pattern "*" \ - -directory $PWD \ - -label "" \ - -title "Select a slice order/timings file" \ - -width 20 \ - -filterhist VARS(history) - -tixOptionMenu $w.st.menu -label "Slice timing correction: " -variable fmri(st) -command "melodic2:updatest $w" -$w.st.menu add command 0 -label "None" -$w.st.menu add command 1 -label "Regular up (0, 1, 2 ... n-1)" -$w.st.menu add command 2 -label "Regular down (n-1, n-2 ... 0)" -$w.st.menu add command 3 -label "Use slice order file" -$w.st.menu add command 4 -label "Use slice timings file" - -pack $w.st.menu -in $fmri(stf) -side top -side left - -$w.bhelp bind $w.st -msg "Slice timing correction corrects each voxel's time-series for the fact +FileEntry $w.st_file -textvariable fmri(st_file) -label "" -title "Select a slice order/timings file" -width 20 -filedialog directory -filetypes * + +optionMenu2 $w.st.menu fmri(st) -command "melodic2:updatest $w" 0 "None" 1 "Regular up (0, 1, 2 ... n-1)" 2 "Regular down (n-1, n-2 ... 0)" 5 "Interleaved (0, 2, 4 ... 1, 3, 5 ... )" 3 "Use slice order file" 4 "Use slice timings file" +pack $w.st.menu + +balloonhelp_for $w.st "Slice timing correction corrects each voxel's time-series for the fact that later processing assumes that all slices were acquired exactly half-way through the relevant volume's acquisition time (TR), whereas in fact each slice is taken at slightly different times. @@ -201,6 +158,7 @@ where the first line states which slice was acquired first, the second line states which slices was acquired second, etc. The first slice is numbered 1 not 0." + #}}} #{{{ BET brain extraction @@ -211,16 +169,18 @@ label $w.bet.label -text "BET brain extraction" set fmri(bet_yn) 1 checkbutton $w.bet.yn -variable fmri(bet_yn) -command "melodic2:updatebet $w" -$w.bhelp bind $w.bet -msg "This uses BET brain extraction to create a brain mask from the first +balloonhelp_for $w.bet "This uses BET brain extraction to create a brain mask from the first volume in the FMRI data. This is normally better than simple -intensity-based thresholding in order to remove unwanted -voxels in FMRI data. Note that here, BET is setup to run -in a quite liberal way so that there is very little danger -of removing valid brain voxels." +intensity-based thresholding for getting rid of unwanted voxels in +FMRI data. Note that here, BET is setup to run in a quite liberal way so that +there is very little danger of removing valid brain voxels. -set fmri(thresh) 10 +If the field-of-view of the image (in any direction) is less than 30mm +then BET is turned off by default." -tixControl $w.bet.thresh -label " Threshold % " -variable fmri(thresh) -step 1 -min 0 -max 100 -selectmode immediate -options { entry.width 3 } + +set fmri(thresh) 10 +LabelSpinBox $w.bet.thresh -label " Threshold % " -textvariable fmri(thresh) -range {0.0 100 1 } -width 3 pack $w.bet.label $w.bet.yn $w.bet.thresh -in $w.bet -side left @@ -228,14 +188,13 @@ pack $w.bet.label $w.bet.yn $w.bet.thresh -in $w.bet -side left #{{{ spatial filtering set fmri(smooth) 3 -tixControl $w.smooth -label "Spatial smoothing FWHM (mm) " \ - -variable fmri(smooth) -step 1 -min 0 -selectmode immediate +LabelSpinBox $w.smooth -label "Spatial smoothing FWHM (mm) " -textvariable fmri(smooth) -range {0.0 10000 1 } -width 3 -$w.bhelp bind $w.smooth -msg "This determines the extent of the spatial smoothing, carried out on -each volume of the FMRI data set separately. This is -intended to reduce noise without reducing interesting -signal; this is successful as long as the underlying -signal area is larger than the extent of the smoothing. +balloonhelp_for $w.smooth "This determines the extent of the spatial smoothing, carried out on +each volume of the FMRI data set separately. This is intended to +reduce noise without reducing interesting signal; this is successful as +long as the underlying signal area is larger than the extent of +the smoothing. To turn off spatial smoothing simply set FWHM to 0." @@ -252,7 +211,7 @@ checkbutton $w.temp.hp_yn -variable fmri(temphp_yn) set fmri(templp_yn) 0 -$w.bhelp bind $w.temp -msg " The high pass frequency cutoff point (in seconds) specifies +balloonhelp_for $w.temp " The high pass frequency cutoff point (in seconds) specifies the longest temporal period you will allow. \"Highpass temporal filtering\" uses a local fit of a @@ -262,7 +221,8 @@ is generally beneficial to remove global trends which will - if not removed - often dominate the decomposition." set fmri(paradigm_hp) 100 -tixControl $w.paradigm_hp -variable fmri(paradigm_hp) -step 5 -min 1 -selectmode immediate -options { entry.width 5 } +LabelSpinBox $w.paradigm_hp -textvariable fmri(paradigm_hp) -range {1.0 200000 5 } -width 5 + pack $w.temp.label $w.temp.hplabel $w.temp.hp_yn $w.paradigm_hp -in $w.temp -side top -side left @@ -273,12 +233,12 @@ pack $fmri(mcf) $fmri(stf) $w.bet $w.smooth $w.temp -in $fmri(filteringf) -ancho #}}} #{{{ Melodic -set fmri(melodicf) [ $w.nb subwidget melodic ] +set fmri(melodicf) [ $w.nb getframe melodic ] set fmri(varnorm) 1 checkbutton $w.varnorm -variable fmri(varnorm) -text "Variance-normalise timecourses" -$w.bhelp bind $w.varnorm -msg "When switched on, Melodic will rescale each time series so +balloonhelp_for $w.varnorm "When switched on, Melodic will rescale each time series so that the estimation is more influenced by the voxel-wise temporal dynamics and less by a voxels' mean signal. " @@ -291,12 +251,12 @@ checkbutton $w.dim.yn -variable fmri(dim_yn) -text "Automatic dimensionality est pack $w.dim.yn -in $w.dim -side left -$w.bhelp bind $w.dim -msg "In order to avoid overfitting, Melodic will attempt to estimate the number of +balloonhelp_for $w.dim "In order to avoid overfitting, Melodic will attempt to estimate the number of components from the data using Bayesian estimators for the model order and use PCA to reduce the data prior to the IC estimation." set fmri(dim) 0 -tixControl $w.dim.n -label "Output components" -variable fmri(dim) -step 1 -min 1 -selectmode immediate -options { entry.width 4 } +LabelSpinBox $w.dim.n -label "Output components" -textvariable fmri(dim) -range { 1 200000 1} #}}} @@ -307,7 +267,7 @@ frame $w.thresh set fmri(thresh_yn) 1 checkbutton $w.thresh.yn -variable fmri(thresh_yn) -text "Threshold IC maps" -command "melodic2:updatethresh $w" -$w.bhelp bind $w.thresh -msg "Melodic uses a mixture model approach to assign significance to individual +balloonhelp_for $w.thresh "Melodic uses a mixture model approach to assign significance to individual voxels within a spatial map. The mixture model of a single Gaussian distribution (for the background noise within the spatial maps) and 2 Gamma distributions (which model the 'active' voxels contained in @@ -334,7 +294,7 @@ pack $w.thresh.yn $w.thresh.n -in $w.thresh -side left set fmri(ostats) 0 checkbutton $w.ostats -variable fmri(ostats) -text "Output full stats folder" -$w.bhelp bind $w.ostats -msg " +balloonhelp_for $w.ostats " When switched on, Melodic will save the thresholded IC maps and the probability maps inside a folder \/stats. This will substantially increase the amount of space used, @@ -376,14 +336,14 @@ pack $w.varnorm $w.dim $w.thresh $w.ostats $w.report -in $fmri(melodicf) -ancho -side left -expand yes -padx 3 -pady 10 -fill y pack $w.f $w.btns -expand yes -fill both - +$w.nb raise data #}}} } #}}} #{{{ melodic2:updatest -proc melodic2:updatest { w dummy } { +proc melodic2:updatest { w } { global fmri if { $fmri(st) < 3 } { -- GitLab