Could you explain the relationship between the initial dataset of [40000, 512, 512] and the 200 Nifti images?
Does each sample contain 200 images? In that case, could you deal with [40000, 512, 512, 200] images?