Commit b9789158 authored by vesoik@utu.fi's avatar vesoik@utu.fi

continued demo

parent eacb5a73
......@@ -45,7 +45,7 @@ tacdecay -decay=off -i=O-15 sim/gm.tac sim/gm_nondecaycorrected.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Make noise realizations
svar4tac -minsd=0.2 -x=10 sim/gm_nondecaycorrected.tac 20 sim/gm_nondecaycorrected_noisy.tac
svar4tac -minsd=0.01 -x=15 sim/gm_nondecaycorrected.tac 20 sim/gm_nondecaycorrected_noisy.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -mt="Noisy simulated TTACs" -legend=n sim/gm_nondecaycorrected_noisy.svg -l sim/gm_nondecaycorrected_noisy.tac
......@@ -80,6 +80,9 @@ printf "330 360\n" >> sim/frames.sif
printf "360 420\n" >> sim/frames.sif
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
simframe sim/gm.tac sim/frames.sif sim/ttac_noiseless.tac O-15
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
simframe sim/gm_nondecaycorrected_noisy.tac sim/frames.sif sim/ttacs_nondecaycorrected.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
......@@ -87,12 +90,33 @@ if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tacdecay -decay=on -i=O-15 sim/ttacs_nondecaycorrected.tac sim/ttacs.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Rename TTACs with numbers
tacren sim/ttacs.tac 0 GM#
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -mt="Noisy framed TTACs" -legend=n sim/ttacs.svg -l sim/ttacs.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Calculate mean and CV of the noisy TTACs
tacmean -cv=sim/ttacs_cv.tac sim/ttacs.tac sim/ttacs_mean.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -x1=15 -mt="CV of the noisy framed TTACs" -legend=n sim/ttacs_cv.svg -l sim/ttacs_cv.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Plot the noiseless TTAC and the mean of noisy TTACs
tac2svg -mt="Mean of noisy TTACs" -legend=n sim/ttacs_mean.svg -l sim/ttacs.tac sim/ttacs_mean.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Calculate differences between noiseless TTAC and the noisy TTACs
taccalc sim/ttacs.tac - sim/ttac_noiseless.tac sim/ttac_noise.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -mt="Noise" -legend=y sim/ttac_noise.svg -s sim/ttac_noise.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n=====================================================================\n"
printf " Calculate perfusion using CM fit \n"
printf " Calculate perfusion using CM fit, saving fitted TTACs \n"
printf "=====================================================================\n\n"
fit_h2o -fpt -Vb=0 -delay=0 -k2 -fit=sim/cbf_sim1_fit_h2o.tac sim/blood.tac sim/ttacs.tac 999 sim/fit_h2o.par
......@@ -100,6 +124,11 @@ if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -mt="" -legend=y sim/cbf_sim1_fit_h2o.svg -s sim/ttacs.tac -l sim/cbf_sim1_fit_h2o.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
# Calculate differences between fitted TTACs and the noisy TTACs used for fitting
taccalc sim/cbf_sim1_fit_h2o.tac - sim/ttacs.tac sim/fit_residual.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -mt="Residuals" -legend=y sim/fit_residual.svg -s sim/fit_residual.tac
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n===================================================================\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment