/usr/lib/python2.7/dist-packages/dicom/testfiles/test.py is in python-dicom 0.9.9-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # test.py
"""Temporary test file for pydicom development; will change over revisions
as test various things
"""
# Copyright (c) 2013 Darcy Mason
# This file is part of pydicom, relased under an MIT-style license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
#
import dicom
# dicom.debug()
if __name__ == "__main__":
dcmdir = dicom.read_dicomdir()
for patrec in dcmdir.patient_records:
print("Patient: {0.PatientID}: {0.PatientsName}".format(patrec))
studies = patrec.children
for study in studies:
print(" Study {0.StudyID}: {0.StudyDate}:"
" {0.StudyDescription}".format(study))
all_series = study.children
for series in all_series:
image_count = len(series.children)
plural = ('', 's')[image_count > 1]
print(" " * 8 + "Series {0.SeriesNumber}: {0.SeriesDescription}"
" ({1} image{2})".format(series, image_count, plural))
|