for subject_label in subjects_to_analyze: label = 'sub-' + subject_label print('running pre-processing for ' + label) # Read DWI in BIDS derivatives folder all_dwi_images = glob.glob( os.path.join(app.args.in_dir, label, '*dwi', '*_dwi.nii*')) # Create output subject directory subject_dir = os.path.join(all_subjects_dir, subject_label) if not os.path.exists(subject_dir): os.mkdir(subject_dir) # Check existence output files from this analysis level dwi_preproc_file = os.path.join(subject_dir, 'dwi_preproc.mif') app.checkOutputPath(dwi_preproc_file) dwi_bias_file = os.path.join(subject_dir, 'dwi_preproc_bias.mif') app.checkOutputPath(dwi_bias_file) output_mask = os.path.join(subject_dir, 'mask.mif') app.checkOutputPath(output_mask) # DW gradient files grad_prefix = os.path.join(app.args.in_dir, label, 'dwi', label + '_dwi') if not (os.path.isfile(grad_prefix + '.bval') and os.path.isfile(grad_prefix + '.bvec')): grad_prefix = os.path.join(app.args.in_dir, 'dwi') if not (os.path.isfile(grad_prefix + '.bval') and os.path.isfile(grad_prefix + '.bvec')): app.error('Unable to locate valid diffusion gradient table') grad_import_option = ' -fslgrad ' + grad_prefix + '.bvec ' + grad_prefix + '.bval'
def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output)
def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output)
def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output)
def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output)
def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.out_sfwm) app.checkOutputPath(app.args.out_gm) app.checkOutputPath(app.args.out_csf)
def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.out_sfwm) app.checkOutputPath(app.args.out_gm) app.checkOutputPath(app.args.out_csf)