Thanks to you two for your answers!
Yes it is exactly what I mean a 503x100000 voxels (for example). Thanks, I'm going to try these options.
But indeed, as you point out it would give a very large matrix ...
Actually, I was wondering if it is possible to use a different grid for both inputs? : for example a 2x2x2 grid for the region of interest of 503 voxels, and a resample grid to 4x4x4 for the whole brain mask. (in order to reduce the computing time).