Skip to content

Commit

Permalink
Automated calculation of size formula
Browse files Browse the repository at this point in the history
  • Loading branch information
bbfrederick committed Dec 20, 2024
1 parent 89b6355 commit 705d1dd
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 22 deletions.
43 changes: 29 additions & 14 deletions docs/usage_rapidtide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,22 +186,37 @@ CORRFUNCSIZE is the size of the correlation function in TRs at the oversampled T
The output sizes in TRs (with no motion regression) are as follows:

.. csv-table:: Total image output data size in TRs
:header: "Output level", "GLM?", "Number of TRs"
:widths: 10, 10, 10

"min", "No", "16"
"less", "No", "16"
"normal", "No", "16 + CORRFUNCSIZE"
"more", "No", "16 + CORRFUNCSIZE"
"max", "No", "17 + CORRFUNCSIZE"
"min", "Yes", "24"
"less", "Yes", "24 + FMRISIZE"
"normal", "Yes", "24 + CORRFUNCSIZE + FMRISIZE"
"more", "Yes", "24 + CORRFUNCSIZE + 3*FMRISIZE"
"max", "Yes", "25 + 3*CORRFUNCSIZE + 4*FMRISIZE"
:header: "Output level", "Passes>1?", "Refine delay?", "GLM?", "Number of TRs"
:widths: 10, 10, 10, 10, 10

"min", "No", "No", "No", "13"
"min", "No", "Yes", "No", "16"
"min", "Yes", "No", "No", "16"
"min", "Yes", "Yes", "No", "19"
"min", "No", "No", "Yes", "14"
"min", "Yes", "No", "Yes", "17"
"less", "No", "No", "No", "13"
"less", "No", "Yes", "No", "17 + 1*FMRISIZE"
"less", "Yes", "No", "No", "16"
"less", "Yes", "Yes", "No", "20 + 1*FMRISIZE"
"normal", "No", "No", "No", "13 + 1*CORRFUNCSIZE"
"normal", "No", "Yes", "No", "21 + 1*CORRFUNCSIZE + 1*FMRISIZE"
"normal", "Yes", "No", "No", "19 + 1*CORRFUNCSIZE"
"normal", "Yes", "Yes", "No", "27 + 1*CORRFUNCSIZE + 1*FMRISIZE"
"more", "No", "No", "No", "13 + 1*CORRFUNCSIZE"
"more", "No", "Yes", "No", "21 + 1*CORRFUNCSIZE + 2*FMRISIZE"
"more", "Yes", "No", "No", "19 + 1*CORRFUNCSIZE"
"more", "Yes", "Yes", "No", "27 + 1*CORRFUNCSIZE + 2*FMRISIZE"
"max", "No", "No", "No", "13 + 3*CORRFUNCSIZE"
"max", "No", "Yes", "No", "21 + 3*CORRFUNCSIZE + 3*FMRISIZE"
"max", "Yes", "No", "No", "19 + 3*CORRFUNCSIZE"
"max", "Yes", "Yes", "No", "27 + 3*CORRFUNCSIZE + 3*FMRISIZE"
"max", "No", "No", "Yes", "14 + 3*CORRFUNCSIZE + 1*FMRISIZE"
"max", "Yes", "No", "Yes", "20 + 3*CORRFUNCSIZE + 1*FMRISIZE"
..
The data size is then this number of TRs times the size of 1 TR worth of data in the input fMRI file.
The data size is then this number of TRs times the size of 1 TR worth of data in the input fMRI file, (plus the size
of the various timecourse files and .json sidecars which are much smaller than the image files).


As an example, the following table shows the size of the data produced by running a rapidtide analysis on one HCP-YA
Expand Down
52 changes: 44 additions & 8 deletions rapidtide/data/examples/src/makeformulasizetable
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,49 @@

cd ../dst/scratch

for outputdir in *
for outputlevel in min less normal more max
do
rm -f greps
touch greps
ls -1 ${outputdir}/*.nii.gz | awk '{print "fslhd "$1" | grep dim4 | egrep -v pixdim | awk YYY{print $2}YYY"}' | sed "s/YYY/'/g" > greps
singles=`source greps | grep 1 | wc | awk '{print $1}'`
corrtrs=`source greps | grep 29 | wc | awk '{print $1}'`
fmritrs=`source greps | grep 260 | wc | awk '{print $1}'`
echo ${outputdir} ${singles} ${corrtrs} ${fmritrs}
for passesgt1 in False True
do
if [ ${passesgt1} = "True" ]; then
passesgt1str="Yes"
else
passesgt1str="No"
fi
for dorefinedelay in False True
do
if [ ${dorefinedelay} = "True" ]; then
refinedelaystr="Yes"
else
refinedelaystr="No"
fi
for doglm in False True
do
if [ ${doglm} = "True" ]; then
glmstr="Yes"
else
glmstr="No"
fi
for thisdir in ${outputlevel}*passesgt1-${passesgt1}_numnullgt0-False_doglm-${doglm}_domotion-False_doderivs-False_dodespeckle-False_dorefinedelay-${dorefinedelay}
do
rm -f greps
touch greps
ls -1 ${thisdir}/*.nii.gz 2>/dev/null | awk '{print "fslhd "$1" | grep dim4 | egrep -v pixdim | awk YYY{print $2}YYY"}' | sed "s/YYY/'/g" 1> greps
singles=`source greps | grep 1 | wc | awk '{print $1}'`
corrtrs=`source greps | grep 29 | wc | awk '{print $1}'`
fmritrs=`source greps | grep 260 | wc | awk '{print $1}'`
if [ ${singles} != "0" ]; then
outsize=${singles}
if [ ${corrtrs} != "0" ]; then
outsize=${outsize}" + "${corrtrs}"*CORRFUNCSIZE"
fi
if [ ${fmritrs} != "0" ]; then
outsize=${outsize}" + "${fmritrs}"*FMRISIZE"
fi
echo '"'${outputlevel}'", "'${refinedelaystr}'", "'${glmstr}'", "'${passesgt1str}'", "'${outsize}'"'
fi
done
done
done
done
done

0 comments on commit 705d1dd

Please sign in to comment.