Hi - thanks for your email.
Christian has already answered the first half (my similar answer is below,
as also is an answer to the second half):
1)
if you overwrite the expected ICA 4D analyze file output (melodic_IC) with
the normalised data and then run melodicreport it will use the new 4D
data:
if your ICA output directory is data.ica
and if your normalised 4D analyze file is icanorm.hdr / .img then do:
mv icanorm.hdr data.ica/melodic_IC.hdr
mv icanorm.img data.ica/melodic_IC.img
melodicreport data.ica
this will use the normalised data (and will generated very big pictures in
the web pages!)
2)
in order to render this on top of the average_152, you need to run the
attached version of melodicreport instead....hopefully it will run... the
new syntax is:
melodicreport <melodicdir> <backgroundimage>
Thanks, Steve.
On Wed, 4 Jul 2001, Thomas Stephan wrote:
> Dear FSL list,
>
> I normalized the results from an ICA analysis to standard space, which gives
> me the file
> melodic_IC_standard. How can I tell melodicreport to use the normalized data
> set
> instead of melodic_IC ?
> Is there a way to project the results of the ICA onto an anatomical
> backgroud image ?
>
> Thank you
> Thomas Stephan
> ======================================================================
> Thomas Stephan Email: [log in to unmask]
> Klinikum Grosshadern
> Neurologisches Forschungshaus
> Marchioninistr. 23 Fon: +49 089 / 7095-4819
> 81377 Muenchen Fax: +49 089 / 7095-4801
> ======================================================================
>
#!/bin/sh
# 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 FSLDIR $env(FSLDIR)
set MD [ lindex $argv 0 ]
catch { exec mkdir ${MD}/report }
if { ! [ file exists ${MD}/melodic_IC.hdr ] || ! [ file exists ${MD}/melodic_IC.img ] } {
puts "No MELODIC output melodic_IC.hdr/.img - 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\">
<hr><CENTER>
<H1>MELODIC Report</H1>
$REPORTFILE<br>
[ exec date ]
</CENTER>
<hr><H2>Components:</H2><p>"
set dim [ exec ${FSLDIR}/bin/avwval ${MD}/melodic_IC dim4 ]
set npts [ expr [ exec 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 ${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\">
<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
|