How would you like to process these MRI images?
If you want to process all 500 slices at once, you might want to use 3-dimensional layers, e.g. nn.Conv3d.
Alternatively, if you would like to use each slice as a sample, you might use the 500 slices directly as the batch dimension.