{"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 \nimport pandas as pd \nimport os\n\nimport glob\nimport cv2\nimport pydicom\nfrom pydicom.pixel_data_handlers.util import apply_voi_lut, apply_modality_lut\n\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-12-07T00:52:01.096414Z","iopub.execute_input":"2022-12-07T00:52:01.096834Z","iopub.status.idle":"2022-12-07T00:52:01.208937Z","shell.execute_reply.started":"2022-12-07T00:52:01.096797Z","shell.execute_reply":"2022-12-07T00:52:01.207746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = pd.read_csv('/kaggle/input/rsna-breast-cancer-detection/train.csv')\ntrain_df['path'] ='/kaggle/input/rsna-breast-cancer-detection/train_images/'+ train_df['patient_id'].astype(str) +'/'+train_df['image_id'].astype(str) + '.dcm'","metadata":{"execution":{"iopub.status.busy":"2022-12-07T00:51:03.998054Z","iopub.execute_input":"2022-12-07T00:51:03.998446Z","iopub.status.idle":"2022-12-07T00:51:04.171275Z","shell.execute_reply.started":"2022-12-07T00:51:03.998415Z","shell.execute_reply":"2022-12-07T00:51:04.170014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2022-12-07T00:51:18.822562Z","iopub.execute_input":"2022-12-07T00:51:18.822934Z","iopub.status.idle":"2022-12-07T00:51:18.846036Z","shell.execute_reply.started":"2022-12-07T00:51:18.8229Z","shell.execute_reply":"2022-12-07T00:51:18.844923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dcm_img = pydicom.dcmread(train_df['path'][0])","metadata":{"execution":{"iopub.status.busy":"2022-12-07T00:54:20.999429Z","iopub.execute_input":"2022-12-07T00:54:20.999848Z","iopub.status.idle":"2022-12-07T00:54:21.137866Z","shell.execute_reply.started":"2022-12-07T00:54:20.999817Z","shell.execute_reply":"2022-12-07T00:54:21.13682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dcm_img","metadata":{"execution":{"iopub.status.busy":"2022-12-07T00:54:21.143157Z","iopub.execute_input":"2022-12-07T00:54:21.143548Z","iopub.status.idle":"2022-12-07T00:54:21.152767Z","shell.execute_reply.started":"2022-12-07T00:54:21.143513Z","shell.execute_reply":"2022-12-07T00:54:21.151507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"img = dcm_img.pixel_array\nplt.imshow(img, cmap = 'gray_r')","metadata":{"execution":{"iopub.status.busy":"2022-12-07T00:57:17.823741Z","iopub.execute_input":"2022-12-07T00:57:17.824191Z","iopub.status.idle":"2022-12-07T00:57:19.778925Z","shell.execute_reply.started":"2022-12-07T00:57:17.824154Z","shell.execute_reply":"2022-12-07T00:57:19.777801Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}