How to check the result labels generated by 3dDeconvolve with .1D file

Hi experts,

I tried using 3dDeconvolve to process two 1D files generated from 3dmaskave with the following codes:

                3dDeconvolve -force_TR 2.4 
             -input $maskWD/mean1D/epi01_$extractMaskName.1D\' $maskWD/mean1D/epi02_$extractMaskName.1D\'     \
             -jobs 10                                            \
             -ortvec mot_demean.r01.1D mot_demean_r01            \
             -ortvec mot_demean.r02.1D mot_demean_r02            \
             -polort 4                                           \
             -censor motion1_${patientName}_censor.1D             \
             -num_stimts 3                                                        \
             -local_times                                                         \
             -stim_times 1 /Volumes/RogerSSD/fMRI2023/stimuli/ConA.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,10)'               \
             -stim_label 1 ConA                                            \
             -stim_times 2 /Volumes/RogerSSD/fMRI2023/stimuli/ConB.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,10)'                     \
             -stim_label 2 ConB                                                  \
             -stim_times 3 /Volumes/RogerSSD/fMRI2023/stimuli/ConC.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,8)'                       \
             -stim_label 3 ConC                                                   \
             -gltsym 'SYM: ConA - ConB'                                   \
             -glt_label 1 A-B                                                     \
             -fout -tout -x1D 1dstat/X.xmat_${extractMaskName}.1D -xjpeg 1dstat/X_${extractMaskName}.jpg                              \
             -x1D_uncensored 1dstat/X.nocensor.xmat_${extractMaskName}.1D                                   \
             -errts 1dstat/errts.${patientName}_${extractMaskName}                                          \
             -bucket 1dstat/stats.${patientName}_${extractMaskName}

The code was executed successfully. And the result is:

0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
-0.021209 
0.134012 
-0.173749 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 

But I don't know the label of each row. I guess the first row is the Full_Fstat (what does it mean?), the 2nd to 10th are the Coef, Tstat and Fstat of each label (conA, conB, conC), so the 11th to 13th are the Coef, Tstat and Fstat of A-B. But what does the last 12 rows mean? Are they for motion parameters? But there were only 6 parameters. Thanks in advance.

Best regards,

Roger

Hi Roger,

The answer to the first question is yes, -full_first explains full model statistics will be first in the bucket datase which is mentioned on AFNI program: 3dDeconvolve (nih.gov). Full_Fstat used to test the overall effect of all regressions (except baseline) on neural activity refers to Deconvolvem.pdf.

If you want to see what stats are on each line, I think you can use the 3dinfo -verb bucket filename command to go through each sub-brick detail.

Lin

Hi Lin,

Thank you for your detailed reply. I just tried the 3dinfo command.

For '3dinfo -verb stat.1d', I got a report, but there was no information about the label. Then I tried inputing other normal 4D-format file to 3dDeconvolve and imported its stat.BRIK to 3dinfo. And I got the sub-brick info.

So I think this is because my input file is 1D file, which was generated by 3dmaskave. (The result of stat.1d is shown in the first post.) And could you provide other solutions? Thanks.

Best,

Roger

Roger,

Append something like the following to your original 3dDeconvolve script:

> 1dstat/stats.${patientName}_${extractMaskName}_details

The file stats.${patientName}_${extractMaskName}_details should hold more comprehensive and revealing information related to your analysis.

Gang Chen

Hi Gang,

I got this result from the code:

------------------------------------------------------------
GLT matrix from 'SYM: ConA - ConB':
   0   0   0   0   0   0   0   0   0   0   1  -1   0   0   0   0   0   0   0   0   0   0   0   0   0 

It seems that there is still no label information for each row of the result 1d file.

By the way, I have another question, why the rest of my result is zero? Should some of them be the Coef (non-zero)?

And I added two other glt_label, including SYM: ConA and SYM: ConB. However, the result is as the same as the previous, in which only 3 rows are non-zero. I checked the details file as follows:

