Hi Daniel,
Thanks for your help. I am digging this data back up now and never really worked through this problem.
I tried your fix and it's almost there but I think that the real problem is the phase-encoding direction needs to be switched. I've used the help page from 3dQwarp to get me slightly further, I think.
##I used Dimon to bring all of the DICOM files into one functional file. I have checked the ${subID}_dicom_info file and the order seems to be correct.
Dimon -infile_pattern "*dcm" \
-gert_create_dataset \
-dicom_org \
-sort_by_acq_time \
-gert_write_as_nifti \
-gert_to3d_prefix tmp_${subID}_rest \
-save_details ${subID}_dicom_info
##But, as I described before, every other volume in this file seems to be oriented in opposite directions. I believe this is from the alternating phase-encoding directions for every other volume, i.e, vol.1 was acquired L-R and vol.2 was acquired R-L.
##Thus, I separated out the L-R and R-L volumes respectively.
3dbucket -overwrite -prefix tmp_${subID}_rest_LR.nii -fbuc 'tmp_${subID}_rest.nii[0..$(2)]'
3dbucket -overwrite -prefix tmp_${subID}_rest_RL.nii -fbuc 'tmp_${subID}_rest.nii[1..$(2)]'
##I then used 3dQwarp to find the appropriate warping matrix to warp the R-L volumes to L-R.
3dQwarp -overwrite -base tmp_${subID}_rest_LR.nii -source tmp_${subID}_rest_RL.nii -plusminus -pmNAMES RL LR -prefix tmp_${subID}_rest_phaseflip
##Finally, I applied this warp ONLY to the R-L volumes of the output from Dimon.
3dNwarpApply -overwrite -nwarp tmp_P0959_rest_phaseflip_LR_WARP+orig. -source 'tmp_P0959_rest.nii[1..$(2)]' -prefix P0959_rest.nii
##However, the output from 3dNwarpApply is only those warped volumes (R-L --> L-R). Is there a way to bring the original L-R volumes back as they were, interleaved with the R-L phase-encoded volumes?
Thanks so much for your help!