code: def compose_ants_transforms(transform_list):
      
      precision = transform_list[0].precision
      dimension = transform_list[0].dimension
  
      for tx in transform_list:
          if precision != tx.precision:
              raise ValueError('All transforms must have the same precision')
          if dimension != tx.dimension:
              raise ValueError('All transforms must have the same dimension')
  
      tx_ptr_list = list(reversed([tf.pointer for tf in transform_list]))
      libfn = utils.get_lib_fn('composeTransforms%s' % (transform_list[0]._libsuffix))
      itk_composed_tx = libfn(tx_ptr_list, precision, dimension)
      return ANTsTransform(precision=precision, dimension=dimension,
                          transform_type='CompositeTransform', pointer=itk_composed_tx)
docs: Compose multiple ANTsTransform's together
  
      ANTsR function: `composeAntsrTransforms`
  
      Arguments
      ---------
      transform_list : list/tuple of ANTsTransform object
          list of transforms to compose together
  
      Returns
      -------
      ANTsTransform
          one transform that contains all given transforms
  
      Example
      -------
      >>> import ants
      >>> img = ants.image_read(ants.get_ants_data("r16")).clone('float')
      >>> tx = ants.new_ants_transform(dimension=2)
      >>> tx.set_parameters((0.9,0,0,1.1,10,11))
      >>> inv_tx = tx.invert()
      >>> single_tx = ants.compose_ants_transforms([tx, inv_tx])
      >>> img_orig = single_tx.apply_to_image(img, img)
      >>> rRotGenerator = ants.contrib.RandomRotate2D( ( 0, 40 ), reference=img )
      >>> rShearGenerator=ants.contrib.RandomShear2D( (0,50), reference=img )
      >>> tx1 = rRotGenerator.transform()
      >>> tx2 = rShearGenerator.transform()
      >>> rSrR = ants.compose_ants_transforms([tx1, tx2])
      >>> rSrR.apply_to_image( img )