Has this issue been resolved? I've gotten the same error when I provide fewer than three datasets (i.e. subjects).
++ 3dTstat: AFNI version=AFNI_2007_05_29_1644 (Aug 10 2007) [64-bit]
++ Authored by: KR Hammett & RW Cox
** FATAL ERROR: Can't use dataset with < 2 values per voxel!
I believe this is because 3dTstat is summing all singular values except the first one:
3dTstat -sum -prefix SEM_resvar_roi${roi} SEM_sv2_roi${roi}.1D'{1..$}'\'
So that if there are only two datasets, there will be only one input value after excluding the first sv. A quick and dirty solution is to append a 0 to the end of the input file for 3dTstat. I don't think it should affect any calculations elsewhere.
echo "0" >> SEM_sv2_roi${roi}.1D
3dTstat -sum -prefix SEM_resvar_roi${roi} SEM_sv2_roi${roi}.1D'{1..$}'\'
Anyway, perhaps this is a moot point given that running SEM on only two subjects is not likely desirable.