rsroi: random sampling of n voxels from a mask(can be used to reduce a mask to n voxels)
rsmathutils: ensure that the allocated memory is actually granted for d2matrix