handled dimension change from nifti to nibabel packages

Sorry. There seems to be some error in the last pull request, couldn't find all the changes I made.
Please update.