{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceType":"competition","sourceId":71549,"databundleVersionId":8561470}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# Import libraries\nimport pydicom\nimport matplotlib.pyplot as plt\nimport os","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-10-24T12:24:36.741001Z","iopub.execute_input":"2024-10-24T12:24:36.742085Z","iopub.status.idle":"2024-10-24T12:24:36.747582Z","shell.execute_reply.started":"2024-10-24T12:24:36.742028Z","shell.execute_reply":"2024-10-24T12:24:36.746278Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Directory where dicom files are stored\nds = pydicom.dcmread(\"/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_images/4003253/702807833/9.dcm\")\n# Extract pixel data\npixel_array = ds.pixel_array\n# Display the image\nplt.figure(figsize=(6, 6))\nplt.imshow(pixel_array, cmap=plt.cm.bone)  # Use bone colormap for better contrast\nplt.axis('off')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T13:26:35.807843Z","iopub.execute_input":"2024-10-24T13:26:35.808274Z","iopub.status.idle":"2024-10-24T13:26:36.108033Z","shell.execute_reply.started":"2024-10-24T13:26:35.808228Z","shell.execute_reply":"2024-10-24T13:26:36.106847Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(ds)","metadata":{"execution":{"iopub.status.busy":"2024-10-24T13:26:41.119017Z","iopub.execute_input":"2024-10-24T13:26:41.120155Z","iopub.status.idle":"2024-10-24T13:26:41.127413Z","shell.execute_reply.started":"2024-10-24T13:26:41.120106Z","shell.execute_reply":"2024-10-24T13:26:41.126247Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{},"outputs":[],"execution_count":null}]}