I have deforamtion vector field nifti files which consitis of 5 dimensions. For example, (127, 203, 161, 1, 3). These data are in PLI orientation. Now I want to convert them into RAS orientation.
I can convert and save any 3D nifiti files directly to RAS format using following few lines.
img_can = nibabel.load(img_vol_path)
canonical_img = nibabel.as_closest_canonical(img_can)
updated_image = nibabel.Nifti1Image(numpy.asanyarray(canonical_img.dataobj), canonical_img.affine)
nibabel.save(updated_image, output_nifti_Path)
My question is how can I convert them into RAS oreintaion using nibabel ? Can I use the same procedure to convert 5 dimensional data ?
I’m asking because the created 5-dim file after using the aforementioned procedure cannot be opened with simpleITK. The original 5-dim file, however, possible to open with simpleItk. THe error message I have got is as below.
Exception thrown in SimpleITK ReadImage: .\src\sitkImageFileReader.cxx:325:
sitk::ERROR: The file has unsupported 5 dimensions.
Please help me to resolve this issue.