{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true,"scrolled":true},"cell_type":"code","source":"!ls -lah ../input","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0edcff8de6eeb4132716820e73421b15d2a2c81f"},"cell_type":"code","source":"import matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nimport numpy as np\nimport pydicom","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"b6d5ee59fde51c85a7b176bdee103a7b0c4f4658"},"cell_type":"code","source":"train_labels = pd.read_csv('../input/stage_1_train_labels.csv')\ntrain_labels.info()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"7d26c132fc6ad06f73070c931a3d754de17a983c"},"cell_type":"code","source":"train_labels.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"b6c6bcbd1fd577fdd899417aa42ec802941b4529"},"cell_type":"code","source":"dcm_data = pydicom.read_file('../input/stage_1_train_images/' + train_labels['patientId'][4]+ '.dcm')\nprint(dcm_data)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"eae3653e302713454ac4851cbccd6ba75b6eed59"},"cell_type":"code","source":"fig, m_axs = plt.subplots(1, 1)\nm_axs.imshow(dcm_data.pixel_array, cmap='bone')\nm_axs.add_patch(Rectangle(xy=(train_labels['x'][4], train_labels['y'][4]),\n                                width=train_labels['width'][4],\n                                height=train_labels['height'][4], \n                                 alpha = 0.5))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"835177217aaee275ed2175dc414fac0db20eaffa"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}