docs: def ravd(result, reference):
      """
      Relative absolute volume difference.
      
      Compute the relative absolute volume difference between the (joined) binary objects
      in the two images.
      
      Parameters
      ----------
      result : array_like
          Input data containing objects. Can be any type but will be converted
          into binary: background where 0, object everywhere else.
      reference : array_like
          Input data containing objects. Can be any type but will be converted
          into binary: background where 0, object everywhere else.
          
      Returns
      -------
      ravd : float
          The relative absolute volume difference between the object(s) in ``result``
          and the object(s) in ``reference``. This is a percentage value in the range
          :math:`[-1.0, +inf]` for which a :math:`0` denotes an ideal score.
          
      Raises
      ------
      RuntimeError
          If the reference object is empty.
          
      See also
      --------
      :func:`dc`
      :func:`precision`
      :func:`recall`
      
      Notes
      -----
      This is not a real metric, as it is directed. Negative values denote a smaller
      and positive values a larger volume than the reference.
      This implementation does not check, whether the two supplied arrays are of the same
      size.
      
      Examples
      --------
      Considering the following inputs
      
      >>> import numpy
      >>> arr1 = numpy.asarray([[0,1,0],[1,1,1],[0,1,0]])
      >>> arr1
      array([[0, 1, 0],
             [1, 1, 1],
             [0, 1, 0]])
      >>> arr2 = numpy.asarray([[0,1,0],[1,0,1],[0,1,0]])
      >>> arr2
      array([[0, 1, 0],
             [1, 0, 1],
             [0, 1, 0]])
             
      comparing `arr1` to `arr2` we get
      
      >>> ravd(arr1, arr2)
      -0.2
      
      and reversing the inputs the directivness of the metric becomes evident
      
      >>> ravd(arr2, arr1)
      0.25
      
      It is important to keep in mind that a perfect score of `0` does not mean that the
      binary objects fit exactely, as only the volumes are compared:
      
      >>> arr1 = numpy.asarray([1,0,0])
      >>> arr2 = numpy.asarray([0,0,1])
      >>> ravd(arr1, arr2)
      0.0
      
      """
      result = numpy.atleast_1d(result.astype(numpy.bool))
      reference = numpy.atleast_1d(reference.astype(numpy.bool))
          
      vol1 = numpy.count_nonzero(result)
      vol2 = numpy.count_nonzero(reference)
      
      if 0 == vol2:
          raise RuntimeError('The second supplied array does not contain any binary object.')
      
      return (vol1 - vol2) / float(vol2)