class_docstr: PAR/REC header
class_docstr_tok: ["PAR\/REC","header"]
docstr: Compute image zooms from header data.
  
  Spatial axis are first three.
  
  Returns
  -------
  zooms : array
      Length 3 array for 3D image, length 4 array for 4D image.
  
  Notes
  -----
  This routine gets called in ``__init__``, so may not be able to use
  some attributes available in the fully initialized object.
docstr_tok: ["Compute","image","zooms","from","header","data",".","Spatial","axis","are","first","three",".","Returns","--","--","--","-","zooms",":","array","Length","3","array","for","3D","image",",","length","4","array","for","4D","image",".","Notes","--","--","-","This","routine","gets","called","in","``","__init__","``",",","so","may","not","be","able","to","use","some","attributes","available","in","the","fully","initialized","object","."]
code: def _calc_zooms(self):
      """Compute image zooms from header data.
  
      Spatial axis are first three.
  
      Returns
      -------
      zooms : array
          Length 3 array for 3D image, length 4 array for 4D image.
  
      Notes
      -----
      This routine gets called in ``__init__``, so may not be able to use
      some attributes available in the fully initialized object.
      """
      # slice orientation for the whole image series
      slice_gap = self._get_unique_image_prop("slice gap")
      # scaling per image axis
      n_dim = 4 if self._get_n_vols() > 1 else 3
      zooms = np.ones(n_dim)
      # spatial sizes are inplane X mm, inplane Y mm + inter slice gap
      zooms[:2] = self._get_unique_image_prop("pixel spacing")
      slice_thickness = self._get_unique_image_prop("slice thickness")
      zooms[2] = slice_thickness + slice_gap
      # If 4D dynamic scan, convert time from milliseconds to seconds
      if len(zooms) > 3 and self.general_info["dyn_scan"]:
          if len(self.general_info["repetition_time"]) > 1:
              warnings.warn("multiple TRs found in .PAR file")
          zooms[3] = self.general_info["repetition_time"][0] / 1000.0
      return zooms
  
imports: import re
  import warnings
  from collections import OrderedDict
  from copy import deepcopy
  from io import StringIO
  from locale import getpreferredencoding
  import numpy
  from .affines import apply_affine, dot_reduce, from_matvec
  from .eulerangles import euler2mat
  from .fileslice import fileslice, strided_scalar
  from .nifti1 import unit_codes
  from .openers import ImageOpener
  from .spatialimages import SpatialHeader, SpatialImage
  from .volumeutils import Recoder, array_from_file
label_desc: Use image node_id 14 for calling the PARRECHeader obj's underlying member method code with example usage: obj._calc_zooms() and returns: zooms