.nii.gz output files and selecting which one to use in further analysis

Hi all,
I’m sure this will be a naive question. I’ve been successfully preprocessed data using fmriprep for the first time. I get these output files:


I have never preprocessed or worked with brain image data before, and as such I’m not exactly sure how to interpret the file names, so sorry if this question is dumb. I am going to be using these images in a deep neural network model (I want to use one image per subject). I am not sure which of these files I should use in the model, or what the purpose of all of them are. I just want to work with an image that has been registered to the MNI space, I’m not concerned with the WM/GM/CSF segmentations.
Would sub-02_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz work for this purpose?

Yes. That is a T1w image INU corrected and resampled to align with MNI152NLin2009cAsym.

Okay, it appears that the image in this file “sub-02_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz” has not been skull stripped (and is potentially even not in the MNI space?). The html report for this subject shows all of the images with the brain mask applied, skull stripped, and there is a clear difference between the images that have and haven’t been corregistered with MNI152NLin2009cAsym. However when I look at the actual output files that I listed above, (using the ImageJ software, but also in our model) I can’t actually find the images as displayed on the html files (skull stripped and in the MNI space). When I try to display them, many of the output files just show up as blank (specifically the WM/GM/CSF files). However, the html report shows the visualizations perfectly and that there were no errors during the run. Am I missing something big? Could it be that the report is taking like multiple files into account when it’s displaying those images? I’m sorry, I’m just confused.

Okay, nevermind, after reading around some similar posts on here I realize that the brain mask needs to be applied to the images post fmriprep and this is why they aren’t skull stripped. Sorry, I was under the impression that we would get output images directly as shown in the html reports. I assume this would be the file I need to go along with it:


So what separate program should I use for this task? I don’t really need much post-processing besides this step. Some of the other answers linked to more complicated workflows which is not something I want to do, is there a way I can just apply the brain mask to the output and use the resulting file?

Thanks so much for the help so far, I am still very new to this.

I use fslmaths ‘mul’ command to multiply the non-skull stripped brain by the binary brain mask.