------------------------------------------------------------
GLT matrix from 'SYM: ConA':
   0   0   0   0   0   0   0   0   0   0   1   0   0 
 
------------------------------------------------------------
GLT matrix from 'SYM: ConB':
   0   0   0   0   0   0   0   0   0   0   0   1   0 
 
------------------------------------------------------------
GLT matrix from 'SYM: ConA - ConB':
   0   0   0   0   0   0   0   0   0   0   1  -1   0 

Looking forward to your help. Thanks a lot.

Best,

Roger

Roger,

If you share the input files along with the 3dDeconvolve script (excluding local paths) through email, that would enable me to thoroughly examine the situation.

Gang Chen

I think labels only come out with a volumetric dataset, even if it is just 2 identical voxels. It might take some investigating to see how the 1D format short circuits the output procedure. Also, these 1D output files are surely showing only direct betas, no stats or contrasts.

The first 10 should be run runs of polort 4 trends (so 5 terms per run), the next 3 are the betas of interest, the last 12 are the polort terms for the 2 runs. So the 10+12 zeros are baseline terms, which are output as zero because there is no -bout option applied.

You could try to use HEAD/BRIK format instead of 1D, but it would require at least 2 voxels in a dataset and use of AFNI_WRITE_1D_AS_PREFIX.

  • rick

Hi Prof. Chen,

Happy new year! I just sent an email to you with my script and necessary files. Thank you for your help in advance.

Best,

Roger

Hi rick,

I agree with you. So The first 10 rows are the coefficients of the fitting functions of the two runs? I test that the last 12 rows are generated by the parameter -ortvec, so I guess that they are the beta of six head motion parameters( 3 translation parameters and 3 rotation parameters) in two runs?

Thank you

Best,

Roger

Thanks to Prof. Chen . I have tried @Gang 's method, and the result provide detailed information about coefficient and p-values of all baselines, stimuli conditions and general linear test.
The code as follows:

1dcat epi01_$extractMaskName.1D\'  /epi02_$extractMaskName.1D\' > data.1D
3dDeconvolve -force_TR 2.4 
             -input1D data.1D     \
             -jobs 10                                            \
             -ortvec mot_demean.r01.1D mot_demean_r01            \
             -ortvec mot_demean.r02.1D mot_demean_r02            \
             -polort 4                                           \
             -censor motion1_${patientName}_censor.1D             \
             -num_stimts 3                                                        \
             -local_times                                                         \
             -stim_times 1 /Volumes/RogerSSD/fMRI2023/stimuli/ConA.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,10)'               \
             -stim_label 1 ConA                                            \
             -stim_times 2 /Volumes/RogerSSD/fMRI2023/stimuli/ConB.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,10)'                     \
             -stim_label 2 ConB                                                  \
             -stim_times 3 /Volumes/RogerSSD/fMRI2023/stimuli/ConC.txt 'TWOGAM(5.1849,1.4339,0.0446,1.0352,665.5736,8)'                       \
             -stim_label 3 ConC                                                   \
             -gltsym 'SYM: ConA - ConB'                                   \
             -glt_label 1 A-B                                                     \
             -fout -tout -x1D 1dstat/X.xmat_${extractMaskName}.1D -xjpeg 1dstat/X_${extractMaskName}.jpg                              \
             -x1D_uncensored 1dstat/X.nocensor.xmat_${extractMaskName}.1D                                   \
             -errts 1dstat/errts.${patientName}_${extractMaskName}                                          \
             -bucket 1dstat/stats.${patientName}_${extractMaskName} > stats_details

The most important part is that 1) using 1dcat to merge two 1D file and transpose to 1 row. 2) print the detailed result by adding > stats_details at the end. Then, all information is saved clearly in stats_details. Meanwhile, you can understand the result in stats.${patientName}_${extractMaskName} by stats_details as well.

Hey, that's great! I expected you to need to put at least 2 voxels together, but did not know it would provide the extra output while still in 1D format. I have not yet looked into the details unfortunately, but this seems like a sufficient solution. Thanks for the update.

  • rick