code: def binarize_ppm(q):
      """
      Assume input ppm is masked (ndim==2)
      """
      bin_q = np.zeros(q.shape)
      bin_q[: q.shape[0], np.argmax(q, axis=1)] = 1
      return bin_q
  
file_path: nipy/nipy/algorithms/segmentation/segmentation.py
imports: import numpy
  from ._segmentation import _interaction_energy, _ve_step
label_desc: Use image node_id 4 for calling a global function with example usage: binarize_ppm(q) and returns: bin_q