handled dimension change from nifti to nibabel packages