Clustsim option in 3dttest++

Hi all,

Can someone clarify whether the -clustsim option within 3dttest++ is actually available for public use in afni & how specifically to implement it? I was under the impression it was, but when I attempt to use it, an error occurs saying that 3dttest++ does not recognize that option.

Thank you for your time.

I’ve noticed the same thing. It’s described in the 3dttest++ help file for the version of AFNI I’m running (afni/16.1.27), but it doesn’t recognize the -clustsim flag when I try to run it.

So for me it appeared in part to be an AFNI version issue. I checked and realized we were running a few versions behind the current build. So now the -clustsim flag is recognized by AFNI when I run it. However, I am running into a different error now.

The output .BRIKs containing the results of the group analysis as well as the residual file are created successfully, but the program fails when starting the clustsim portion, giving the following error:

FATAL ERROR: Option -setA (long form): need at least 2 datasets.

So, it would appear that upon reaching the clustsim portion of the analysis, it no longer recognizes the manner in which the ttest is set up. I am confused by this because if there was a problem with the way things were set up––btw, this is supposed to be an independent samples t-test, with 2 groups (unequal size) and covariates)––then wouldn’t the output of the group analysis not be created either?

Any suggestions would be much appreciated.

Thanks,
Dominic

It was a similar issue for me. In my case, the script I was running that had the 3dttest++ command in it was calling an older (pre -clustsim) version of the program (for reasons I don’t understand) when I ran it with “tcsh my_script.tcsh”, but it ran the new version when I executed the script with “source my_script.tcsh”. Changes were made to our servers recently that I believe are causing this issue to arise for me.

I’ll suggest posting your entire 3dttest++ command for debugging the other error.

Here is a shortened version of the command I was running which has been giving me problems in employing the -Clustsim option in 3dttest++. I have many more subjects than I have listed here (45 in set A, 37 in set B), but have truncated the listing here for purposes of display/efficiency. Any thoughts would be more than welcome; let me know if something is unclear here.

Thanks again for your time,
Dominic

3dttest++ -setA ControlsResting
SB115_fu1 /space/raid3/data/totten/SB/SB115_fu1/resting/SB115_fu1.results/SB115_fu1_R_VS_Corr+tlrc’[0]’
SB184 /space/raid3/data/totten/SB/SB184/resting/SB184.results/SB184_R_VS_Corr+tlrc’[0]’
SB061 /space/raid3/data/totten/SB/SB061/resting/SB061.results/SB061_R_VS_Corr+tlrc’[0]’
SB300_fu1 /space/raid3/data/totten/SB/SB300_fu1/resting/SB300_fu1.results/SB300_fu1_R_VS_Corr+tlrc’[0]’
SB235_fu1 /space/raid3/data/totten/SB/SB235_fu1/resting/SB235_fu1.results/SB235_fu1_R_VS_Corr+tlrc’[0]’
SB190 /space/raid3/data/totten/SB/SB190/resting/SB190.results/SB190_R_VS_Corr+tlrc’[0]’
SB152_fu1 /space/raid3/data/totten/SB/SB152_fu1/resting/SB152_fu1.results/SB152_fu1_R_VS_Corr+tlrc’[0]’
SB276 /space/raid3/data/totten/SB/SB276/resting/SB276.results/SB276_R_VS_Corr+tlrc’[0]’
SB144 /space/raid3/data/totten/SB/SB144/resting/SB144.results/SB144_R_VS_Corr+tlrc’[0]’
SB001 /space/raid3/data/totten/SB/SB001/resting/SB001.results/SB001_R_VS_Corr+tlrc’[0]’
-setB PIsResting
SB085 /space/raid3/data/totten/SB/SB085/resting/SB085.results/SB085_R_VS_Corr+tlrc’[0]’
SB068 /space/raid3/data/totten/SB/SB068/resting/SB068.results/SB068_R_VS_Corr+tlrc’[0]’
SB046_fu1 /space/raid3/data/totten/SB/SB046_fu1/resting/SB046_fu1.results/SB046_fu1_R_VS_Corr+tlrc’[0]’
SB322 /space/raid3/data/totten/SB/SB322/resting/SB322.results/SB322_R_VS_Corr+tlrc’[0]’
SB025_fu1 /space/raid3/data/totten/SB/SB025_fu1/resting/SB025_fu1.results/SB025_fu1_R_VS_Corr+tlrc’[0]’
SB307_fu1 /space/raid3/data/totten/SB/SB307_fu1/resting/SB307_fu1.results/SB307_fu1_R_VS_Corr+tlrc’[0]’
SB147 /space/raid3/data/totten/SB/SB147/resting/SB147.results/SB147_R_VS_Corr+tlrc’[0]’
SB205 /space/raid3/data/totten/SB/SB205/resting/SB205.results/SB205_R_VS_Corr+tlrc’[0]’
SB227 /space/raid3/data/totten/SB/SB227/resting/SB227.results/SB227_R_VS_Corr+tlrc’[0]’
SB081_fu1 /space/raid3/data/totten/SB/SB081_fu1/resting/SB081_fu1.results/SB081_fu1_R_VS_Corr+tlrc’[0]’

