Hello,
This is my first time posting a question so I apologize if my question is not clear.
I am running group analysis of 75 subjects for a task that has 6 conditions (6 sub-bricks for extraction). When I run our script to extract the data using 3dROIstats, only the first 50 subjects data are extracted as output. I tried re-running the script with just the remaining subjects, and only the next 17 subjects’ data was extracted into output. I don’t know what is going on. We have used this script before for analyses for a task that had 3 conditions and had no issues with the extraction and output.
This is the code we run fin the terminal or the full extraction process with the mask for the significant clusters for the main effect of “block”, and then the “stripped” 3dLME file (no headers), and the name of the output file I want created (and then below, is the script embedded in the “extract.sh” command"):
tcsh extract.sh mainblock.F10.p001_mask+tlrc MID.LME.gxc_stripped brainact_gxc_block
The “extract.sh”:
#!/usr/bin/tcsh
############
Settings
############
set SD = ‘/mnt/c/TS_MID’ # Subjects directory
set Grp = ‘/mnt/c/TS_MID’ #The directory with the masks and 3dLME cmd
set maskName = $1 # mask you want to extract from
set mask = $Grp’/‘$maskName
set cmd = $Grp’/'$2 #script with participant info, e.g. lme
set dbName = $3 #make up a name for the output
e.g. ./extract.sh Amy+tlrc lme amyg_activation.txt
Extract the dataTable from the 3dMVM/3dLME command
strip trailing continuation line
sed ‘s/\$//g’ < $cmd > rm_temp
delete blank lines, strip the leading and trailing spaces, tabs
sed -e ‘/^$/d’ -e ‘s/^\t*(.*)/\1/g’ < rm_temp > rm_temp3
set Subj = cut -f1 rm_temp3
set Group = cut -f2 rm_temp3
set Cond = cut -f3 rm_temp3
set File = cut -f4 rm_temp3
rm rm_temp*
foreach i (seq $#Subj
)
echo “$File[$i]”
eval “3dROIstats -nzmean -nzsigma -nzmedian -nzvoxels -nzminmax -mask $mask $File[$i] > rm_temp”
cat rm_temp
if ($i == 1) then
head -1 rm_temp | sed ‘s/^/Subject\tGroup\tCond\t /’ >> $dbName
tail -1 rm_temp | sed ‘s/^/’“$Subj[$i]”‘\t’“$Group[$i]”‘\t’“$Cond[$i]”‘\t /’ >> $dbName
else
tail -1 rm_temp | sed ‘s/^/’“$Subj[$i]”‘\t’“$Group[$i]”‘\t’“$Cond[$i]”‘\t /’ >> $dbName
endif
rm rm_temp
end
Thanks for your help!