Commit d697fb40 authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

fit2auc passes first tests

parent ad2986db
......@@ -43,12 +43,12 @@ add_executable (fit2auc fit2auc.c)
target_link_libraries (fit2auc tpctacmod tpcfunc tpcmodels tpcfileutil tpctac tpcpar tpccsv tpcift tpcextensions m)
# Install the executable(s)
#install (
# PROGRAMS
# ${CMAKE_CURRENT_BINARY_DIR}/fit2auc${CMAKE_EXECUTABLE_SUFFIX}
# DESTINATION bin
# COMPONENT applications
#)
install (
PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/fit2auc${CMAKE_EXECUTABLE_SUFFIX}
DESTINATION bin
COMPONENT applications
)
# Copy test data folder
add_custom_target(pktests ALL
......
#!/bin/bash
#: Title : test_fit2auc
#: Date : 2021-02-03
#: Date : 2021-02-04
#: Author : "Vesa Oikonen" <vesa.oikonen@utu.fi>
#: Options : None
......@@ -28,15 +28,26 @@ if [ ! -f s6910vp.kbq ]; then
exit 1
fi
printf "\n fit bi-exponential function to late part of venous FDG PTAC \n"
taccut s6910vp.kbq 10 120 s6910vp_cut.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
fit_dexp -2 -w1 s6910vp_cut.kbq s6910vp.fit
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
fit2dat -a=100 s6910vp.fit s6910vp_fit.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -x1=0 -y1=0 -legend=no s6910vp.svg -s s6910vp.kbq -l s6910vp_fit.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
if [ ! -f s6910vp.fit ] || [ ! -f correct_s6910vp_auc0-inf.par ] || [ ! -f correct_s6910vp_auc10-inf.par ]; then
printf "\n fit bi-exponential function to late part of venous FDG PTAC \n"
taccut s6910vp.kbq 10 120 s6910vp_cut.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
fit_dexp -2 -w1 s6910vp_cut.kbq s6910vp.fit
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
fit2dat -a=100 s6910vp.fit s6910vp_fit.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
tac2svg -x1=0 -y1=0 -legend=no s6910vp.svg -s s6910vp.kbq -l s6910vp_fit.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n Save correct AUCs \n"
printf "Parameters\tAUC[min*kBq/mL]\n" > correct_s6910vp_auc0-inf.par
printf "tac1\t234.3086741\n" >> correct_s6910vp_auc0-inf.par
printf "Parameters\tAUC[min*kBq/mL]\n" > correct_s6910vp_auc10-inf.par
printf "tac1\t130.34775\n" >> correct_s6910vp_auc10-inf.par
fi
......@@ -50,11 +61,21 @@ printf " Test case: Actual plasma TAC, fitted with bi-exponential. \n"
printf " Expected result: close to correct AUC is obtained. \n\n"
printf "\n Start time: 0 \n"
rm -f s6910vp_auc0-inf.par
$PROGRAM s6910vp.fit 0 s6910vp_auc0-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=0.01 correct_s6910vp_auc0-inf.par s6910vp_auc0-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
rm -f output0.par
$PROGRAM s6910vp.fit 0 output0.par
printf "\n Start time: 10 \n"
rm -f s6910vp_auc10-inf.par
$PROGRAM s6910vp.fit 10 s6910vp_auc10-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=0.01 correct_s6910vp_auc10-inf.par s6910vp_auc10-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \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