Datasets are sorted in the following order (going by memory):
- AFNI formatted datasets -- those datasets which are marked as having an "anatomical" type
- AFNI formatted datasets -- those datasets which are marked as having a "functional" type
- NIfTI formatted datasets
- ANALYZE formatted datasets (very rare now; controlled by environment variable AFNI_ANALYZE_DATASETS)
- CTF .mri and .svl formatted datasets (used by NIH MEG scanner software)
- .jpg and .png images (controlled by environment variable AFNI_IMAGE_DATASETS)
- Global datasets (controlled by environment variable AFNI_GLOBAL_SESSION)
- Any datasets read in later, for example when new files are added to the directory after AFNI starts and the program detects them
Within each group, they are ordered alphabetically (technically, the "collation" order).
However, if you read in multiple directories ("Sessions"), then the "All_Datasets" session is just the individual sessions mashed together.