from __future__ import with_statement import os, csv, shutil,tarfile, uf, dcm_ops dest_root = '/ifs/scratch/pimri/soccog/test_working' dst_path_lst = ['7648', 'run1L4'] uf.buildtree(dest_root, dst_path_lst) uf.copytree('/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3310/E3310_e161637/s167370_1904_s6', '/ifs/scratch/pimri/soccog/test_working/7648/run1L4') t = tarfile.open(os.path.join('/ifs/scratch/pimri/soccog/test_working/7648/run1L4','MRDC_files.tar.gz'), 'r') t.extractall('/ifs/scratch/pimri/soccog/test_working/7648/run1L4') for f in os.listdir('/ifs/scratch/pimri/soccog/test_working/7648/run1L4'): if 'MRDC' in f and 'gz' not in f: old = os.path.join('/ifs/scratch/pimri/soccog/test_working/7648/run1L4', f) new = os.path.join('/ifs/scratch/pimri/soccog/test_working/7648/run1L4', f + '.dcm') os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7648/run1L4', '7648_run1L4', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv') #qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7648/run1L4', '7648_run1L4', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil,tarfile, uf, dcm_ops dest_root = '/ifs/scratch/pimri/soccog/test_working' dst_path_lst = ['7714', 'run2M6'] uf.buildtree(dest_root, dst_path_lst) uf.copytree('/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3189/E3189_e976517/s1061831_5610_2M6_s34', '/ifs/scratch/pimri/soccog/test_working/7714/run2M6') t = tarfile.open(os.path.join('/ifs/scratch/pimri/soccog/test_working/7714/run2M6','MRDC_files.tar.gz'), 'r') t.extractall('/ifs/scratch/pimri/soccog/test_working/7714/run2M6') for f in os.listdir('/ifs/scratch/pimri/soccog/test_working/7714/run2M6'): if 'MRDC' in f and 'gz' not in f: old = os.path.join('/ifs/scratch/pimri/soccog/test_working/7714/run2M6', f) new = os.path.join('/ifs/scratch/pimri/soccog/test_working/7714/run2M6', f + '.dcm') os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7714/run2M6', '7714_run2M6', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv') #qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7714/run2M6', '7714_run2M6', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil,tarfile, uf, dcm_ops dest_root = '/ifs/scratch/pimri/soccog/test_working' dst_path_lst = ['7645', 'anat-1-1'] uf.buildtree(dest_root, dst_path_lst) uf.copytree('/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3078/E3078_e1370606/s1382088_166_fspgr_s9', '/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1') t = tarfile.open(os.path.join('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1','MRDC_files.tar.gz'), 'r') t.extractall('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1') for f in os.listdir('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1'): if 'MRDC' in f and 'gz' not in f: old = os.path.join('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1', f) new = os.path.join('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1', f + '.dcm') os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1', '7645_anat-1-1', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv') #qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7645/anat-1-1', '7645_anat-1-1', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil, tarfile, uf, dcm_ops dest_root = "/ifs/scratch/pimri/soccog/test_working" dst_path_lst = ["7478", "run1M3"] uf.buildtree(dest_root, dst_path_lst) uf.copytree( "/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/2489/E2489_e1477970/s1501031_5610_1M3_s14", "/ifs/scratch/pimri/soccog/test_working/7478/run1M3", ) t = tarfile.open(os.path.join("/ifs/scratch/pimri/soccog/test_working/7478/run1M3", "MRDC_files.tar.gz"), "r") t.extractall("/ifs/scratch/pimri/soccog/test_working/7478/run1M3") for f in os.listdir("/ifs/scratch/pimri/soccog/test_working/7478/run1M3"): if "MRDC" in f and "gz" not in f: old = os.path.join("/ifs/scratch/pimri/soccog/test_working/7478/run1M3", f) new = os.path.join("/ifs/scratch/pimri/soccog/test_working/7478/run1M3", f + ".dcm") os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm( "/ifs/scratch/pimri/soccog/test_working/7478/run1M3", "7478_run1M3", "/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv", ) # qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7478/run1M3', '7478_run1M3', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil, tarfile, uf, dcm_ops dest_root = "/ifs/scratch/pimri/soccog/test_working" dst_path_lst = ["7607", "anat-1-2"] uf.buildtree(dest_root, dst_path_lst) uf.copytree( "/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3380/E3380_e149485/s162275_166_s13", "/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2", ) t = tarfile.open(os.path.join("/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2", "MRDC_files.tar.gz"), "r") t.extractall("/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2") for f in os.listdir("/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2"): if "MRDC" in f and "gz" not in f: old = os.path.join("/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2", f) new = os.path.join("/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2", f + ".dcm") os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm( "/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2", "7607_anat-1-2", "/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv", ) # qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7607/anat-1-2', '7607_anat-1-2', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil, tarfile, uf, dcm_ops dest_root = "/ifs/scratch/pimri/soccog/test_working" dst_path_lst = ["7542", "run2L5"] uf.buildtree(dest_root, dst_path_lst) uf.copytree( "/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/2727/E2727_e363504/s416629_1904_2L5_s24", "/ifs/scratch/pimri/soccog/test_working/7542/run2L5", ) t = tarfile.open(os.path.join("/ifs/scratch/pimri/soccog/test_working/7542/run2L5", "MRDC_files.tar.gz"), "r") t.extractall("/ifs/scratch/pimri/soccog/test_working/7542/run2L5") for f in os.listdir("/ifs/scratch/pimri/soccog/test_working/7542/run2L5"): if "MRDC" in f and "gz" not in f: old = os.path.join("/ifs/scratch/pimri/soccog/test_working/7542/run2L5", f) new = os.path.join("/ifs/scratch/pimri/soccog/test_working/7542/run2L5", f + ".dcm") os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm( "/ifs/scratch/pimri/soccog/test_working/7542/run2L5", "7542_run2L5", "/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv", ) # qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7542/run2L5', '7542_run2L5', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil,tarfile, uf, dcm_ops dest_root = '/ifs/scratch/pimri/soccog/test_working' dst_path_lst = ['7458', 'anat-2-2'] uf.buildtree(dest_root, dst_path_lst) uf.copytree('/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/2434/E2434_e1155724/s1214465_166_SPGR4_s30', '/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2') t = tarfile.open(os.path.join('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2','MRDC_files.tar.gz'), 'r') t.extractall('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2') for f in os.listdir('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2'): if 'MRDC' in f and 'gz' not in f: old = os.path.join('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2', f) new = os.path.join('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2', f + '.dcm') os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2', '7458_anat-2-2', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv') #qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7458/anat-2-2', '7458_anat-2-2', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
from __future__ import with_statement import os, csv, shutil, tarfile, uf, dcm_ops dest_root = "/ifs/scratch/pimri/soccog/test_working" dst_path_lst = ["7575", "anat-2-1"] uf.buildtree(dest_root, dst_path_lst) uf.copytree( "/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3184/E3184_e858822/s915746_166_fspgr_s27", "/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1", ) t = tarfile.open(os.path.join("/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1", "MRDC_files.tar.gz"), "r") t.extractall("/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1") for f in os.listdir("/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1"): if "MRDC" in f and "gz" not in f: old = os.path.join("/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1", f) new = os.path.join("/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1", f + ".dcm") os.rename(old, new) qsub_cnv_out = dcm_ops.cnv_dcm( "/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1", "7575_anat-2-1", "/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv", ) # qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7575/anat-2-1', '7575_anat-2-1', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')