code: def transform(self, X, y=None):
          
          insuffix = X._libsuffix
          multires_fn = utils.get_lib_fn('multiResolutionAntsImage%s' % (insuffix))
          casted_ptrs = multires_fn(X.pointer, self.levels)
          
          imgs = []
          for casted_ptr in casted_ptrs:
              img = iio.ANTsImage(pixeltype=X.pixeltype, dimension=X.dimension,
                                  components=X.components, pointer=casted_ptr)
              if self.keep_shape:
                  img = img.resample_image_to_target(X)
              imgs.append(img)
  
          return imgs
docs: Generate a set of multi-resolution ANTsImage types
  
          Arguments
          ---------
          X : ANTsImage
              image to transform
  
          y : ANTsImage (optional)
              another image to transform
  
          Example
          -------
          >>> import ants
          >>> multires = ants.contrib.MultiResolutionImage(levels=4)
          >>> img = ants.image_read(ants.get_data('r16'))
          >>> imgs = multires.transform(img)