Callosal bundles using AFQ API#

An example using the AFQ API to find callosal bundles using the templates from: http://hdl.handle.net/1773/34926

import os.path as op
import matplotlib.pyplot as plt
import nibabel as nib

import plotly

from AFQ.api.group import GroupAFQ
import AFQ.api.bundle_dict as abd
from AFQ.definitions.image import RoiImage
import AFQ.data.fetch as afd

Get some example data#

Retrieves Stanford HARDI dataset.

afd.organize_stanford_data(clear_previous_afq="track")
  0%|          | 0/5578 [00:00<?, ? MB/s]
  0%|          | 10/5578 [00:00<01:06, 84.23 MB/s]
  0%|          | 27/5578 [00:00<00:42, 131.06 MB/s]
  1%|          | 56/5578 [00:00<00:29, 186.19 MB/s]
  2%|▏         | 103/5578 [00:00<00:20, 272.07 MB/s]
  3%|▎         | 147/5578 [00:00<00:16, 326.89 MB/s]
  3%|▎         | 190/5578 [00:00<00:15, 342.26 MB/s]
  4%|▍         | 232/5578 [00:00<00:14, 364.37 MB/s]
  5%|▍         | 277/5578 [00:00<00:14, 372.49 MB/s]
  6%|▌         | 319/5578 [00:00<00:13, 383.42 MB/s]
  6%|▋         | 362/5578 [00:01<00:13, 393.24 MB/s]
  7%|▋         | 404/5578 [00:01<00:13, 388.05 MB/s]
  8%|▊         | 445/5578 [00:01<00:13, 393.45 MB/s]
  9%|▊         | 488/5578 [00:01<00:12, 399.50 MB/s]
 10%|▉         | 531/5578 [00:01<00:12, 395.81 MB/s]
 10%|█         | 572/5578 [00:01<00:12, 399.59 MB/s]
 11%|█         | 614/5578 [00:01<00:12, 405.01 MB/s]
 12%|█▏        | 655/5578 [00:01<00:12, 402.46 MB/s]
 13%|█▎        | 698/5578 [00:01<00:12, 398.40 MB/s]
 13%|█▎        | 739/5578 [00:02<00:12, 400.22 MB/s]
 14%|█▍        | 780/5578 [00:02<00:11, 402.58 MB/s]
 15%|█▍        | 821/5578 [00:02<00:11, 399.51 MB/s]
 15%|█▌        | 864/5578 [00:02<00:11, 398.70 MB/s]
 16%|█▌        | 904/5578 [00:02<00:11, 397.14 MB/s]
 17%|█▋        | 948/5578 [00:02<00:11, 401.85 MB/s]
 18%|█▊        | 991/5578 [00:02<00:11, 397.22 MB/s]
 19%|█▊        | 1034/5578 [00:02<00:11, 406.56 MB/s]
 19%|█▉        | 1075/5578 [00:02<00:11, 401.06 MB/s]
 20%|██        | 1118/5578 [00:02<00:11, 397.00 MB/s]
 21%|██        | 1158/5578 [00:03<00:11, 397.34 MB/s]
 22%|██▏       | 1201/5578 [00:03<00:10, 401.10 MB/s]
 22%|██▏       | 1245/5578 [00:03<00:10, 398.08 MB/s]
 23%|██▎       | 1289/5578 [00:03<00:10, 404.00 MB/s]
 24%|██▍       | 1332/5578 [00:03<00:10, 398.31 MB/s]
 25%|██▍       | 1376/5578 [00:03<00:10, 402.96 MB/s]
 25%|██▌       | 1419/5578 [00:03<00:10, 410.59 MB/s]
 26%|██▌       | 1461/5578 [00:03<00:10, 401.45 MB/s]
 27%|██▋       | 1503/5578 [00:03<00:10, 393.77 MB/s]
 28%|██▊       | 1543/5578 [00:04<00:10, 394.70 MB/s]
 28%|██▊       | 1586/5578 [00:04<00:09, 401.50 MB/s]
 29%|██▉       | 1627/5578 [00:04<00:09, 400.76 MB/s]
 30%|██▉       | 1669/5578 [00:04<00:09, 394.86 MB/s]
 31%|███       | 1713/5578 [00:04<00:09, 407.83 MB/s]
 31%|███▏      | 1754/5578 [00:04<00:09, 401.39 MB/s]
 32%|███▏      | 1796/5578 [00:04<00:09, 395.60 MB/s]
 33%|███▎      | 1840/5578 [00:04<00:09, 399.50 MB/s]
 34%|███▍      | 1883/5578 [00:04<00:09, 397.78 MB/s]
 35%|███▍      | 1925/5578 [00:04<00:09, 404.09 MB/s]
 35%|███▌      | 1967/5578 [00:05<00:08, 401.35 MB/s]
 36%|███▌      | 2008/5578 [00:05<00:08, 402.10 MB/s]
 37%|███▋      | 2050/5578 [00:05<00:08, 398.17 MB/s]
 38%|███▊      | 2094/5578 [00:05<00:08, 402.50 MB/s]
 38%|███▊      | 2135/5578 [00:05<00:08, 403.82 MB/s]
 39%|███▉      | 2176/5578 [00:05<00:08, 404.51 MB/s]
 40%|███▉      | 2217/5578 [00:05<00:08, 396.66 MB/s]
 41%|████      | 2261/5578 [00:05<00:08, 401.95 MB/s]
 41%|████▏     | 2303/5578 [00:05<00:08, 404.39 MB/s]
 42%|████▏     | 2344/5578 [00:06<00:08, 396.83 MB/s]
 43%|████▎     | 2387/5578 [00:06<00:07, 406.12 MB/s]
 44%|████▎     | 2428/5578 [00:06<00:07, 398.97 MB/s]
 44%|████▍     | 2471/5578 [00:06<00:07, 399.21 MB/s]
 45%|████▌     | 2513/5578 [00:06<00:07, 404.74 MB/s]
 46%|████▌     | 2554/5578 [00:06<00:07, 397.49 MB/s]
 47%|████▋     | 2597/5578 [00:06<00:07, 406.63 MB/s]
 47%|████▋     | 2638/5578 [00:06<00:07, 400.61 MB/s]
 48%|████▊     | 2679/5578 [00:06<00:07, 403.28 MB/s]
 49%|████▉     | 2720/5578 [00:06<00:07, 402.61 MB/s]
 49%|████▉     | 2761/5578 [00:07<00:07, 398.96 MB/s]
 50%|█████     | 2802/5578 [00:07<00:06, 401.43 MB/s]
 51%|█████     | 2844/5578 [00:07<00:06, 400.03 MB/s]
 52%|█████▏    | 2886/5578 [00:07<00:06, 402.46 MB/s]
 52%|█████▏    | 2927/5578 [00:07<00:06, 402.01 MB/s]
 53%|█████▎    | 2968/5578 [00:07<00:06, 402.77 MB/s]
 54%|█████▍    | 3009/5578 [00:07<00:06, 402.49 MB/s]
 55%|█████▍    | 3050/5578 [00:07<00:06, 399.84 MB/s]
 55%|█████▌    | 3091/5578 [00:07<00:06, 402.45 MB/s]
 56%|█████▌    | 3132/5578 [00:08<00:06, 397.34 MB/s]
 57%|█████▋    | 3175/5578 [00:08<00:05, 402.23 MB/s]
 58%|█████▊    | 3217/5578 [00:08<00:05, 403.16 MB/s]
 58%|█████▊    | 3258/5578 [00:08<00:05, 402.74 MB/s]
 59%|█████▉    | 3299/5578 [00:08<00:05, 397.33 MB/s]
 60%|█████▉    | 3342/5578 [00:08<00:05, 405.25 MB/s]
 61%|██████    | 3383/5578 [00:08<00:05, 402.08 MB/s]
 61%|██████▏   | 3424/5578 [00:08<00:05, 401.51 MB/s]
 62%|██████▏   | 3465/5578 [00:08<00:05, 395.23 MB/s]
 63%|██████▎   | 3510/5578 [00:08<00:05, 405.23 MB/s]
 64%|██████▎   | 3551/5578 [00:09<00:05, 397.39 MB/s]
 64%|██████▍   | 3592/5578 [00:09<00:05, 397.06 MB/s]
 65%|██████▌   | 3636/5578 [00:09<00:04, 404.12 MB/s]
 66%|██████▌   | 3677/5578 [00:09<00:04, 403.85 MB/s]
 67%|██████▋   | 3718/5578 [00:09<00:04, 399.12 MB/s]
 67%|██████▋   | 3758/5578 [00:09<00:04, 398.52 MB/s]
 68%|██████▊   | 3799/5578 [00:09<00:04, 391.00 MB/s]
 69%|██████▉   | 3844/5578 [00:09<00:04, 407.85 MB/s]
 70%|██████▉   | 3885/5578 [00:09<00:04, 401.20 MB/s]
 70%|███████   | 3926/5578 [00:09<00:04, 389.08 MB/s]
 71%|███████   | 3969/5578 [00:10<00:04, 400.55 MB/s]
 72%|███████▏  | 4011/5578 [00:10<00:03, 403.21 MB/s]
 73%|███████▎  | 4053/5578 [00:10<00:03, 391.75 MB/s]
 73%|███████▎  | 4096/5578 [00:10<00:03, 402.58 MB/s]
 74%|███████▍  | 4138/5578 [00:10<00:03, 405.86 MB/s]
 75%|███████▍  | 4180/5578 [00:10<00:03, 392.85 MB/s]
 76%|███████▌  | 4223/5578 [00:10<00:03, 403.06 MB/s]
 76%|███████▋  | 4265/5578 [00:10<00:03, 407.82 MB/s]
 77%|███████▋  | 4306/5578 [00:10<00:03, 390.18 MB/s]
 78%|███████▊  | 4351/5578 [00:11<00:03, 405.87 MB/s]
 79%|███████▉  | 4394/5578 [00:11<00:03, 391.54 MB/s]
 79%|███████▉  | 4434/5578 [00:11<00:02, 391.13 MB/s]
 80%|████████  | 4474/5578 [00:11<00:02, 384.90 MB/s]
 81%|████████  | 4519/5578 [00:11<00:02, 403.37 MB/s]
 82%|████████▏ | 4560/5578 [00:11<00:02, 396.90 MB/s]
 82%|████████▏ | 4601/5578 [00:11<00:02, 390.75 MB/s]
 83%|████████▎ | 4647/5578 [00:11<00:02, 400.65 MB/s]
 84%|████████▍ | 4689/5578 [00:11<00:02, 396.67 MB/s]
 85%|████████▍ | 4729/5578 [00:12<00:02, 394.47 MB/s]
 85%|████████▌ | 4769/5578 [00:12<00:02, 394.50 MB/s]
 86%|████████▋ | 4812/5578 [00:12<00:01, 404.80 MB/s]
 87%|████████▋ | 4854/5578 [00:12<00:01, 407.95 MB/s]
 88%|████████▊ | 4895/5578 [00:12<00:01, 397.73 MB/s]
 88%|████████▊ | 4935/5578 [00:12<00:01, 394.14 MB/s]
 89%|████████▉ | 4979/5578 [00:12<00:01, 407.05 MB/s]
 90%|█████████ | 5021/5578 [00:12<00:01, 407.27 MB/s]
 91%|█████████ | 5062/5578 [00:12<00:01, 393.22 MB/s]
 92%|█████████▏| 5106/5578 [00:12<00:01, 406.25 MB/s]
 92%|█████████▏| 5147/5578 [00:13<00:01, 401.67 MB/s]
 93%|█████████▎| 5188/5578 [00:13<00:00, 394.92 MB/s]
 94%|█████████▍| 5230/5578 [00:13<00:00, 399.46 MB/s]
 94%|█████████▍| 5271/5578 [00:13<00:00, 402.48 MB/s]
 95%|█████████▌| 5314/5578 [00:13<00:00, 404.83 MB/s]
 96%|█████████▌| 5355/5578 [00:13<00:00, 395.63 MB/s]
 97%|█████████▋| 5395/5578 [00:13<00:00, 395.96 MB/s]
 97%|█████████▋| 5437/5578 [00:13<00:00, 402.94 MB/s]
 98%|█████████▊| 5480/5578 [00:13<00:00, 410.90 MB/s]
 99%|█████████▉| 5522/5578 [00:13<00:00, 393.34 MB/s]
