code: def reorient_image2(image, orientation='RAS'):
      
      if image.dimension != 3:
          raise ValueError('image must have 3 dimensions')
  
      inpixeltype = image.pixeltype
      ndim = image.dimension
      if image.pixeltype != 'float':
          image = image.clone('float')
  
      libfn = utils.get_lib_fn('reorientImage2')
      itkimage = libfn(image.pointer, orientation)
  
      new_img = iio.ANTsImage(pixeltype='float', dimension=ndim, 
                           components=image.components, pointer=itkimage)#.clone(inpixeltype)
      if inpixeltype != 'float':
          new_img = new_img.clone(inpixeltype)
      return new_img
docs: Reorient an image.
  
  
      Example
      -------
      >>> import ants
      >>> mni = ants.image_read(ants.get_data('mni'))
      >>> mni2 = mni.reorient_image2()