{"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":"#!apt-get install dcm2niix parallel -y\n#!pip install heudiconv","metadata":{"execution":{"iopub.status.busy":"2021-09-15T19:15:49.184554Z","iopub.execute_input":"2021-09-15T19:15:49.185209Z","iopub.status.idle":"2021-09-15T19:15:49.200844Z","shell.execute_reply.started":"2021-09-15T19:15:49.185076Z","shell.execute_reply":"2021-09-15T19:15:49.199222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\n\ntrain_path = '/kaggle/input/rsna-miccai-brain-tumor-radiogenomic-classification/train'\nsubj_list = open(\"/kaggle/working/sub_list.txt\", \"w\")\nfor dirs, sub_dir, _ in os.walk(train_path):\n    for dir in sub_dir:\n        subj_list.write(dir + os.linesep)\n        ","metadata":{"execution":{"iopub.status.busy":"2021-09-15T17:08:15.450984Z","iopub.execute_input":"2021-09-15T17:08:15.451556Z","iopub.status.idle":"2021-09-15T17:08:17.066939Z","shell.execute_reply.started":"2021-09-15T17:08:15.451513Z","shell.execute_reply":"2021-09-15T17:08:17.066032Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!parallel --jobs 6 --timeout 300% --progress heudiconv -d /kaggle/input/rsna-miccai-brain-tumor-radiogenomic-classification/train/{subject}/*/* -f /kaggle/input/brats-data-competition/heuristic.py -s {1} -c dcm2niix -b --overwrite -o /kaggle/working/BIDS :::: /kaggle/working/sub_list.txt","metadata":{"execution":{"iopub.status.busy":"2021-09-15T17:16:50.143655Z","iopub.execute_input":"2021-09-15T17:16:50.144649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!tree /kaggle/working/BIDS","metadata":{"execution":{"iopub.status.busy":"2021-09-15T19:16:02.164970Z","iopub.execute_input":"2021-09-15T19:16:02.165620Z","iopub.status.idle":"2021-09-15T19:16:02.910560Z","shell.execute_reply.started":"2021-09-15T19:16:02.165582Z","shell.execute_reply":"2021-09-15T19:16:02.909440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}