100%|█████████▉| 5564/5578 [00:14<00:00, 400.36 MB/s]
100%|██████████| 5578/5578 [00:14<00:00, 394.64 MB/s]

  0%|          | 0/1 [00:00<?, ? MB/s]
100%|██████████| 1/1 [00:00<00:00, 4712.70 MB/s]

  0%|          | 0/1 [00:00<?, ? MB/s]
100%|██████████| 1/1 [00:00<00:00, 2803.68 MB/s]

  0%|          | 0/71 [00:00<?, ? MB/s]
 13%|█▎        | 9/71 [00:00<00:00, 76.36 MB/s]
 37%|███▋      | 26/71 [00:00<00:00, 116.49 MB/s]
 80%|████████  | 57/71 [00:00<00:00, 184.14 MB/s]
100%|██████████| 71/71 [00:00<00:00, 190.31 MB/s]

  0%|          | 0/4 [00:00<?, ? MB/s]
100%|██████████| 4/4 [00:00<00:00, 98.57 MB/s]

  0%|          | 0/1 [00:00<?, ? MB/s]
100%|██████████| 1/1 [00:00<00:00, 3358.13 MB/s]

Set tractography parameters (optional)#

We make this tracking_params which we will pass to the GroupAFQ object which specifies that we want 100,000 seeds randomly distributed in the ROIs of every bundle.

We only do this to make this example faster and consume less space.

tracking_params = dict(seed_mask=RoiImage(),
                       n_seeds=10000,
                       random_seeds=True,
                       rng_seed=42)

Set segmentation parameters (optional)#

We make this segmentation_params which we will pass to the GroupAFQ object which specifies that we want to clip the extracted tract profiles to only be between the two ROIs.

We do this because tract profiles become less reliable as the bundles approach the gray matter-white matter boundary. On some of the non-callosal bundles, ROIs are not in a good position to clip edges. In these cases, one can remove the first and last nodes in a tract profile.

segmentation_params = {"clip_edges": True}

Initialize a GroupAFQ object:#

We specify bundle_info as the callosal bundles only (abd.callosal_bd). If we want to segment both the callosum and the other bundles, we would pass abd.callosal_bd() + abd.default18_bd() instead. This would tell the GroupAFQ object to use bundles from both the standard and callosal templates.

myafq = GroupAFQ(
    bids_path=op.join(afd.afq_home, 'stanford_hardi'),
    preproc_pipeline='vistasoft',
    bundle_info=abd.callosal_bd(),
    tracking_params=tracking_params,
    segmentation_params=segmentation_params,
    viz_backend_spec='plotly_no_gif')

# Calling export all produces all of the outputs of processing, including
# tractography, scalar maps, tract profiles and visualizations:
myafq.export_all()
  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 4755.45 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5105.67 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
 50%|█████     | 1/2 [00:00<00:00,  7.57 MB/s]
