{"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":"#!conda install gdcm -c conda-forge -y","metadata":{"execution":{"iopub.status.busy":"2021-06-23T03:44:02.073639Z","iopub.execute_input":"2021-06-23T03:44:02.074251Z","iopub.status.idle":"2021-06-23T03:44:38.637210Z","shell.execute_reply.started":"2021-06-23T03:44:02.074194Z","shell.execute_reply":"2021-06-23T03:44:38.636137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:15:43.776280Z","iopub.execute_input":"2021-06-23T05:15:43.776675Z","iopub.status.idle":"2021-06-23T05:15:51.048119Z","shell.execute_reply.started":"2021-06-23T05:15:43.776623Z","shell.execute_reply":"2021-06-23T05:15:51.047012Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# CSV Preprocess","metadata":{}},{"cell_type":"code","source":"study = pd.read_csv('../input/siim-covid19-detection/train_study_level.csv')\nprint(study.shape)\nstudy.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:26:19.233857Z","iopub.execute_input":"2021-06-23T05:26:19.234379Z","iopub.status.idle":"2021-06-23T05:26:19.272306Z","shell.execute_reply.started":"2021-06-23T05:26:19.234345Z","shell.execute_reply":"2021-06-23T05:26:19.270730Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"study.replace(regex=['_study'], value='',inplace=True)\nstudy.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:37:27.123413Z","iopub.execute_input":"2021-06-23T05:37:27.123776Z","iopub.status.idle":"2021-06-23T05:37:27.156530Z","shell.execute_reply.started":"2021-06-23T05:37:27.123745Z","shell.execute_reply":"2021-06-23T05:37:27.155576Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"study.rename(columns={\"id\":\"StudyInstanceUID\"}, inplace=True)\nstudy.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:42:25.704469Z","iopub.execute_input":"2021-06-23T05:42:25.704814Z","iopub.status.idle":"2021-06-23T05:42:25.717873Z","shell.execute_reply.started":"2021-06-23T05:42:25.704787Z","shell.execute_reply":"2021-06-23T05:42:25.716983Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"image = pd.read_csv('../input/siim-covid19-detection/train_image_level.csv')\nprint(image.shape)\nimage.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:38:59.657179Z","iopub.execute_input":"2021-06-23T05:38:59.657740Z","iopub.status.idle":"2021-06-23T05:38:59.706216Z","shell.execute_reply.started":"2021-06-23T05:38:59.657699Z","shell.execute_reply":"2021-06-23T05:38:59.704918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"image.replace(regex=['_image'], value='',inplace=True)\nimage.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:39:19.410736Z","iopub.execute_input":"2021-06-23T05:39:19.411063Z","iopub.status.idle":"2021-06-23T05:39:19.470375Z","shell.execute_reply.started":"2021-06-23T05:39:19.411037Z","shell.execute_reply":"2021-06-23T05:39:19.469103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.merge(image,study,on=\"StudyInstanceUID\")\ndf","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:45:43.397989Z","iopub.execute_input":"2021-06-23T05:45:43.398528Z","iopub.status.idle":"2021-06-23T05:45:43.442316Z","shell.execute_reply.started":"2021-06-23T05:45:43.398483Z","shell.execute_reply":"2021-06-23T05:45:43.440980Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.to_csv(\"siim-covid19-detection.csv\",index=False)","metadata":{"execution":{"iopub.status.busy":"2021-06-23T05:51:15.869229Z","iopub.execute_input":"2021-06-23T05:51:15.869854Z","iopub.status.idle":"2021-06-23T05:51:15.924841Z","shell.execute_reply.started":"2021-06-23T05:51:15.869819Z","shell.execute_reply":"2021-06-23T05:51:15.923630Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# dcm-to-png","metadata":{}},{"cell_type":"code","source":"https://www.kaggle.com/haiyunhu/siim-covid19-dicom-to-png","metadata":{"execution":{"iopub.status.busy":"2021-06-23T03:44:38.761794Z","iopub.execute_input":"2021-06-23T03:44:38.762117Z","iopub.status.idle":"2021-06-23T03:44:39.267204Z","shell.execute_reply.started":"2021-06-23T03:44:38.762088Z","shell.execute_reply":"2021-06-23T03:44:39.266140Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}