-covariates Covariates.1D
-center SAME
-mask groupEPImask_80percentoverlap+tlrc.BRIK
-resid 3dttest_residuals_test_7_2016
-toz
-Clustsim
-prefix test_output

I’m not an officially sanctioned message board troubleshooter, but the first thing I would check with the error you’re getting is that there are no spaces after the \ characters that continue the command onto the next line.

Hi Dominic,

To add to Phil’s good comments,

  1. I expect there are more error messages printed
    to the screen. Would you be sure to show all of
    the messages?

  2. To find any line continuation problems that Phil
    is concerned about, consider using file_tool, e.g.

file_tool -test -infile SCRIPT.txt

Please feel free to report that output.

  • rick

Hi Rick,

Thanks for the suggestions. I am pasting below the output from 3dttest++ beginning after the output .BRIK has already been written to the disk; I also tried the file_test command as per your last message on the script file and no problems were reported.

  • Added 12 FDR curves to dataset
    ++ Output dataset ./NewStream_VSseed_7_13_2016_clustsimtest_82subs_ControlsPIs_age_motion_gender_checkforgroupdiffsinCBCLsubs_noCBCLregressors_080_fu1fixed_80overlapmask_clustsim+tlrc.BRIK
    ++ Output dataset ./3dttest_residuals_test_7_13_2016+tlrc.BRIK
  • 2-sample test: results are ControlsRest - PIsResting
    ++ ================ Starting -clustsim calculations ================
  • ===== temporary files will have prefix TT.pAUC8mFBV5H =====
  • ===== running 16 -randomsign jobs (626 iterations per job) =====
    ++ 3dttest++: AFNI version=AFNI_16.1.28 (Jun 30 2016) [64-bit]
    ++ Authored by: Zhark++
    ++ 49053 voxels in -mask dataset
    ** FATAL ERROR: Option -setA (long form): need at least 2 datasets
    ** Program compile date = Jun 30 2016
  • ===== jobs have finished (1.00 s elapsed) =====
  • ===== starting 3dClustSim =====
    ++ 3dClustSim: AFNI version=AFNI_16.1.28 (Jun 30 2016) [64-bit]
    ++ Authored by: RW Cox and BD Ward