100%|██████████| 2/2 [00:00<00:00, 15.07 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5178.15 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5757.45 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 4440.77 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5168.58 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 3618.90 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 3998.38 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 4514.86 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5429.52 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 3809.54 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 4438.42 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
 50%|█████     | 1/2 [00:00<00:00,  7.51 MB/s]
100%|██████████| 2/2 [00:00<00:00, 14.96 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5450.69 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 5559.05 MB/s]

  0%|          | 0/2 [00:00<?, ? MB/s]
100%|██████████| 2/2 [00:00<00:00, 6492.73 MB/s]

  0%|          | 0/179864.0 [00:00<?, ?it/s]
  0%|          | 296/179864.0 [00:00<01:00, 2953.88it/s]
  0%|          | 690/179864.0 [00:00<00:50, 3530.00it/s]
  1%|          | 1097/179864.0 [00:00<00:47, 3774.97it/s]
  1%|          | 1497/179864.0 [00:00<00:46, 3862.85it/s]
  1%|          | 1908/179864.0 [00:00<00:45, 3950.81it/s]
  1%|▏         | 2320/179864.0 [00:00<00:44, 4003.58it/s]
  2%|▏         | 2735/179864.0 [00:00<00:43, 4049.04it/s]
  2%|▏         | 3150/179864.0 [00:00<00:43, 4079.16it/s]
  2%|▏         | 3580/179864.0 [00:00<00:42, 4146.18it/s]
  2%|▏         | 3998/179864.0 [00:01<00:42, 4155.16it/s]
  2%|▏         | 4422/179864.0 [00:01<00:41, 4178.36it/s]
  3%|▎         | 4855/179864.0 [00:01<00:41, 4224.36it/s]
  3%|▎         | 5284/179864.0 [00:01<00:41, 4242.66it/s]
  3%|▎         | 5709/179864.0 [00:01<00:41, 4214.30it/s]
  3%|▎         | 6136/179864.0 [00:01<00:41, 4228.53it/s]
  4%|▎         | 6566/179864.0 [00:01<00:40, 4249.33it/s]
  4%|▍         | 6994/179864.0 [00:01<00:40, 4258.02it/s]
  4%|▍         | 7420/179864.0 [00:01<00:40, 4248.05it/s]
  4%|▍         | 7861/179864.0 [00:01<00:40, 4296.25it/s]
  5%|▍         | 8309/179864.0 [00:02<00:39, 4348.09it/s]
  5%|▍         | 8744/179864.0 [00:02<00:39, 4317.72it/s]
  5%|▌         | 9176/179864.0 [00:02<00:40, 4266.16it/s]
  5%|▌         | 9612/179864.0 [00:02<00:39, 4292.81it/s]
  6%|▌         | 10054/179864.0 [00:02<00:39, 4328.54it/s]
  6%|▌         | 10493/179864.0 [00:02<00:38, 4346.22it/s]
  6%|▌         | 10928/179864.0 [00:02<00:39, 4257.56it/s]
  6%|▋         | 11371/179864.0 [00:02<00:39, 4306.85it/s]
  7%|▋         | 11812/179864.0 [00:02<00:38, 4334.74it/s]
  7%|▋         | 12260/179864.0 [00:02<00:38, 4377.82it/s]
  7%|▋         | 12699/179864.0 [00:03<00:38, 4380.88it/s]
  7%|▋         | 13138/179864.0 [00:03<00:38, 4310.03it/s]
  8%|▊         | 13577/179864.0 [00:03<00:38, 4332.13it/s]
  8%|▊         | 14029/179864.0 [00:03<00:37, 4386.18it/s]
  8%|▊         | 14484/179864.0 [00:03<00:37, 4433.34it/s]
  8%|▊         | 14934/179864.0 [00:03<00:37, 4452.83it/s]
  9%|▊         | 15380/179864.0 [00:03<00:37, 4363.73it/s]
  9%|▉         | 15817/179864.0 [00:03<00:37, 4346.38it/s]
  9%|▉         | 16281/179864.0 [00:03<00:36, 4432.75it/s]
  9%|▉         | 16742/179864.0 [00:03<00:36, 4484.41it/s]
 10%|▉         | 17197/179864.0 [00:04<00:36, 4503.55it/s]
 10%|▉         | 17648/179864.0 [00:04<00:36, 4461.61it/s]
 10%|█         | 18095/179864.0 [00:04<00:37, 4366.38it/s]
 10%|█         | 18533/179864.0 [00:04<00:36, 4370.34it/s]
 11%|█         | 18984/179864.0 [00:04<00:36, 4406.11it/s]
 11%|█         | 19445/179864.0 [00:04<00:35, 4465.74it/s]
 11%|█         | 19898/179864.0 [00:04<00:35, 4483.16it/s]
 11%|█▏        | 20347/179864.0 [00:04<00:35, 4445.98it/s]
 12%|█▏        | 20792/179864.0 [00:04<00:36, 4404.46it/s]
 12%|█▏        | 21251/179864.0 [00:04<00:35, 4458.85it/s]
 12%|█▏        | 21703/179864.0 [00:05<00:35, 4475.31it/s]
 12%|█▏        | 22155/179864.0 [00:05<00:35, 4488.32it/s]
 13%|█▎        | 22609/179864.0 [00:05<00:34, 4501.25it/s]
 13%|█▎        | 23060/179864.0 [00:05<00:35, 4478.16it/s]
 13%|█▎        | 23508/179864.0 [00:05<00:35, 4409.53it/s]
 13%|█▎        | 23971/179864.0 [00:05<00:34, 4472.32it/s]
 14%|█▎        | 24433/179864.0 [00:05<00:34, 4514.33it/s]
 14%|█▍        | 24896/179864.0 [00:05<00:34, 4547.51it/s]
 14%|█▍        | 25351/179864.0 [00:05<00:34, 4535.92it/s]
 14%|█▍        | 25805/179864.0 [00:05<00:34, 4527.02it/s]
 15%|█▍        | 26258/179864.0 [00:06<00:34, 4420.63it/s]
 15%|█▍        | 26726/179864.0 [00:06<00:34, 4494.33it/s]
 15%|█▌        | 27189/179864.0 [00:06<00:33, 4531.53it/s]
 15%|█▌        | 27663/179864.0 [00:06<00:33, 4591.35it/s]
 16%|█▌        | 28124/179864.0 [00:06<00:33, 4595.31it/s]
 16%|█▌        | 28584/179864.0 [00:06<00:33, 4559.08it/s]
 16%|█▌        | 29041/179864.0 [00:06<00:33, 4495.14it/s]
 16%|█▋        | 29491/179864.0 [00:06<00:33, 4427.55it/s]
 17%|█▋        | 29954/179864.0 [00:06<00:33, 4484.05it/s]
 17%|█▋        | 30416/179864.0 [00:06<00:33, 4523.34it/s]
 17%|█▋        | 30879/179864.0 [00:07<00:32, 4552.87it/s]
 17%|█▋        | 31347/179864.0 [00:07<00:32, 4589.55it/s]
 18%|█▊        | 31807/179864.0 [00:07<00:32, 4520.19it/s]
 18%|█▊        | 32260/179864.0 [00:07<00:32, 4500.23it/s]
 18%|█▊        | 32711/179864.0 [00:07<00:33, 4443.04it/s]
 18%|█▊        | 33164/179864.0 [00:07<00:32, 4467.67it/s]
 19%|█▊        | 33630/179864.0 [00:07<00:32, 4522.71it/s]
 19%|█▉        | 34083/179864.0 [00:07<00:32, 4522.58it/s]
 19%|█▉        | 34548/179864.0 [00:07<00:31, 4559.82it/s]
 19%|█▉        | 35005/179864.0 [00:07<00:31, 4552.46it/s]
 20%|█▉        | 35461/179864.0 [00:08<00:31, 4526.94it/s]
 20%|█▉        | 35914/179864.0 [00:08<00:32, 4489.74it/s]
 20%|██        | 36364/179864.0 [00:08<00:32, 4465.87it/s]
 20%|██        | 36834/179864.0 [00:08<00:31, 4533.30it/s]
 21%|██        | 37307/179864.0 [00:08<00:31, 4590.65it/s]
 21%|██        | 37780/179864.0 [00:08<00:30, 4631.78it/s]
 21%|██▏       | 38244/179864.0 [00:08<00:31, 4494.00it/s]
 22%|██▏       | 38702/179864.0 [00:08<00:31, 4518.18it/s]
 22%|██▏       | 39155/179864.0 [00:08<00:31, 4475.28it/s]
 22%|██▏       | 39604/179864.0 [00:09<00:31, 4429.00it/s]
 22%|██▏       | 40069/179864.0 [00:09<00:31, 4493.68it/s]
 23%|██▎       | 40553/179864.0 [00:09<00:30, 4595.26it/s]
 23%|██▎       | 41020/179864.0 [00:09<00:30, 4615.06it/s]
 23%|██▎       | 41485/179864.0 [00:09<00:29, 4622.66it/s]
 23%|██▎       | 41948/179864.0 [00:09<00:30, 4584.39it/s]
 24%|██▎       | 42407/179864.0 [00:09<00:30, 4520.73it/s]
 24%|██▍       | 42860/179864.0 [00:09<00:30, 4503.37it/s]
 24%|██▍       | 43321/179864.0 [00:09<00:30, 4534.52it/s]
 24%|██▍       | 43808/179864.0 [00:09<00:29, 4633.62it/s]
 25%|██▍       | 44296/179864.0 [00:10<00:28, 4706.30it/s]
 25%|██▍       | 44767/179864.0 [00:10<00:28, 4674.09it/s]
 25%|██▌       | 45235/179864.0 [00:10<00:28, 4658.88it/s]
 25%|██▌       | 45702/179864.0 [00:10<00:29, 4523.44it/s]
 26%|██▌       | 46166/179864.0 [00:10<00:29, 4555.26it/s]
 26%|██▌       | 46645/179864.0 [00:10<00:28, 4624.10it/s]
 26%|██▌       | 47137/179864.0 [00:10<00:28, 4710.60it/s]
 26%|██▋       | 47609/179864.0 [00:10<00:28, 4692.58it/s]
 27%|██▋       | 48079/179864.0 [00:10<00:28, 4649.95it/s]
 27%|██▋       | 48545/179864.0 [00:10<00:28, 4634.15it/s]
 27%|██▋       | 49009/179864.0 [00:11<00:28, 4557.09it/s]
 28%|██▊       | 49466/179864.0 [00:11<00:28, 4555.37it/s]
 28%|██▊       | 49928/179864.0 [00:11<00:28, 4574.07it/s]
 28%|██▊       | 50419/179864.0 [00:11<00:27, 4670.89it/s]
 28%|██▊       | 50907/179864.0 [00:11<00:27, 4732.26it/s]
 29%|██▊       | 51381/179864.0 [00:11<00:27, 4686.07it/s]
 29%|██▉       | 51850/179864.0 [00:11<00:27, 4644.58it/s]
 29%|██▉       | 52315/179864.0 [00:11<00:27, 4578.12it/s]
 29%|██▉       | 52774/179864.0 [00:11<00:27, 4540.86it/s]
 30%|██▉       | 53229/179864.0 [00:11<00:28, 4466.51it/s]
 30%|██▉       | 53698/179864.0 [00:12<00:27, 4531.44it/s]
 30%|███       | 54173/179864.0 [00:12<00:27, 4594.77it/s]
 30%|███       | 54652/179864.0 [00:12<00:26, 4649.60it/s]
 31%|███       | 55122/179864.0 [00:12<00:26, 4663.68it/s]
 31%|███       | 55589/179864.0 [00:12<00:26, 4650.89it/s]
 31%|███       | 56055/179864.0 [00:12<00:27, 4555.54it/s]
 31%|███▏      | 56512/179864.0 [00:12<00:27, 4525.41it/s]
 32%|███▏      | 56966/179864.0 [00:12<00:27, 4527.33it/s]
 32%|███▏      | 57459/179864.0 [00:12<00:26, 4644.92it/s]
 32%|███▏      | 57948/179864.0 [00:12<00:25, 4717.68it/s]
 32%|███▏      | 58432/179864.0 [00:13<00:25, 4753.02it/s]
 33%|███▎      | 58908/179864.0 [00:13<00:25, 4749.31it/s]
 33%|███▎      | 59384/179864.0 [00:13<00:25, 4748.22it/s]
 33%|███▎      | 59859/179864.0 [00:13<00:25, 4642.53it/s]
 34%|███▎      | 60324/179864.0 [00:13<00:25, 4608.69it/s]
 34%|███▍      | 60821/179864.0 [00:13<00:25, 4715.03it/s]
 34%|███▍      | 61321/179864.0 [00:13<00:24, 4798.56it/s]
 34%|███▍      | 61810/179864.0 [00:13<00:24, 4823.14it/s]
 35%|███▍      | 62293/179864.0 [00:13<00:24, 4765.94it/s]
 35%|███▍      | 62778/179864.0 [00:14<00:24, 4789.84it/s]
 35%|███▌      | 63258/179864.0 [00:14<00:24, 4667.05it/s]
 35%|███▌      | 63726/179864.0 [00:14<00:25, 4595.32it/s]
 36%|███▌      | 64210/179864.0 [00:14<00:24, 4665.22it/s]
 36%|███▌      | 64695/179864.0 [00:14<00:24, 4718.88it/s]
 36%|███▌      | 65193/179864.0 [00:14<00:23, 4792.15it/s]
 37%|███▋      | 65673/179864.0 [00:14<00:23, 4785.31it/s]
 37%|███▋      | 66154/179864.0 [00:14<00:23, 4790.39it/s]
 37%|███▋      | 66634/179864.0 [00:14<00:24, 4653.99it/s]
 37%|███▋      | 67101/179864.0 [00:14<00:24, 4575.95it/s]
 38%|███▊      | 67560/179864.0 [00:15<00:24, 4564.66it/s]
 38%|███▊      | 68036/179864.0 [00:15<00:24, 4620.13it/s]
 38%|███▊      | 68503/179864.0 [00:15<00:24, 4633.45it/s]
 38%|███▊      | 68982/179864.0 [00:15<00:23, 4677.54it/s]
 39%|███▊      | 69460/179864.0 [00:15<00:23, 4705.97it/s]
 39%|███▉      | 69931/179864.0 [00:15<00:23, 4653.56it/s]
 39%|███▉      | 70397/179864.0 [00:15<00:23, 4569.90it/s]
 39%|███▉      | 70855/179864.0 [00:15<00:23, 4565.67it/s]
 40%|███▉      | 71321/179864.0 [00:15<00:23, 4591.29it/s]
 40%|███▉      | 71798/179864.0 [00:15<00:23, 4642.91it/s]
 40%|████      | 72270/179864.0 [00:16<00:23, 4664.19it/s]
 40%|████      | 72737/179864.0 [00:16<00:42, 2502.70it/s]
 41%|████      | 73188/179864.0 [00:16<00:37, 2874.62it/s]
 41%|████      | 73626/179864.0 [00:16<00:33, 3189.78it/s]
 41%|████      | 74054/179864.0 [00:16<00:30, 3440.19it/s]
 41%|████▏     | 74500/179864.0 [00:16<00:28, 3691.85it/s]
 42%|████▏     | 74967/179864.0 [00:16<00:26, 3945.65it/s]
 42%|████▏     | 75425/179864.0 [00:17<00:25, 4116.70it/s]
 42%|████▏     | 75895/179864.0 [00:17<00:24, 4276.71it/s]
 42%|████▏     | 76362/179864.0 [00:17<00:23, 4388.21it/s]
 43%|████▎     | 76817/179864.0 [00:17<00:23, 4377.89it/s]
 43%|████▎     | 77266/179864.0 [00:17<00:23, 4323.63it/s]
 43%|████▎     | 77707/179864.0 [00:17<00:23, 4332.63it/s]
 43%|████▎     | 78166/179864.0 [00:17<00:23, 4404.33it/s]
 44%|████▎     | 78632/179864.0 [00:17<00:22, 4477.89it/s]
 44%|████▍     | 79095/179864.0 [00:17<00:22, 4522.77it/s]
 44%|████▍     | 79550/179864.0 [00:17<00:22, 4518.63it/s]
 44%|████▍     | 80004/179864.0 [00:18<00:22, 4489.66it/s]
 45%|████▍     | 80455/179864.0 [00:18<00:22, 4439.75it/s]
 45%|████▍     | 80900/179864.0 [00:18<00:22, 4358.83it/s]
 45%|████▌     | 81337/179864.0 [00:18<00:22, 4348.75it/s]
 45%|████▌     | 81791/179864.0 [00:18<00:22, 4403.66it/s]
 46%|████▌     | 82245/179864.0 [00:18<00:21, 4442.31it/s]
 46%|████▌     | 82699/179864.0 [00:18<00:21, 4470.57it/s]
 46%|████▌     | 83147/179864.0 [00:18<00:21, 4448.27it/s]
 46%|████▋     | 83593/179864.0 [00:18<00:22, 4288.75it/s]
 47%|████▋     | 84058/179864.0 [00:18<00:21, 4391.19it/s]
 47%|████▋     | 84499/179864.0 [00:19<00:21, 4395.03it/s]
 47%|████▋     | 84944/179864.0 [00:19<00:21, 4410.84it/s]
 47%|████▋     | 85402/179864.0 [00:19<00:21, 4458.78it/s]
 48%|████▊     | 85850/179864.0 [00:19<00:21, 4463.56it/s]
 48%|████▊     | 86297/179864.0 [00:19<00:20, 4464.53it/s]
 48%|████▊     | 86744/179864.0 [00:19<00:21, 4422.91it/s]
 48%|████▊     | 87187/179864.0 [00:19<00:21, 4336.32it/s]
 49%|████▊     | 87622/179864.0 [00:19<00:21, 4330.53it/s]
 49%|████▉     | 88056/179864.0 [00:19<00:21, 4241.23it/s]
 49%|████▉     | 88521/179864.0 [00:20<00:20, 4359.44it/s]
 49%|████▉     | 89004/179864.0 [00:20<00:20, 4497.28it/s]
 50%|████▉     | 89481/179864.0 [00:20<00:19, 4576.18it/s]
 50%|█████     | 89940/179864.0 [00:20<00:19, 4574.58it/s]
 50%|█████     | 90398/179864.0 [00:20<00:19, 4485.07it/s]
 51%|█████     | 90848/179864.0 [00:20<00:19, 4460.87it/s]
 51%|█████     | 91295/179864.0 [00:20<00:20, 4394.71it/s]
 51%|█████     | 91735/179864.0 [00:20<00:20, 4361.54it/s]
 51%|█████▏    | 92206/179864.0 [00:20<00:19, 4462.34it/s]
 52%|█████▏    | 92674/179864.0 [00:20<00:19, 4526.28it/s]
 52%|█████▏    | 93128/179864.0 [00:21<00:19, 4529.31it/s]
 52%|█████▏    | 93591/179864.0 [00:21<00:18, 4557.10it/s]
 52%|█████▏    | 94047/179864.0 [00:21<00:18, 4533.71it/s]
 53%|█████▎    | 94501/179864.0 [00:21<00:18, 4506.41it/s]
 53%|█████▎    | 94952/179864.0 [00:21<00:19, 4459.28it/s]
 53%|█████▎    | 95399/179864.0 [00:21<00:18, 4446.57it/s]
 53%|█████▎    | 95865/179864.0 [00:21<00:18, 4506.42it/s]
 54%|█████▎    | 96323/179864.0 [00:21<00:18, 4528.28it/s]
 54%|█████▍    | 96776/179864.0 [00:21<00:18, 4521.65it/s]
 54%|█████▍    | 97229/179864.0 [00:21<00:18, 4450.12it/s]
 54%|█████▍    | 97675/179864.0 [00:22<00:18, 4382.16it/s]
 55%|█████▍    | 98114/179864.0 [00:22<00:18, 4362.37it/s]
 55%|█████▍    | 98551/179864.0 [00:22<00:18, 4347.40it/s]
 55%|█████▌    | 99004/179864.0 [00:22<00:18, 4400.35it/s]
 55%|█████▌    | 99476/179864.0 [00:22<00:17, 4492.82it/s]
 56%|█████▌    | 99941/179864.0 [00:22<00:17, 4538.02it/s]
 56%|█████▌    | 100401/179864.0 [00:22<00:17, 4554.67it/s]
 56%|█████▌    | 100857/179864.0 [00:22<00:17, 4525.12it/s]
 56%|█████▋    | 101310/179864.0 [00:22<00:17, 4389.17it/s]
 57%|█████▋    | 101760/179864.0 [00:22<00:17, 4419.68it/s]
 57%|█████▋    | 102203/179864.0 [00:23<00:17, 4422.49it/s]
 57%|█████▋    | 102669/179864.0 [00:23<00:17, 4491.12it/s]
 57%|█████▋    | 103147/179864.0 [00:23<00:16, 4573.63it/s]
 58%|█████▊    | 103616/179864.0 [00:23<00:16, 4608.08it/s]
 58%|█████▊    | 104087/179864.0 [00:23<00:16, 4638.38it/s]
 58%|█████▊    | 104552/179864.0 [00:23<00:16, 4554.91it/s]
 58%|█████▊    | 105008/179864.0 [00:23<00:16, 4520.93it/s]
 59%|█████▊    | 105461/179864.0 [00:23<00:16, 4488.36it/s]
 59%|█████▉    | 105922/179864.0 [00:23<00:16, 4523.66it/s]
 59%|█████▉    | 106390/179864.0 [00:23<00:16, 4567.96it/s]
 59%|█████▉    | 106864/179864.0 [00:24<00:15, 4617.26it/s]
 60%|█████▉    | 107327/179864.0 [00:24<00:15, 4617.92it/s]
 60%|█████▉    | 107796/179864.0 [00:24<00:15, 4635.81it/s]
 60%|██████    | 108260/179864.0 [00:24<00:15, 4560.98it/s]
 60%|██████    | 108717/179864.0 [00:24<00:15, 4542.08it/s]
 61%|██████    | 109181/179864.0 [00:24<00:15, 4569.68it/s]
 61%|██████    | 109661/179864.0 [00:24<00:15, 4635.36it/s]
 61%|██████    | 110138/179864.0 [00:24<00:14, 4673.16it/s]
 61%|██████▏   | 110615/179864.0 [00:24<00:14, 4701.50it/s]
 62%|██████▏   | 111087/179864.0 [00:24<00:14, 4706.86it/s]
 62%|██████▏   | 111558/179864.0 [00:25<00:14, 4685.60it/s]
 62%|██████▏   | 112027/179864.0 [00:25<00:14, 4643.09it/s]
 63%|██████▎   | 112492/179864.0 [00:25<00:14, 4589.66it/s]
 63%|██████▎   | 112959/179864.0 [00:25<00:14, 4613.15it/s]
 63%|██████▎   | 113440/179864.0 [00:25<00:14, 4669.25it/s]
 63%|██████▎   | 113935/179864.0 [00:25<00:13, 4752.41it/s]
 64%|██████▎   | 114411/179864.0 [00:25<00:13, 4734.80it/s]
 64%|██████▍   | 114885/179864.0 [00:25<00:13, 4709.94it/s]
 64%|██████▍   | 115357/179864.0 [00:25<00:13, 4689.43it/s]
 64%|██████▍   | 115827/179864.0 [00:25<00:13, 4645.42it/s]
 65%|██████▍   | 116293/179864.0 [00:26<00:13, 4649.08it/s]
 65%|██████▍   | 116774/179864.0 [00:26<00:13, 4696.02it/s]
 65%|██████▌   | 117256/179864.0 [00:26<00:13, 4729.96it/s]
 65%|██████▌   | 117735/179864.0 [00:26<00:13, 4747.09it/s]
 66%|██████▌   | 118225/179864.0 [00:26<00:12, 4790.55it/s]
 66%|██████▌   | 118705/179864.0 [00:26<00:12, 4748.06it/s]
 66%|██████▋   | 119180/179864.0 [00:26<00:12, 4734.45it/s]
 67%|██████▋   | 119654/179864.0 [00:26<00:12, 4724.42it/s]
 67%|██████▋   | 120154/179864.0 [00:26<00:12, 4805.15it/s]
 67%|██████▋   | 120635/179864.0 [00:27<00:12, 4789.68it/s]
 67%|██████▋   | 121115/179864.0 [00:27<00:12, 4770.91it/s]
 68%|██████▊   | 121596/179864.0 [00:27<00:12, 4782.07it/s]
 68%|██████▊   | 122075/179864.0 [00:27<00:12, 4776.53it/s]
 68%|██████▊   | 122553/179864.0 [00:27<00:12, 4716.09it/s]
 68%|██████▊   | 123025/179864.0 [00:27<00:12, 4679.85it/s]
 69%|██████▊   | 123517/179864.0 [00:27<00:11, 4750.42it/s]
 69%|██████▉   | 124002/179864.0 [00:27<00:11, 4778.21it/s]
 69%|██████▉   | 124483/179864.0 [00:27<00:11, 4783.11it/s]
 69%|██████▉   | 124967/179864.0 [00:27<00:11, 4800.06it/s]
 70%|██████▉   | 125448/179864.0 [00:28<00:11, 4740.21it/s]
 70%|███████   | 125923/179864.0 [00:28<00:11, 4672.04it/s]
 70%|███████   | 126394/179864.0 [00:28<00:11, 4680.70it/s]
 71%|███████   | 126883/179864.0 [00:28<00:11, 4740.54it/s]
 71%|███████   | 127376/179864.0 [00:28<00:10, 4796.68it/s]
 71%|███████   | 127856/179864.0 [00:28<00:10, 4756.12it/s]
 71%|███████▏  | 128332/179864.0 [00:28<00:10, 4693.25it/s]
 72%|███████▏  | 128802/179864.0 [00:28<00:10, 4693.61it/s]
 72%|███████▏  | 129272/179864.0 [00:28<00:10, 4599.58it/s]
 72%|███████▏  | 129733/179864.0 [00:28<00:10, 4590.80it/s]
 72%|███████▏  | 130208/179864.0 [00:29<00:10, 4634.52it/s]
 73%|███████▎  | 130688/179864.0 [00:29<00:10, 4683.12it/s]
 73%|███████▎  | 131174/179864.0 [00:29<00:10, 4734.25it/s]
 73%|███████▎  | 131648/179864.0 [00:29<00:10, 4687.65it/s]
 73%|███████▎  | 132119/179864.0 [00:29<00:10, 4689.52it/s]
 74%|███████▎  | 132589/179864.0 [00:29<00:10, 4562.32it/s]
 74%|███████▍  | 133047/179864.0 [00:29<00:10, 4507.61it/s]
 74%|███████▍  | 133506/179864.0 [00:29<00:10, 4530.78it/s]
 74%|███████▍  | 133970/179864.0 [00:29<00:10, 4561.80it/s]
 75%|███████▍  | 134432/179864.0 [00:29<00:09, 4577.14it/s]
 75%|███████▍  | 134891/179864.0 [00:30<00:09, 4579.54it/s]
 75%|███████▌  | 135362/179864.0 [00:30<00:09, 4617.97it/s]
 76%|███████▌  | 135824/179864.0 [00:30<00:09, 4551.73it/s]
 76%|███████▌  | 136280/179864.0 [00:30<00:09, 4460.68it/s]
 76%|███████▌  | 136736/179864.0 [00:30<00:09, 4489.23it/s]
 76%|███████▋  | 137198/179864.0 [00:30<00:09, 4526.97it/s]
 77%|███████▋  | 137673/179864.0 [00:30<00:09, 4592.40it/s]
 77%|███████▋  | 138135/179864.0 [00:30<00:09, 4598.38it/s]
 77%|███████▋  | 138596/179864.0 [00:30<00:08, 4600.98it/s]
 77%|███████▋  | 139057/179864.0 [00:30<00:09, 4511.69it/s]
 78%|███████▊  | 139509/179864.0 [00:31<00:09, 4394.92it/s]
 78%|███████▊  | 139960/179864.0 [00:31<00:09, 4428.10it/s]
 78%|███████▊  | 140445/179864.0 [00:31<00:08, 4547.83it/s]
 78%|███████▊  | 140917/179864.0 [00:31<00:08, 4598.58it/s]
 79%|███████▊  | 141381/179864.0 [00:31<00:08, 4610.79it/s]
 79%|███████▉  | 141843/179864.0 [00:31<00:08, 4606.16it/s]
 79%|███████▉  | 142304/179864.0 [00:31<00:08, 4533.23it/s]
 79%|███████▉  | 142758/179864.0 [00:31<00:08, 4491.12it/s]
 80%|███████▉  | 143227/179864.0 [00:31<00:08, 4545.93it/s]
 80%|███████▉  | 143693/179864.0 [00:31<00:07, 4578.56it/s]
 80%|████████  | 144179/179864.0 [00:32<00:07, 4661.80it/s]
 80%|████████  | 144660/179864.0 [00:32<00:07, 4703.94it/s]
 81%|████████  | 145131/179864.0 [00:32<00:07, 4681.59it/s]
 81%|████████  | 145600/179864.0 [00:32<00:07, 4578.93it/s]
 81%|████████  | 146076/179864.0 [00:32<00:07, 4631.82it/s]
 81%|████████▏ | 146560/179864.0 [00:32<00:07, 4691.63it/s]
 82%|████████▏ | 147030/179864.0 [00:32<00:07, 4682.94it/s]
 82%|████████▏ | 147522/179864.0 [00:32<00:06, 4751.90it/s]
 82%|████████▏ | 147998/179864.0 [00:32<00:06, 4686.07it/s]
 83%|████████▎ | 148467/179864.0 [00:33<00:06, 4656.34it/s]
 83%|████████▎ | 148933/179864.0 [00:33<00:06, 4570.20it/s]
 83%|████████▎ | 149406/179864.0 [00:33<00:06, 4616.76it/s]
 83%|████████▎ | 149872/179864.0 [00:33<00:06, 4629.43it/s]
 84%|████████▎ | 150346/179864.0 [00:33<00:06, 4662.14it/s]
 84%|████████▍ | 150813/179864.0 [00:33<00:06, 4659.16it/s]
 84%|████████▍ | 151280/179864.0 [00:33<00:06, 4593.24it/s]
 84%|████████▍ | 151740/179864.0 [00:33<00:06, 4548.82it/s]
 85%|████████▍ | 152201/179864.0 [00:33<00:06, 4564.88it/s]
 85%|████████▍ | 152658/179864.0 [00:33<00:05, 4534.71it/s]
 85%|████████▌ | 153121/179864.0 [00:34<00:05, 4561.39it/s]
 85%|████████▌ | 153578/179864.0 [00:34<00:05, 4555.45it/s]
 86%|████████▌ | 154034/179864.0 [00:34<00:05, 4518.27it/s]
 86%|████████▌ | 154486/179864.0 [00:34<00:05, 4454.17it/s]
 86%|████████▌ | 154932/179864.0 [00:34<00:05, 4416.05it/s]
 86%|████████▋ | 155394/179864.0 [00:34<00:05, 4472.99it/s]
 87%|████████▋ | 155851/179864.0 [00:34<00:05, 4501.53it/s]
 87%|████████▋ | 156302/179864.0 [00:34<00:05, 4481.63it/s]
 87%|████████▋ | 156754/179864.0 [00:34<00:05, 4490.75it/s]
 87%|████████▋ | 157204/179864.0 [00:34<00:05, 4405.72it/s]
 88%|████████▊ | 157645/179864.0 [00:35<00:05, 4354.58it/s]
 88%|████████▊ | 158103/179864.0 [00:35<00:04, 4419.81it/s]
 88%|████████▊ | 158579/179864.0 [00:35<00:04, 4519.64it/s]
 88%|████████▊ | 159038/179864.0 [00:35<00:04, 4539.18it/s]
 89%|████████▊ | 159493/179864.0 [00:35<00:04, 4486.52it/s]
 89%|████████▉ | 159942/179864.0 [00:35<00:04, 4368.28it/s]
 89%|████████▉ | 160380/179864.0 [00:35<00:04, 4334.82it/s]
 89%|████████▉ | 160835/179864.0 [00:35<00:04, 4396.64it/s]
 90%|████████▉ | 161297/179864.0 [00:35<00:04, 4462.03it/s]
 90%|████████▉ | 161744/179864.0 [00:35<00:04, 4456.24it/s]
 90%|█████████ | 162190/179864.0 [00:36<00:03, 4437.38it/s]
 90%|█████████ | 162634/179864.0 [00:36<00:03, 4336.77it/s]
 91%|█████████ | 163073/179864.0 [00:36<00:03, 4352.36it/s]
 91%|█████████ | 163531/179864.0 [00:36<00:03, 4418.66it/s]
 91%|█████████ | 163980/179864.0 [00:36<00:03, 4439.18it/s]
 91%|█████████▏| 164425/179864.0 [00:36<00:03, 4375.89it/s]
 92%|█████████▏| 164863/179864.0 [00:36<00:03, 4345.91it/s]
 92%|█████████▏| 165305/179864.0 [00:36<00:03, 4366.65it/s]
 92%|█████████▏| 165760/179864.0 [00:36<00:03, 4418.97it/s]
 92%|█████████▏| 166212/179864.0 [00:36<00:03, 4447.73it/s]
 93%|█████████▎| 166657/179864.0 [00:37<00:03, 4399.60it/s]
 93%|█████████▎| 167098/179864.0 [00:37<00:02, 4341.03it/s]
 93%|█████████▎| 167554/179864.0 [00:37<00:02, 4404.42it/s]
 93%|█████████▎| 168005/179864.0 [00:37<00:02, 4432.75it/s]
 94%|█████████▎| 168449/179864.0 [00:37<00:02, 4423.06it/s]
 94%|█████████▍| 168892/179864.0 [00:37<00:02, 4405.17it/s]
 94%|█████████▍| 169333/179864.0 [00:37<00:02, 4333.30it/s]
 94%|█████████▍| 169770/179864.0 [00:37<00:02, 4343.46it/s]
 95%|█████████▍| 170229/179864.0 [00:37<00:02, 4416.28it/s]
 95%|█████████▍| 170671/179864.0 [00:38<00:02, 4400.02it/s]
 95%|█████████▌| 171112/179864.0 [00:38<00:02, 4340.95it/s]
 95%|█████████▌| 171547/179864.0 [00:38<00:01, 4305.73it/s]
 96%|█████████▌| 171979/179864.0 [00:38<00:01, 4308.68it/s]
 96%|█████████▌| 172411/179864.0 [00:38<00:01, 4310.98it/s]
 96%|█████████▌| 172843/179864.0 [00:38<00:01, 4281.44it/s]
 96%|█████████▋| 173272/179864.0 [00:38<00:01, 4266.90it/s]
 97%|█████████▋| 173701/179864.0 [00:38<00:01, 4272.96it/s]
 97%|█████████▋| 174129/179864.0 [00:39<00:02, 2447.35it/s]
 97%|█████████▋| 174541/179864.0 [00:39<00:01, 2774.05it/s]
 97%|█████████▋| 174984/179864.0 [00:39<00:01, 3134.43it/s]
 98%|█████████▊| 175430/179864.0 [00:39<00:01, 3449.64it/s]
 98%|█████████▊| 175852/179864.0 [00:39<00:01, 3643.87it/s]
 98%|█████████▊| 176272/179864.0 [00:39<00:00, 3791.09it/s]
 98%|█████████▊| 176709/179864.0 [00:39<00:00, 3949.21it/s]
 98%|█████████▊| 177145/179864.0 [00:39<00:00, 4062.50it/s]
 99%|█████████▊| 177569/179864.0 [00:39<00:00, 4085.88it/s]
 99%|█████████▉| 178032/179864.0 [00:39<00:00, 4242.24it/s]
 99%|█████████▉| 178466/179864.0 [00:40<00:00, 4263.11it/s]
 99%|█████████▉| 178917/179864.0 [00:40<00:00, 4335.58it/s]
100%|█████████▉| 179404/179864.0 [00:40<00:00, 4492.95it/s]
100%|██████████| 179864/179864.0 [00:40<00:00, 4453.44it/s]
Optimizing level 2 [max iter: 10000]
Optimizing level 1 [max iter: 1000]
Optimizing level 0 [max iter: 100]
Optimizing level 2 [max iter: 10000]
Optimizing level 1 [max iter: 1000]
Optimizing level 0 [max iter: 100]
Optimizing level 2 [max iter: 10000]
Optimizing level 1 [max iter: 1000]
Optimizing level 0 [max iter: 100]

0it [00:00, ?it/s]
18it [00:00, 176.74it/s]
39it [00:00, 193.51it/s]
59it [00:00, 187.28it/s]
81it [00:00, 195.26it/s]
101it [00:00, 192.89it/s]
123it [00:00, 200.73it/s]
144it [00:00, 194.34it/s]
166it [00:00, 200.63it/s]
187it [00:00, 203.28it/s]
208it [00:01, 197.77it/s]
228it [00:01, 196.62it/s]
251it [00:01, 205.43it/s]
274it [00:01, 210.00it/s]
296it [00:01, 211.15it/s]
322it [00:01, 225.13it/s]
345it [00:01, 223.70it/s]
370it [00:01, 225.06it/s]
393it [00:01, 213.04it/s]
415it [00:02, 198.57it/s]
441it [00:02, 214.35it/s]
464it [00:02, 218.60it/s]
489it [00:02, 225.77it/s]
512it [00:02, 219.66it/s]
535it [00:02, 214.50it/s]
557it [00:02, 209.83it/s]
579it [00:02, 210.04it/s]
603it [00:02, 218.21it/s]
625it [00:02, 217.93it/s]
651it [00:03, 228.61it/s]
674it [00:03, 227.90it/s]
697it [00:03, 212.12it/s]
719it [00:03, 204.25it/s]
741it [00:03, 207.49it/s]
764it [00:03, 211.93it/s]
786it [00:03, 210.11it/s]
808it [00:03, 203.85it/s]
832it [00:03, 213.19it/s]
857it [00:04, 220.94it/s]
880it [00:04, 201.66it/s]
901it [00:04, 201.91it/s]
926it [00:04, 213.42it/s]
948it [00:04, 214.35it/s]
970it [00:04, 210.30it/s]
992it [00:04, 204.94it/s]
1013it [00:04, 205.97it/s]
1034it [00:04, 200.06it/s]
1055it [00:05, 197.39it/s]
1075it [00:05, 194.48it/s]
1097it [00:05, 199.88it/s]
1119it [00:05, 204.24it/s]
1140it [00:05, 205.28it/s]
1162it [00:05, 206.18it/s]
1183it [00:05, 193.31it/s]
1206it [00:05, 203.26it/s]
1230it [00:05, 212.80it/s]
1254it [00:06, 220.38it/s]
1277it [00:06, 221.54it/s]
1300it [00:06, 216.35it/s]
1322it [00:06, 213.21it/s]
1344it [00:06, 210.23it/s]
1366it [00:06, 212.69it/s]
1390it [00:06, 218.07it/s]
1412it [00:06, 216.31it/s]
1438it [00:06, 228.16it/s]
1461it [00:06, 223.59it/s]
1484it [00:07, 208.30it/s]
1506it [00:07, 205.63it/s]
1527it [00:07, 196.51it/s]
1547it [00:07, 195.81it/s]
1569it [00:07, 201.48it/s]
1590it [00:07, 199.11it/s]
1610it [00:07, 193.43it/s]
1631it [00:07, 196.95it/s]
1654it [00:07, 206.10it/s]
1676it [00:08, 207.18it/s]
1697it [00:08, 197.01it/s]
1717it [00:08, 192.07it/s]
1737it [00:08, 192.41it/s]
1759it [00:08, 200.03it/s]
1781it [00:08, 203.33it/s]
1802it [00:08, 201.85it/s]
1823it [00:08, 196.45it/s]
1844it [00:08, 195.87it/s]
1866it [00:09, 200.71it/s]
1888it [00:09, 205.79it/s]
1909it [00:09, 197.86it/s]
1930it [00:09, 199.22it/s]
1951it [00:09, 199.70it/s]
1974it [00:09, 205.34it/s]
1995it [00:09, 200.12it/s]
2019it [00:09, 209.04it/s]
2046it [00:09, 222.72it/s]
2069it [00:09, 222.53it/s]
2092it [00:10, 219.51it/s]
2121it [00:10, 238.51it/s]
2146it [00:10, 241.05it/s]
2171it [00:10, 231.47it/s]
2195it [00:10, 226.56it/s]
2218it [00:10, 213.34it/s]
2240it [00:10, 210.01it/s]
2262it [00:10, 211.40it/s]
2284it [00:10, 209.39it/s]
2305it [00:11, 204.68it/s]
2329it [00:11, 213.89it/s]
2351it [00:11, 206.53it/s]
2375it [00:11, 213.65it/s]
2397it [00:11, 212.14it/s]
2421it [00:11, 218.79it/s]
2443it [00:11, 211.53it/s]
2465it [00:11, 204.47it/s]
2486it [00:11, 205.53it/s]
2507it [00:12, 206.71it/s]
2530it [00:12, 211.94it/s]
2552it [00:12, 202.38it/s]
2575it [00:12, 207.47it/s]
2600it [00:12, 214.66it/s]
2622it [00:12, 215.63it/s]
2644it [00:12, 196.62it/s]
2667it [00:12, 203.10it/s]
2690it [00:12, 204.00it/s]
2711it [00:13, 197.57it/s]
2731it [00:13, 197.62it/s]
2757it [00:13, 213.86it/s]
2779it [00:13, 214.52it/s]
2802it [00:13, 217.47it/s]
2825it [00:13, 218.94it/s]
2847it [00:13, 214.00it/s]
2869it [00:13, 213.27it/s]
2892it [00:13, 217.05it/s]
2916it [00:13, 220.78it/s]
2941it [00:14, 226.39it/s]
2964it [00:14, 218.84it/s]
2986it [00:14, 213.60it/s]
3008it [00:14, 197.65it/s]
3030it [00:14, 200.73it/s]
3054it [00:14, 210.56it/s]
3077it [00:14, 213.68it/s]
3101it [00:14, 219.09it/s]
3127it [00:14, 229.30it/s]
3151it [00:15, 205.22it/s]
3173it [00:15, 202.32it/s]
3198it [00:15, 213.73it/s]
3198it [00:15, 209.26it/s]

  0%|          | 0/8 [00:00<?, ?it/s]
 12%|█▎        | 1/8 [00:00<00:02,  3.43it/s]
 25%|██▌       | 2/8 [00:00<00:01,  3.36it/s]
 38%|███▊      | 3/8 [00:00<00:01,  3.35it/s]
 50%|█████     | 4/8 [00:01<00:01,  3.50it/s]
 62%|██████▎   | 5/8 [00:01<00:00,  3.42it/s]
 75%|███████▌  | 6/8 [00:01<00:00,  3.45it/s]
 88%|████████▊ | 7/8 [00:02<00:00,  3.42it/s]
100%|██████████| 8/8 [00:02<00:00,  3.40it/s]
100%|██████████| 8/8 [00:02<00:00,  3.41it/s]

  0%|          | 0/8 [00:00<?, ?it/s]
 12%|█▎        | 1/8 [00:00<00:02,  3.39it/s]
 25%|██▌       | 2/8 [00:00<00:01,  3.70it/s]
 38%|███▊      | 3/8 [00:00<00:01,  4.19it/s]
 50%|█████     | 4/8 [00:00<00:00,  4.32it/s]
 62%|██████▎   | 5/8 [00:01<00:00,  4.40it/s]
 75%|███████▌  | 6/8 [00:01<00:00,  4.47it/s]
 88%|████████▊ | 7/8 [00:01<00:00,  4.46it/s]
100%|██████████| 8/8 [00:01<00:00,  4.56it/s]
100%|██████████| 8/8 [00:01<00:00,  4.35it/s]

Create Group Density Maps:#

pyAFQ can make density maps of streamline counts per subject/session by calling myafq.export(“density_map”). When using GroupAFQ, you can also combine these into one file by calling myafq.export_group_density().

group_density = myafq.export_group_density()
group_density = nib.load(group_density).get_fdata()
fig, ax = plt.subplots(1)
ax.matshow(
    group_density[:, :, group_density.shape[-1] // 2, 0],
    cmap='viridis')
ax.axis("off")
plot afq callosal
  0%|          | 0/1 [00:00<?, ?it/s]
100%|██████████| 1/1 [00:00<00:00, 12.55it/s]

(-0.5, 105.5, 80.5, -0.5)

Visualizing bundles and tract profiles:#

This would run the script and visualize the bundles using the plotly interactive visualization, which should automatically open in a new browser window.

bundle_html = myafq.export("all_bundles_figure")
plotly.io.show(bundle_html["01"][0])

Total running time of the script: (15 minutes 3.661 seconds)

Estimated memory usage: 2166 MB

Gallery generated by Sphinx-Gallery