class_docstr: Compute confidence map from an ultrasound image.
  This transform uses the method introduced by Karamalis et al. in https://doi.org/10.1016/j.media.2012.07.005.
  It generates a confidence map by setting source and sink points in the image and computing the probability
  for random walks to reach the source for each pixel.
  
  Args:
      alpha (float, optional): Alpha parameter. Defaults to 2.0.
      beta (float, optional): Beta parameter. Defaults to 90.0.
      gamma (float, optional): Gamma parameter. Defaults to 0.05.
      mode (str, optional): 'RF' or 'B' mode data. Defaults to 'B'.
      sink_mode (str, optional): Sink mode. Defaults to 'all'. If 'mask' is selected, a mask must be when calling
          the transform. Can be 'all', 'mid', 'min', or 'mask'.
docstr: Converts row and column subscripts into linear indices,
  basically the copy of the MATLAB function of the same name.
  https://www.mathworks.com/help/matlab/ref/sub2ind.html
  
  This function is Pythonic so the indices start at 0.
  
  Args:
      size Tuple[int]: Size of the matrix
      rows (NDArray): Row indices
      cols (NDArray): Column indices
  
  Returns:
      indices (NDArray): 1-D array of linear indices
docstr_tok: ["Converts","row","and","column","subscripts","into","linear","indices",",","basically","the","copy","of","the","MATLAB","function","of","the","same","name",".","https",":","\/\/www.mathworks.com\/help\/matlab\/ref\/sub2ind.html","This","function","is","Pythonic","so","the","indices","start","at","0",".","Args",":","size","Tuple","[","int","]",":","Size","of","the","matrix","rows","(","NDArray",")",":","Row","indices","cols","(","NDArray",")",":","Column","indices","Returns",":","indices","(","NDArray",")",":","1-D","array","of","linear","indices"]
code: def sub2ind(
      self, size: tuple[int, ...], rows: NDArray, cols: NDArray
  ) -> NDArray:
      """Converts row and column subscripts into linear indices,
      basically the copy of the MATLAB function of the same name.
      https://www.mathworks.com/help/matlab/ref/sub2ind.html
  
      This function is Pythonic so the indices start at 0.
  
      Args:
          size Tuple[int]: Size of the matrix
          rows (NDArray): Row indices
          cols (NDArray): Column indices
  
      Returns:
          indices (NDArray): 1-D array of linear indices
      """
      indices: NDArray = rows + cols * size[0]
      return indices
  
file_path: MONAI/monai/data/ultrasound_confidence_map.py
imports: from __future__ import annotations
  import numpy
  from numpy.typing import NDArray
  from monai.utils import min_version, optional_import
label_desc: Use image node_id 2 for calling the UltrasoundConfidenceMap obj's underlying member method code with example usage: obj.sub2ind(size, rows, cols) and returns: indices