Skip to content
Snippets Groups Projects
Commit 0c91a0e2 authored by Matthew Webster's avatar Matthew Webster
Browse files

quick detix from old melodic

parent 3d8cd086
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# MELODIC - Multivariate Exploratory Linear Optimized Decomposition into # MELODIC - Multivariate Exploratory Linear Optimized Decomposition into
# Independent Components # 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 # TCLCOPYRIGHT
...@@ -31,32 +31,22 @@ wm iconbitmap $w @${FSLDIR}/tcl/fmrib.xbm ...@@ -31,32 +31,22 @@ wm iconbitmap $w @${FSLDIR}/tcl/fmrib.xbm
frame $w.f 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 NoteBook $w.nb -side top -bd 2 -tabpady {5 10} -arcradius 3
$w.nb add data -label "Data" $w.nb insert 0 data -text "Data"
$w.nb add filtering -label "Pre-stats" $w.nb insert 1 filtering -text "Pre-stats"
$w.nb add melodic -label "MELODIC" $w.nb insert 2 melodic -text "MELODIC"
#{{{ Data #{{{ Data
set fmri(dataf) [ $w.nb getframe data ]
set fmri(dataf) [ $w.nb subwidget data ]
#{{{ multiple analyses #{{{ multiple analyses
frame $w.multiple frame $w.multiple
set fmri(multiple) 1 set fmri(multiple) 1
LabelSpinBox $w.multiple.number -label "Number of analyses " -textvariable fmri(multiple) -range " 1 10000 1 " -width 3
tixControl $w.multiple.number -label "Number of analyses " \
-variable fmri(multiple) -step 1 -min 1 -selectmode immediate \
-options { entry.width 3 }
set fmri(level) 1 set fmri(level) 1
set fmri(analysis) 0 set fmri(analysis) 0
set fmri(inputtype) 2 set fmri(inputtype) 2
...@@ -70,15 +60,7 @@ pack $w.multiple.number $w.multiple.setup -in $w.multiple -side left -padx 5 ...@@ -70,15 +60,7 @@ pack $w.multiple.number $w.multiple.setup -in $w.multiple -side left -padx 5
#{{{ output directory #{{{ output directory
set fmri(outputdir) "" set fmri(outputdir) ""
FileEntry $w.outputdir -textvariable fmri(outputdir) -label " Output directory " -title "Name the output directory" -width 35 -filedialog directory -filetypes { }
FSLFileEntry $w.outputdir \
-variable fmri(outputdir) \
-directory $PWD \
-label " Output directory" \
-title "Name the output directory" \
-width 35 \
-filterhist VARS(history)
#}}} #}}}
frame $w.datamain frame $w.datamain
...@@ -89,15 +71,11 @@ frame $w.nptsndelete ...@@ -89,15 +71,11 @@ frame $w.nptsndelete
#{{{ ndelete #{{{ ndelete
set fmri(ndelete) 0 set fmri(ndelete) 0
LabelSpinBox $w.ndelete -label " Delete volumes " -textvariable fmri(ndelete) -range {0 200000 1 } -width 3
tixControl $w.ndelete -label "Delete volumes " -variable fmri(ndelete) \ balloonhelp_for $w.ndelete "The number of initial FMRI volumes to delete before any further
-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
processing. These should be the volumes that are not wanted because processing. These should be the volumes that are not wanted because
steady-state imaging has not yet been reached - typically two or three steady-state imaging has not yet been reached - typically two or three
volumes." volumes."
#}}} #}}}
pack $w.ndelete -in $w.nptsndelete -side left pack $w.ndelete -in $w.nptsndelete -side left
...@@ -108,12 +86,9 @@ pack $w.ndelete -in $w.nptsndelete -side left ...@@ -108,12 +86,9 @@ pack $w.ndelete -in $w.nptsndelete -side left
frame $w.trparadigm_hp frame $w.trparadigm_hp
#{{{ TR #{{{ TR
set fmri(tr) 3.0 set fmri(tr) 3.0
tixControl $w.tr -label "TR (s) " -variable fmri(tr) \ LabelSpinBox $w.tr -label "TR (s) " -textvariable fmri(tr) -range {0.001 200000 0.25 }
-step 0.25 -min 0.001 -selectmode immediate -options { entry.width 4 } balloonhelp_for $w.tr "The time (in seconds) between scanning successive FMRI volumes."
$w.bhelp bind $w.tr -msg "The time (in seconds) between scanning successive FMRI volumes."
#}}} #}}}
pack $w.tr -in $w.trparadigm_hp -side left 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 ...@@ -134,57 +109,39 @@ pack $w.logo -in $fmri(dataf) -anchor e -side bottom -padx 5 -pady 5
#}}} #}}}
#{{{ Pre-statistics processing #{{{ Pre-statistics processing
set fmri(filteringf) [ $w.nb subwidget filtering ] set fmri(filteringf) [ $w.nb getframe filtering ]
set fmri(filtering_yn) 1 set fmri(filtering_yn) 1
#{{{ motion correction #{{{ motion correction
frame $w.mc LabelFrame $w.mc -text "Motion correction: "
set fmri(mcf) $w.mc set fmri(mcf) $w.mc
optionMenu2 $w.mc.menu fmri(mc) 0 "None" 1 "MCFLIRT"
global fmri(mc) pack $w.mc.menu
tixOptionMenu $w.mc.menu -label "Motion correction: " -variable fmri(mc) balloonhelp_for $w.mc "You will normally want to apply motion correction; this attempts to
$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
remove the effect of subject head motion during the remove the effect of subject head motion during the
experiment. MCFLIRT uses FLIRT (FMRIB's Linear Registration Tool) experiment. MCFLIRT uses FLIRT (FMRIB's Linear Registration Tool)
tuned to the problem of FMRI motion correction, applying rigid-body tuned to the problem of FMRI motion correction, applying rigid-body
transformations." transformations."
set fmri(mc) 1
#}}} #}}}
#{{{ slice timing correction #{{{ slice timing correction
frame $w.st LabelFrame $w.st -text "Slice timing correction: "
set fmri(stf) $w.st set fmri(stf) $w.st
set fmri(st) 0 set fmri(st) 0
set fmri(st_file) "" set fmri(st_file) ""
FSLFileEntry $w.st_file \ FileEntry $w.st_file -textvariable fmri(st_file) -label "" -title "Select a slice order/timings file" -width 20 -filedialog directory -filetypes *
-variable fmri(st_file) \
-pattern "*" \ 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"
-directory $PWD \ pack $w.st.menu
-label "" \
-title "Select a slice order/timings file" \ balloonhelp_for $w.st "Slice timing correction corrects each voxel's time-series for the fact
-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
that later processing assumes that all slices were acquired exactly that later processing assumes that all slices were acquired exactly
half-way through the relevant volume's acquisition time (TR), whereas half-way through the relevant volume's acquisition time (TR), whereas
in fact each slice is taken at slightly different times. 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 ...@@ -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 line states which slices was acquired second, etc. The first slice is
numbered 1 not 0." numbered 1 not 0."
#}}} #}}}
#{{{ BET brain extraction #{{{ BET brain extraction
...@@ -211,16 +169,18 @@ label $w.bet.label -text "BET brain extraction" ...@@ -211,16 +169,18 @@ label $w.bet.label -text "BET brain extraction"
set fmri(bet_yn) 1 set fmri(bet_yn) 1
checkbutton $w.bet.yn -variable fmri(bet_yn) -command "melodic2:updatebet $w" 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 volume in the FMRI data. This is normally better than simple
intensity-based thresholding in order to remove unwanted intensity-based thresholding for getting rid of unwanted voxels in
voxels in FMRI data. Note that here, BET is setup to run FMRI data. Note that here, BET is setup to run in a quite liberal way so that
in a quite liberal way so that there is very little danger there is very little danger of removing valid brain voxels.
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 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 ...@@ -228,14 +188,13 @@ pack $w.bet.label $w.bet.yn $w.bet.thresh -in $w.bet -side left
#{{{ spatial filtering #{{{ spatial filtering
set fmri(smooth) 3 set fmri(smooth) 3
tixControl $w.smooth -label "Spatial smoothing FWHM (mm) " \ LabelSpinBox $w.smooth -label "Spatial smoothing FWHM (mm) " -textvariable fmri(smooth) -range {0.0 10000 1 } -width 3
-variable fmri(smooth) -step 1 -min 0 -selectmode immediate
$w.bhelp bind $w.smooth -msg "This determines the extent of the spatial smoothing, carried out on 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 each volume of the FMRI data set separately. This is intended to
intended to reduce noise without reducing interesting reduce noise without reducing interesting signal; this is successful as
signal; this is successful as long as the underlying long as the underlying signal area is larger than the extent of
signal area is larger than the extent of the smoothing. the smoothing.
To turn off spatial smoothing simply set FWHM to 0." To turn off spatial smoothing simply set FWHM to 0."
...@@ -252,7 +211,7 @@ checkbutton $w.temp.hp_yn -variable fmri(temphp_yn) ...@@ -252,7 +211,7 @@ checkbutton $w.temp.hp_yn -variable fmri(temphp_yn)
set fmri(templp_yn) 0 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. the longest temporal period you will allow.
\"Highpass temporal filtering\" uses a local fit of a \"Highpass temporal filtering\" uses a local fit of a
...@@ -262,7 +221,8 @@ is generally beneficial to remove global trends which ...@@ -262,7 +221,8 @@ is generally beneficial to remove global trends which
will - if not removed - often dominate the decomposition." will - if not removed - often dominate the decomposition."
set fmri(paradigm_hp) 100 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 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 ...@@ -273,12 +233,12 @@ pack $fmri(mcf) $fmri(stf) $w.bet $w.smooth $w.temp -in $fmri(filteringf) -ancho
#}}} #}}}
#{{{ Melodic #{{{ Melodic
set fmri(melodicf) [ $w.nb subwidget melodic ] set fmri(melodicf) [ $w.nb getframe melodic ]
set fmri(varnorm) 1 set fmri(varnorm) 1
checkbutton $w.varnorm -variable fmri(varnorm) -text "Variance-normalise timecourses" 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 that the estimation is more influenced by the voxel-wise
temporal dynamics and less by a voxels' mean signal. " 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 ...@@ -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 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 components from the data using Bayesian estimators for the model
order and use PCA to reduce the data prior to the IC estimation." order and use PCA to reduce the data prior to the IC estimation."
set fmri(dim) 0 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 ...@@ -307,7 +267,7 @@ frame $w.thresh
set fmri(thresh_yn) 1 set fmri(thresh_yn) 1
checkbutton $w.thresh.yn -variable fmri(thresh_yn) -text "Threshold IC maps" -command "melodic2:updatethresh $w" 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 voxels within a spatial map. The mixture model of a single Gaussian
distribution (for the background noise within the spatial maps) and distribution (for the background noise within the spatial maps) and
2 Gamma distributions (which model the 'active' voxels contained in 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 ...@@ -334,7 +294,7 @@ pack $w.thresh.yn $w.thresh.n -in $w.thresh -side left
set fmri(ostats) 0 set fmri(ostats) 0
checkbutton $w.ostats -variable fmri(ostats) -text "Output full stats folder" 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 When switched on, Melodic will save the thresholded IC
maps and the probability maps inside a folder \/stats. maps and the probability maps inside a folder \/stats.
This will substantially increase the amount of space used, 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 ...@@ -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 -side left -expand yes -padx 3 -pady 10 -fill y
pack $w.f $w.btns -expand yes -fill both pack $w.f $w.btns -expand yes -fill both
$w.nb raise data
#}}} #}}}
} }
#}}} #}}}
#{{{ melodic2:updatest #{{{ melodic2:updatest
proc melodic2:updatest { w dummy } { proc melodic2:updatest { w } {
global fmri global fmri
if { $fmri(st) < 3 } { if { $fmri(st) < 3 } {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment