class_docstr: An MPL axis-like object that displays a cut of 3D volumes
      
class_docstr_tok: ["An","MPL","axis-like","object","that","displays","a","cut","of","3D","volumes"]
docstr: Cut the 3D volume into a 2D slice
  
  Parameters
  ==========
  map: 3D ndarray
      The 3D volume to cut
  affine: 4x4 ndarray
      The affine of the volume
docstr_tok: ["Cut","the","3D","volume","into","a","2D","slice","Parameters","==========","map",":","3D","ndarray","The","3D","volume","to","cut","affine",":","4x4","ndarray","The","affine","of","the","volume"]
code: def do_cut(self, map, affine):
      """Cut the 3D volume into a 2D slice
  
      Parameters
      ==========
      map: 3D ndarray
          The 3D volume to cut
      affine: 4x4 ndarray
          The affine of the volume
      """
      coords = [0, 0, 0]
      coords["xyz".index(self.direction)] = self.coord
      x_map, y_map, z_map = (
          int(np.round(c))
          for c in coord_transform(
              coords[0], coords[1], coords[2], np.linalg.inv(affine)
          )
      )
      if self.direction == "y":
          cut = np.rot90(map[:, y_map, :])
      elif self.direction == "x":
          cut = np.rot90(map[x_map, :, :])
      elif self.direction == "z":
          cut = np.rot90(map[:, :, z_map])
      else:
          raise ValueError(
              f"Invalid value for direction {self.direction}"
          )
      return cut
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import transforms
  from nipy.utils import is_iterable
  from ..datasets import VolumeImg
  from .None import cm
  from .coord_tools import coord_transform, find_cut_coords, get_bounds, get_mask_bounds
  from .edge_detect import _edge_map
label_desc: Use image node_id 2 for calling the CutAxes obj's underlying member method code with example usage: obj.do_cut(map, affine) and returns: cut