Fatal Signal 11 (SIGSEGV) received
THD_open_tcat
THD_open_dataset
get_options
3dClustSim
Bottom of Debug Stack
** AFNI version = AFNI_16.1.28 Compile date = Jun 30 2016
** [[Precompiled binary linux_xorg7_64: Jun 30 2016]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /space/raid/home/dfareri/.afni.crashlog
** FATAL ERROR: ===== 3dClustSim command failed :-((( =====
** Program compile date = Jun 30 2016

Can you please update your AFNI binaries and try this command again? Even if it crashes, the newer version of 3dttest++ should output more information about what it’s doing as it progresses through the -Clustsim option, and that may help debug.

Also, if any of your input filenames or labels have spaces in them (that you used quotes to input to 3dttest++), then the -Clustsim option will probably fail.

Hi Bob,

Thanks for the suggestions. I had the AFNI binaries updated and attempted to re-run the analysis. If I understand your last point regarding spaces correctly, I don’t believe that is the case, but perhaps when you see the information below you might be able to let me know.

When attempting this in the updated version of AFNI, the main group results dataset is successfully written again, as is the residuals dataset. AFter that, it appears that the 3dclustsim is starting up just fine, but then an error message appears saying that AFNI cannot open the first subbrik of the residual dataset. I find this odd because the dataset is created and I am able to view it in AFNI. I have pasted below the output from the terminal beginning with the successful writing of the group data and the start of the clustsim section immediately following (sorry for the excessive length of what is below).

Thank you again,
Dominic

++ Output dataset ./NewStream_VSseed_7_13_2016_clustsimtest_82subs_ControlsPIs_age_motion_gender_checkforgroupdiffsinCBCLsubs_noCBCLregressors_080_fu1fixed_80overlapmask_clustsim+tlrc.BRIK
++ Output dataset ./3dttest_residuals_test_7_13_2016+tlrc.BRIK

  • 2-sample test: results are ControlsRest - PIsResting
    ++ ================ Starting -clustsim calculations ================
  • ===== temporary files will have prefix TT.w4azUGC0cxp =====
  • ===== running 16 -randomsign jobs (626 iterations per job) =====
  • #0 jobs command:
    3dttest++ -DAFNI_AUTOMATIC_FDR=NO -DAFNI_DONT_LOGFILE=YES -randomsign 626 -nomeans -toz -no1sam -mask /space/raid6/data/totten/SB/scripts/Restingstate2015/df_CT_PI_5_2015/GroupAnalysisScripts/Final_8_2015/6_29_2016_82subs_groupEPImask_80percentoverlap+tlrc.BRIK -covariates /space/raid3/data/totten/SB/scripts/Restingstate2015/df_CT_PI_5_2015/CovariateFiles/Final_8_2015/CTminusPIscovariates_age_motion_gender_82subs_6_15_2016_checkforgroupdiffsinCBCLsubs_noCBCLregressors.1D -center SAME -setA rAAA SB115_fu1 3dttest_residuals_test_7_13_2016’[0]’ SB184 3dttest_residuals_test_7_13_2016’[1]’ SB061 3dttest_residuals_test_7_13_2016’[2]’ SB300_fu1 3dttest_residuals_test_7_13_2016’[3]’ SB235_fu1 3dttest_residuals_test_7_13_2016’[4]’ SB190 3dttest_residuals_test_7_13_2016’[5]’ SB152_fu1 3dttest_residuals_test_7_13_2016’[6]’ SB276 3dttest_residuals_test_7_13_2016’[7]’ SB144 3dttest_residuals_test_7_13_2016’[8]’ SB001 3dttest_residuals_test_7_13_2016’[9]’ SB236_fu1 3dttest_residuals_test_7_13_2016’[10]’ SB131_fu1 3dttest_residuals_test_7_13_2016’[11]’ SB234_fu1 3dttest_residuals_test_7_13_2016’[12]’ SB164_fu1 3dttest_residuals_test_7_13_2016’[13]’ SB197_fu1 3dttest_residuals_test_7_13_2016’[14]’ SB283 3dttest_residuals_test_7_13_2016’[15]’ SB258_fu1 3dttest_residuals_test_7_13_2016’[16]’ SB274 3dttest_residuals_test_7_13_2016’[17]’ SB112 3dttest_residuals_test_7_13_2016’[18]’ SB240_fu1 3dttest_residuals_test_7_13_2016’[19]’ SB207_fu1 3dttest_residuals_test_7_13_2016’[20]’ SB297 3dttest_residuals_test_7_13_2016’[21]’ SB245_fu1 3dttest_residuals_test_7_13_2016’[22]’ SB198_fu1 3dttest_residuals_test_7_13_2016’[23]’ SB034_fu1 3dttest_residuals_test_7_13_2016’[24]’ SB134_fu1 3dttest_residuals_test_7_13_2016’[25]’ SB067_fu1 3dttest_residuals_test_7_13_2016’[26]’ SB091_fu1 3dttest_residuals_test_7_13_2016’[27]’ SB264 3dttest_residuals_test_7_13_2016’[28]’ SB181_fu1 3dttest_residuals_test_7_13_2016’[29]’ SB135_fu1 3dttest_residuals_test_7_13_2016’[30]’ SB218 3dttest_residuals_test_7_13_2016’[31]’ SB182 3dttest_residuals_test_7_13_2016’[32]’ SB278 3dttest_residuals_test_7_13_2016’[33]’ SB036_fu1 3dttest_residuals_test_7_13_2016’[34]’ SB108 3dttest_residuals_test_7_13_2016’[35]’ SB186 3dttest_residuals_test_7_13_2016’[36]’ SB011_fu1 3dttest_residuals_test_7_13_2016’[37]’ SB298 3dttest_residuals_test_7_13_2016’[38]’ SB217 3dttest_residuals_test_7_13_2016’[39]’ SB306_fu1 3dttest_residuals_test_7_13_2016’[40]’ SB320 3dttest_residuals_test_7_13_2016’[41]’ SB007_fu1 3dttest_residuals_test_7_13_2016’[42]’ SB105_fu1 3dttest_residuals_test_7_13_2016’[43]’ SB299 3dttest_residuals_test_7_13_2016’[44]’ -setB rBBB SB085 3dttest_residuals_test_7_13_2016’[45]’ SB068 3dttest_residuals_test_7_13_2016’[46]’ SB046_fu1 3dttest_residuals_test_7_13_2016’[47]’ SB322 3dttest_residuals_test_7_13_2016’[48]’ SB025_fu1 3dttest_residuals_test_7_13_2016’[49]’ SB307_fu1 3dttest_residuals_test_7_13_2016’[50]’ SB147 3dttest_residuals_test_7_13_2016’[51]’ SB205 3dttest_residuals_test_7_13_2016’[52]’ SB227 3dttest_residuals_test_7_13_2016’[53]’ SB081_fu1 3dttest_residuals_test_7_13_2016’[54]’ SB130 3dttest_residuals_test_7_13_2016’[55]’ SB291_fu1 3dttest_residuals_test_7_13_2016’[56]’ SB080_fu1 3dttest_residuals_test_7_13_2016’[57]’ SB069 3dttest_residuals_test_7_13_2016’[58]’ SB021_fu1 3dttest_residuals_test_7_13_2016’[59]’ SB041_fu1 3dttest_residuals_test_7_13_2016’[60]’ SB127_fu1 3dttest_residuals_test_7_13_2016’[61]’ SB140_fu1 3dttest_residuals_test_7_13_2016’[62]’ SB199 3dttest_residuals_test_7_13_2016’[63]’ SB312_fu1 3dttest_residuals_test_7_13_2016’[64]’ SB327 3dttest_residuals_test_7_13_2016’[65]’ SB206 3dttest_residuals_test_7_13_2016’[66]’ SB139 3dttest_residuals_test_7_13_2016’[67]’ SB332_fu1 3dttest_residuals_test_7_13_2016’[68]’ SB220_fu1 3dttest_residuals_test_7_13_2016’[69]’ SB136 3dttest_residuals_test_7_13_2016’[70]’ SB072_fu1 3dttest_residuals_test_7_13_2016’[71]’ SB124_fu1 3dttest_residuals_test_7_13_2016’[72]’ SB123_fu1 3dttest_residuals_test_7_13_2016’[73]’ SB030_fu1 3dttest_residuals_test_7_13_2016’[74]’ SB336_fu1 3dttest_residuals_test_7_13_2016’[75]’ SB087_fu1 3dttest_residuals_test_7_13_2016’[76]’ SB328 3dttest_residuals_test_7_13_2016’[77]’ SB196 3dttest_residuals_test_7_13_2016’[78]’ SB242_fu1 3dttest_residuals_test_7_13_2016’[79]’ SB058_fu1 3dttest_residuals_test_7_13_2016’[80]’ SB148_fu1 3dttest_residuals_test_7_13_2016’[81]’ -prefix TT.w4azUGC0cxp.000.nii
    ++ 3dttest++: AFNI version=AFNI_16.2.01 (Jul 9 2016) [64-bit]
    ++ Authored by: Zhark++
    ++ 49053 voxels in -mask dataset
    ++ Covariates file: 4 columns, each with 82 rows
  • Covariate column labels: Subject;Age;Gender;Motion
  • Found 3 numeric columns: Age Gender Motion
    ** FATAL ERROR: Option -setA: can’t open dataset ‘3dttest_residuals_test_7_13_2016[0]’
    ** Program compile date = Jul 9 2016
  • ===== jobs have finished (10.01 s elapsed) =====
  • ===== starting 3dClustSim =====
    3dClustSim -DAFNI_DONT_LOGFILE=YES -inset TT.w4azUGC0cxp.???.nii -prefix TT.w4azUGC0cxp.CSim -LOTS -both -cmd TT.w4azUGC0cxp.CSim.cmd -mask /space/raid6/data/totten/SB/scripts/Restingstate2015/df_CT_PI_5_2015/GroupAnalysisScripts/Final_8_2015/6_29_2016_82subs_groupEPImask_80percentoverlap+tlrc.BRIK
    ++ 3dClustSim: AFNI version=AFNI_16.2.01 (Jul 9 2016) [64-bit]
    ++ Authored by: RW Cox and BD Ward

Fatal Signal 11 (SIGSEGV) received
THD_open_tcat
THD_open_dataset
get_options
3dClustSim
Bottom of Debug Stack
** AFNI version = AFNI_16.2.01 Compile date = Jul 9 2016
** [[Precompiled binary linux_openmp_64: Jul 9 2016]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /space/raid/home/dfareri/.afni.crashlog
** FATAL ERROR: ===== 3dClustSim command failed :-((( =====
** Program compile date = Jul 9 2016

I think I see the problem. There’s a bug if you use the ‘-resid’ option with the ‘-ClustSim’ option. Remove the ‘-resid’ option and try it again.

I’ll try to fix the bug soon, but you can do what I just suggested now and report back.

Hmmmm, I thought using ‘?’ as wildcards was
not legal in THD_open_tcat, but now I am not
sure. I will look closer, too.

  • rick

I fixed the crash in THD_open_tcat (my fault),
so at least any failure should be less obnoxious…

  • rick

Thanks, Bob, it ran after removing -resid.