from twk.distributed import RayExecutor
# ------------------------------------------------- # 4. Threshold and visualise the contrast # ------------------------------------------------- contrast = glm.contrast('2back > 0back') thresholded = tstat.threshold(contrast, p=0.05, method='fdr') tvis.plot_brain(thresholded, surface='fsaverage', cmap='cold_hot') The same pipeline can be that the web dashboard can execute without writing any code:
pipeline_json = preproc.to_json() tvis.save_dashboard(pipeline_json, out="my_analysis.json") 6.1. GPU‑Accelerated Diffusion Tensor Imaging from twk.diffusion import DTI, cuda_enabled
# ------------------------------------------------- # 2. Preprocess functional runs # ------------------------------------------------- preproc = tpre.Pipeline() preproc.add_step('realign', reference='mean') preproc.add_step('slice_time_correction', method='interleaved') preproc.add_step('denoise', method='ica_aroma') func_clean = preproc.apply(dataset.func)
# ------------------------------------------------- # 1. Load a BIDS‑compliant dataset # ------------------------------------------------- bids_root = "/data/subject01" dataset = tio.load_bids(bids_root)
