code: def rgb_to_vector(image):
      
      if image.pixeltype != 'unsigned char':
          image = image.clone('unsigned char')
      idim = image.dimension
      libfn = utils.get_lib_fn('RgbToVector%i' % idim)
      new_ptr = libfn(image.pointer)
      new_img = iio.ANTsImage(pixeltype=image.pixeltype, dimension=image.dimension, 
                              components=3, pointer=new_ptr, is_rgb=False)
      return new_img
docs: Convert an RGB ANTsImage to a Vector ANTsImage
  
      Arguments
      ---------
      image : ANTsImage
          RGB image to be converted
  
      Returns
      -------
      ANTsImage
  
      Example
      -------
      >>> import ants
      >>> mni = ants.image_read(ants.get_data('mni'))
      >>> mni_rgb = mni.scalar_to_rgb()
      >>> mni_vector = mni.rgb_to_vector()
      >>> mni_rgb2 = mni.vector_to_rgb()