# pydicom.pixels.utils.get_nr_frames

pydicom.pixels.utils.get_nr_frames(ds: Dataset, warn: bool = True) → int

  Return NumberOfFrames or 1 if NumberOfFrames is None or 0.

  Parameters:

    - ds (dataset.Dataset) – The `Dataset` containing the Image Pixel module corresponding to the data in arr.

    - warn (bool) – If `True` (the default), a warning is issued if NumberOfFrames has an invalid value.

  Returns:

    An integer for the NumberOfFrames or 1 if NumberOfFrames is None or 0

  Return type:

    int