code: def xslice(x, y_spec, z_spec, world):
      """
      Return an LPS slice through a 3d box with x fixed.
  
      Parameters
      ----------
      x : float
         The value at which x is fixed.
      y_spec : sequence
         A sequence with 2 values of form ((float, float), int). The
         (float, float) components are the min and max y values; the int
         is the number of points.
      z_spec : sequence
         As for `y_spec` but for z
      world : str or CoordinateSystem CoordSysMaker or XYZSpace
          World 3D space to which resulting coordmap refers
  
      Returns
      -------
      affine_transform : AffineTransform
         An affine transform that describes an plane in
         LPS coordinates with x fixed.
  
      Examples
      --------
      >>> y_spec = ([-114,114], 115) # voxels of size 2 in y, starting at -114, ending at 114
      >>> z_spec = ([-70,100], 86) # voxels of size 2 in z, starting at -70, ending at 100
      >>> x30 = xslice(30, y_spec, z_spec, 'scanner')
      >>> x30([0,0])
      array([  30., -114.,  -70.])
      >>> x30([114,85])
      array([  30.,  114.,  100.])
      >>> x30
      AffineTransform(
         function_domain=CoordinateSystem(coord_names=('i_y', 'i_z'), name='slice', coord_dtype=float64),
         function_range=CoordinateSystem(coord_names=('scanner-x=L->R', 'scanner-y=P->A', 'scanner-z=I->S'), name='scanner', coord_dtype=float64),
         affine=array([[   0.,    0.,   30.],
                       [   2.,    0., -114.],
                       [   0.,    2.,  -70.],
                       [   0.,    0.,    1.]])
      )
      >>> bounding_box(x30, (y_spec[1], z_spec[1]))
      ((30.0, 30.0), (-114.0, 114.0), (-70.0, 100.0))
      """
      affine_range = get_world_cs(world)
      (ymin, ymax), yno = y_spec
      y_tick = (ymax - ymin) / (yno - 1.0)
      (zmin, zmax), zno = z_spec
      z_tick = (zmax - zmin) / (zno - 1.0)
      origin = [x, ymin, zmin]
      colvectors = np.asarray([[0, 0], [y_tick, 0], [0, z_tick]])
      T = from_matvec(colvectors, origin)
      affine_domain = CoordinateSystem(["i_y", "i_z"], "slice")
      return AffineTransform(affine_domain, affine_range, T)
  
file_path: nipy/nipy/core/reference/slices.py
imports: import numpy
  from nibabel.affines import from_matvec
  from .array_coords import ArrayCoordMap
  from .coordinate_map import AffineTransform
  from .coordinate_system import CoordinateSystem
  from .spaces import get_world_cs
label_desc: Use image node_id 1 for calling a global function with example usage: xslice(x, y_spec, z_spec, world) and returns: AffineTransform