{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import pydicom\nimport glob\nfrom pathlib import Path\n\ndef read_dicom_dir(dicom_path):\n    \"\"\"Reads a folder containing multiple .dcm files from a single patient\"\"\"\n    dcm_files = dicom_path.glob('*.dcm')\n    dicom_files = [pydicom.dcmread(str(x)) for x in dcm_files] \n    return dicom_files","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"tmp = read_dicom_dir(Path('../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184'))\nprint(tmp[0])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"tmp[0].SliceThickness # Verifying the dataset is v2, which added the SliceThickness tag","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"! md5sum ../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184/1.dcm","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}