Skip to content
Snippets Groups Projects
Commit 65041639 authored by Stephen Smith's avatar Stephen Smith
Browse files

*** empty log message ***

parent 15f9b34d
No related branches found
No related tags found
No related merge requests found
......@@ -336,8 +336,7 @@ checkbutton $w.ostats -variable fmri(ostats) -text "Output full stats folder" -f
$w.bhelp bind $w.ostats -msg "
When switched on, Melodic will save the thresholded IC
maps and the probability maps in Analyze (.img/.hdr)
format inside a folder \/stats.
maps and the probability maps inside a folder \/stats.
This will substantially increase the amount of space used,
so only switch this on if you intend to use these maps."
......@@ -448,7 +447,7 @@ proc melodic2:apply { w dialog } {
#{{{ setup filenames
set INPUT [ file rootname $feat_files($session) ]
set INPUT [ remove_ext $feat_files($session) ]
set OUTPUT [ new_filename ${INPUT}.ica ]
......
#!/bin/sh
# melodicreport - makes the report page for melodic
#
# Christian Beckmann, Stephen Smith and Mark Jenkinson
# FMRIB Image Analysis Group
#
# Copyright (C) 1999-2004 University of Oxford
#
# SHCOPYRIGHT
# the next line restarts using wish \
exec $FSLDIR/bin/tclsh "$0" "$@"
if { [ lindex $argv 0 ] == "" } {
puts "Usage: melodicreport <melodic_output_directory> \[background_image \]"
exit
}
set background 0
if { [ lindex $argv 1 ] != "" } {
set background 1
set bgimage [ lindex $argv 1 ]
}
set S 0.2
catch { [ expr $S ] } errrr
set FSLDIR $env(FSLDIR)
set MD [ lindex $argv 0 ]
catch { exec sh -c "mkdir ${MD}/report" }
if { ! [ file exists ${MD}/melodic_IC.hdr ] && ! [ file exists ${MD}/melodic_IC.hdr.gz ] } {
puts "No MELODIC output melodic_IC - exiting."
exit
}
if { ! [ file exists ${MD}/melodic_IC.img ] && ! [ file exists ${MD}/melodic_IC.img.gz ] } {
puts "No MELODIC output melodic_IC - exiting."
exit
}
set REPORTFILE ${MD}/report/report.html
set report [ open $REPORTFILE "w" ]
fconfigure $report -buffering none
puts $report "<HTML>
<TITLE>MELODIC Report</TITLE>
<BODY BACKGROUND=\"file:${FSLDIR}/doc/images/fsl-bg.jpg\">
<hr><CENTER>
<H1>MELODIC Report</H1>
$REPORTFILE<br>
[ exec date ]
</CENTER>
<hr><H2>Components:</H2><p>"
set dim [ exec sh -c "${FSLDIR}/bin/avwval ${MD}/melodic_IC dim4" ]
set npts [ expr [ exec sh -c "cat ${MD}/melodic_mix | wc -l" ] * 1 ]
set xscale [ expr $npts * 4 ]
if { $xscale < 750 } {
set xscale 750
}
if { $xscale > 3000 } {
set xscale 3000
}
set xscale [ expr $xscale / 750.0 ]
for { set i 1 } { $i <= $dim } { incr i 1 } {
puts $report "<a href=\"c${i}.html\">$i</a>"
exec sh -c "${FSLDIR}/bin/avwroi ${MD}/melodic_IC ${MD}/grot [ expr $i - 1 ] 1"
catch { exec sh -c "${FSLDIR}/bin/avwstats ${MD}/grot -R" } minmax
set absmin [ expr abs ( [ lindex $minmax 0 ] ) ]
set absmax [ expr abs ( [ lindex $minmax 1 ] ) ]
if { $absmin > $absmax } {
set absmax $absmin
}
set absmax [ expr $absmax * 0.75 ]
if { $background == 0 } {
exec sh -c "${FSLDIR}/bin/slicer ${MD}/grot -l ${FSLDIR}/etc/luts/render3.lut -s 2 -i -$absmax $absmax -A 950 ${MD}/grot.ppm"
} else {
set llimit [ expr $absmax / 6.0 ]
exec sh -c "${FSLDIR}/bin/avwmaths ${MD}/grot -mul -1 ${MD}/grotinv"
exec sh -c "${FSLDIR}/bin/overlay 1 0 $bgimage -a ${MD}/grot $llimit $absmax ${MD}/grotinv $llimit $absmax ${MD}/grotoverlay"
exec sh -c "${FSLDIR}/bin/slicer ${MD}/grotoverlay -s 2 -A 950 ${MD}/grot.ppm"
}
exec sh -c "${FSLDIR}/bin/convert ${MD}/grot.ppm ${MD}/report/s$i.gif"
exec sh -c "cat ${MD}/melodic_mix | awk '{ print \$$i }' > ${MD}/report/t${i}.txt"
exec sh -c "echo \"set term pbm color ; set size $xscale,0.25 ; set title 'Timecourse (TRs)' ; plot '${MD}/report/t${i}.txt' title '' with lines\" | ${FSLDIR}/bin/gnuplot > ${MD}/grot.ppm"
exec sh -c "${FSLDIR}/bin/convert ${MD}/grot.ppm ${MD}/report/t$i.gif"
exec sh -c "cat ${MD}/melodic_FTmix | awk '{ print NR \" \" \$$i }' > ${MD}/report/f${i}.txt"
exec sh -c "echo \"set term pbm color ; set size $xscale,0.25 ; set title 'FT of Timecourse (cycles) frequency(Hz)=cycles/($npts*TR) period(s)=($npts*TR)/cycles' ; plot '${MD}/report/f${i}.txt' title '' with lines\" | ${FSLDIR}/bin/gnuplot > ${MD}/grot.ppm"
exec sh -c "${FSLDIR}/bin/convert ${MD}/grot.ppm ${MD}/report/f$i.gif"
set creport [ open ${MD}/report/c${i}.html "w" ]
puts $creport "<HTML>
<TITLE>MELODIC Component $i</TITLE>
<BODY BACKGROUND=\"file:${FSLDIR}/doc/images/fsl-bg.jpg\">
<hr><CENTER><H1>MELODIC Component $i</H1>
"
if { $i > 1 } {
puts $creport "<a href=\"c[ expr $i - 1 ].html\">previous</a> - "
}
puts $creport "<a href=\"report.html\">index</a>"
if { $i < $dim } {
puts $creport " - <a href=\"c[ expr $i + 1 ].html\">next</a>"
}
puts $creport "
<hr><p>
<IMG BORDER=0 SRC=\"s$i.gif\"><p>
<a href=\"t$i.txt\"><IMG BORDER=0 SRC=\"t$i.gif\"></a><p>
<a href=\"f$i.txt\"><IMG BORDER=0 SRC=\"f$i.gif\"></a><p>
<hr></CENTER></BODY></HTML>
"
close $creport
}
exec sh -c "/bin/rm -f ${MD}/grot*"
puts $report "<HR><FONT SIZE=1>This page produced automatically by MELODIC - a part of <A HREF=\"http://www.fmrib.ox.ac.uk/fsl\">FSL - FMRIB's Software Library</A>.</FONT>
</BODY></HTML>
"
close $report
puts "Finished melodicreport at [ exec date ]
To view the MELODIC report point your web browser at
$REPORTFILE
"
exit
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