target=out_average.outputs.mean_image, source=out_get_m0.outputs.m0_file, write_interp=3, jobtype='estwrite') # Smooth M0 smooth_m0 = mem.cache(spm.Smooth) out_smooth_m0 = smooth_m0( in_files=out_coregister_m0.outputs.coregistered_source, fwhm=[5., 5., 5.]) # Compute perfusion n_scans = preprocessing.get_scans_number( out_realign.outputs.realigned_files) perfusion_file = quantification.compute_perfusion( out_realign.outputs.realigned_files, ctl_scans=range(1, n_scans, 2), tag_scans=range(0, n_scans, 2)) # Compute CBF quantify = mem.cache(quantification.QuantifyCBF) out_quantify = quantify( perfusion_file=perfusion_file, m0_file=out_smooth_m0.outputs.smoothed_files, tr=2500., t1_gm=1331.) # Compute brain mask brain_mask_file = preprocessing.compute_brain_mask( out_coregister_anat.outputs.coregistered_source, frac=.2) brain_mask_file = preprocessing.compute_brain_mask( out_average.outputs.mean_image, frac=.5)
write_interp=3, jobtype='estwrite') # Smooth M0 smooth_m0 = mem.cache(spm.Smooth) out_smooth_m0 = smooth_m0( in_files=out_coregister_m0.outputs.coregistered_source, fwhm=[5., 5., 5.]) # Compute perfusion n_scans = preprocessing.get_scans_number( out_realign.outputs.realigned_files) ctl_scans = range(1, n_scans, 2) tag_scans = range(0, n_scans, 2) perfusion_file = quantification.compute_perfusion( out_realign.outputs.realigned_files, ctl_scans=ctl_scans, tag_scans=tag_scans) # Compute CBF quantify = mem.cache(quantification.QuantifyCBF) out_quantify = quantify( perfusion_file=perfusion_file, m0_file=out_smooth_m0.outputs.smoothed_files, tr=2500., t1_gm=1331.) # Compute brain mask brain_mask_file = preprocessing.compute_brain_mask( out_coregister_anat.outputs.coregistered_source, frac=.2) # Normalize CBF
source=out_get_m0.outputs.m0_file, write_interp=3, jobtype='estwrite') # Smooth M0 smooth_m0 = mem.cache(spm.Smooth) out_smooth_m0 = smooth_m0( in_files=out_coregister_m0.outputs.coregistered_source, fwhm=[5., 5., 5.]) # Compute perfusion from procasl import preprocessing, quantification n_scans = preprocessing.get_scans_number(out_realign.outputs.realigned_files) ctl_scans = range(1, n_scans, 2) tag_scans = range(0, n_scans, 2) perfusion_file = quantification.compute_perfusion( out_realign.outputs.realigned_files, ctl_scans=ctl_scans, tag_scans=tag_scans) # Compute CBF quantify = mem.cache(quantification.QuantifyCBF) out_quantify = quantify(perfusion_file=perfusion_file, m0_file=out_smooth_m0.outputs.smoothed_files, tr=2500., t1_gm=1331.) # Mask CBF map with brain mask brain_mask_file = preprocessing.compute_brain_mask( out_coregister_anat.outputs.coregistered_source, frac=.2) cbf_map = preprocessing.apply_mask(out_quantify.outputs.cbf_file, brain_mask_file)