Let me see if I can help. First, I’ll just note that what I’m going to describe is typical, but many details may not be mandatory in practice, and some may vary slightly over image type.
MRI data is organized in images, which are generally going to be 3D or 4D data files. A 3D image is said to contain a volume, and a 4D image is a series of concatenated volumes. If you’re looking at NIFTI files, these images contain a header of metadata about the image (such as orientation, dimensions and voxel size), followed by a 3- or 4D array, exactly as you would store a multi-dimensional array in memory. If you need to get a more concrete handle on what a volume looks like, check out the first section of this tutorial.
Each image will pertain to one subject, and generally you’ll get multiple images per subject (structural, functional, diffusion, field maps, etc.). While you could concatenate these into a single file, in practice it’s preferable to keep them separate, and initiatives like BIDS exist to establish standard ways of organizing these files in directories.
If we assume you have 2 patients and 2 controls, your data directory (organized according to BIDS) might look like:
Each of the
*_T1w.nii.gz is a structural, T1-weighted image, stored as a 3D NIFTI image (i.e. one volume).
*_task-rest_bold.nii.gz file is a functional BOLD series, stored as a 4D NIFTI image (i.e. several concatenated volumes). You may have task data with multiple runs, or other modalities, but this should give a sense of how multiple subjects’ data can be stored coherently.
I would guess the reason you’re interested in combining data from patients is that you would like to perform group-level statistics on them. This requires some manipulation of your data, first.
- Normalize BOLD data into a common space. As people’s brains are different shapes, and may be angled differently in the scanner, you can’t assume that a given voxel coordinate contains data about the same region of two subjects’ brains. This is the target of preprocessing (which also includes a number of other steps to improve the quality of data). If your data is organized in BIDS format, you can try using fMRIPrep. This will not only generate normalized BOLD series, but also reports that will help you understand the process, and see if anything went wrong.
- Perform first-level statistics within individual subjects. Generally speaking, you will want to take some measure from each subject, such as a BOLD contrast between conditions. The output of this is a single 3D volume per-subject, where each voxel contains the measure at that 3D location. Because these are all in the same space, they can now be concatenated into a 4D image. Instead of time points, your fourth dimension will now be subject. This can then be assessed for, e.g., differences in that measure between your patient and control group.
I hope this wasn’t too broad an overview and was able to answer your questions somewhat, or at least provide context to help you form more specific questions.