{"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_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-06-11T23:11:04.179105Z","iopub.execute_input":"2021-06-11T23:11:04.179449Z","iopub.status.idle":"2021-06-11T23:11:04.184544Z","shell.execute_reply.started":"2021-06-11T23:11:04.17942Z","shell.execute_reply":"2021-06-11T23:11:04.183288Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nfrom pydicom import dcmread\nfrom pydicom.data import get_testdata_file","metadata":{"execution":{"iopub.status.busy":"2021-06-11T23:10:36.676674Z","iopub.execute_input":"2021-06-11T23:10:36.677106Z","iopub.status.idle":"2021-06-11T23:10:36.682923Z","shell.execute_reply.started":"2021-06-11T23:10:36.677061Z","shell.execute_reply":"2021-06-11T23:10:36.68136Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filename = \"000c9c05fd14/e555410bd2cd/51759b5579bc.dcm\"\npath=\"../input/siim-covid19-detection/train/\"\nds = dcmread(path+filename)\n# Normal mode:\nprint()\nprint(f\"File path........: {path+filename}\")\nprint(f\"SOP Class........: {ds.SOPClassUID} ({ds.SOPClassUID.name})\")\nprint()\n\npat_name = ds.PatientName\ndisplay_name = pat_name.family_name + \", \" + pat_name.given_name\nprint(f\"Patient's Name...: {display_name}\")\nprint(f\"Patient ID.......: {ds.PatientID}\")\nprint(f\"Modality.........: {ds.Modality}\")\nprint(f\"Study Date.......: {ds.StudyDate}\")\nprint(f\"Image size.......: {ds.Rows} x {ds.Columns}\")\n#print(f\"Pixel Spacing....: {ds.PixelSpacing}\")\nplt.imshow(ds.pixel_array, cmap=plt.cm.gray)\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2021-06-11T23:10:36.684501Z","iopub.execute_input":"2021-06-11T23:10:36.684815Z","iopub.status.idle":"2021-06-11T23:10:37.741229Z","shell.execute_reply.started":"2021-06-11T23:10:36.684775Z","shell.execute_reply":"2021-06-11T23:10:37.739976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"pltcn=0\nfor dirname, _, filenames in os.walk('/kaggle/input/siim-covid19-detection/train'):\n    for filename in filenames:\n        mydcm=dcmread(os.path.join(dirname, filename))\n        plt.imshow(mydcm.pixel_array, cmap=plt.cm.gray)\n        plt.show()\n        pltcn+=1\n        print(pltcn)\n    if pltcn>9:\n        break","metadata":{"execution":{"iopub.status.busy":"2021-06-11T23:10:37.743194Z","iopub.execute_input":"2021-06-11T23:10:37.743477Z","iopub.status.idle":"2021-06-11T23:10:48.437653Z","shell.execute_reply.started":"2021-06-11T23:10:37.743451Z","shell.execute_reply":"2021-06-11T23:10:48.436168Z"},"trusted":true},"execution_count":null,"outputs":[]}]}