/// <summary> /// Gets the pixel spacings from the DICOM dataset. /// </summary> /// <param name="dicomDataset">The DICOM dataset.</param> /// <returns>The pixel spacings.</returns> /// <exception cref="ArgumentNullException">The provided DICOM dataset was null.</exception> /// <exception cref="ArgumentException">The provided DICOM dataset did not contain the 'PixelSpacing' tag or the tag did not have 2 parts.</exception> public static (double SpacingX, double SpacingY) GetPixelSpacings(this DicomDataset dicomDataset) { dicomDataset = dicomDataset ?? throw new ArgumentNullException(nameof(dicomDataset)); return(dicomDataset.GetPixelSpacingX(), dicomDataset.GetPixelSpacingY()); }