The problem you have is the DICOM files are not always in the right order, numerically or alphabetically. We have the Dimon program available to check the order of the files and produce a sorted list and script (GERT_Reco...) to call to3d appropriately. So given 39 sub-bricks in each mosaic file EPI run, you can create a script like this to read this data.
foreach run (4 5 6 7 8 9)
Dimon -GERT_Reco -gert_nz 39 \
-gert_to3d_prefix mosaic39.$run \
-infile_pattern \
'Elizabeth_FINGER/2008_10_15_RM.MR.FINGER_FMRI.${run}.*.IMA' \
-dicom_org -quit \
-gert_filename GERT_reco$run
./GERT_reco$run
end
The other datasets seem to be anatomical datasets with missing slices in the first dataset.