fMRI ICA components Classification

Dear Collogues,

I am trying to do a deep learning model classifying my ICA components from fMRI data. My ICA components are of variable size and that brings up the problem when i load it in to the deep learning model. To solve this problem I am using a MNI template (2mm) to resample my entire list of ICA components which converts all my data to a common size (99,117, 95) but the problem is that the conversion making the data large and takes lot of time to convert the entire list of ICA components i have. Many of the times its getting time- because of MaxRSS in the compute server. I increased the size more than 600GB. Any thoughts on this is appreciated…

Why not mask the data to MNI grey matter. This wold significantly decrease data size.
The next step is to use online methods, but his requires some more implementation.

Thanks for the response! @bthirion. I used resample_img() function from nilearn to resize the image to a common size (52, 64, 48) (my images were more or less of this size). The I loaded the images as batch using an image generator function to train the deep learning model. It worked.