Getting started programming with pyAFQ#

There are two ways to use pyAFQ: through the command line interface, and by writing Python code. This tutorial will walk you through the basics of the latter, using pyAFQ’s Python Application Programming Interface (API).

import os.path as op

import matplotlib.pyplot as plt
import nibabel as nib
import plotly
import pandas as pd

from AFQ.api.group import GroupAFQ
import AFQ.data.fetch as afd
import AFQ.viz.altair as ava

Example data#

pyAFQ assumes that the data is organized in a BIDS compliant directory. To get users started with this tutorial, we will download some example data and organize it in a BIDS compliant way (for more details on how BIDS is used in pyAFQ, refer to bids_tutorial).

The following call dowloads a dataset that contains a single subject’s high angular resolution diffusion imaging (HARDI) data, collected at the Stanford Vista Lab

Note

See https://purl.stanford.edu/ng782rw8378 for details on dataset.

The data are downloaded and organized locally into a BIDS compliant anatomical data folder (anat) and a diffusion-weighted imaging data (dwi) folder, which are both placed in the user’s home directory under:

``~/AFQ_data/stanford_hardi/``

The data is also placed in a derivatives directory, signifying that it has already undergone the required preprocessing necessary for pyAFQ to run.

The clear_previous_afq is used to remove any previous runs of the afq object stored in the ~/AFQ_data/stanford_hardi/ BIDS directory. Set it to None if you want to use the results of previous runs.

afd.organize_stanford_data(clear_previous_afq="track")

Set tractography parameters (optional)#

We make create a tracking_params variable, which we will pass to the GroupAFQ object which specifies that we want 25,000 seeds randomly distributed in the white matter. We only do this to make this example faster and consume less space. We also set num_chunks to True, which will use ray to parallelize the tracking across all cores. This can be removed to process in serial, or set to use a particular distribution of work by setting n_chunks to an integer number.

tracking_params = dict(n_seeds=25000,
                       random_seeds=True,
                       rng_seed=2022,
                       trx=True,
                       num_chunks=True)

Initialize a GroupAFQ object:#

Creates a GroupAFQ object, that encapsulates tractometry. This object can be used to manage the entire AFQ pipeline, including:

  • Tractography

  • Registration

  • Segmentation

  • Cleaning

  • Profiling

  • Visualization

This will also create an output folder for the corresponding AFQ derivatives in the AFQ data directory: AFQ_data/stanford_hardi/derivatives/afq/

To initialize this object we will pass in the path location to our BIDS compliant data, the name of the preprocessing pipeline we want to use, and the tracking parameters we defined above. We will also specify the visualization backend we want to use (see below for more details). We will also be using plotly to generate an interactive visualization. The value plotly_no_gif indicates that interactive visualizations will be generated as html web-pages that can be opened in a browser, but not as static gif files.

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

Calculating DTI FA (Diffusion Tensor Imaging Fractional Anisotropy)#

The GroupAFQ object has a method called export, which allows the user to calculate various derived quantities from the data.

For example, FA can be computed using the DTI model, by explicitly calling myafq.export(“dti_fa”). This triggers the computation of DTI parameters for all subjects in the dataset, and stores the results in the AFQ derivatives directory. In addition, it calculates the FA from these parameters and stores it in a different file in the same directory.

Note

The AFQ API computes quantities lazily. This means that DTI parameters are not computed until they are required. This means that the first line below is the one that requires time.

The result of the call to export is a dictionary, with the subject IDs as keys, and the filenames of the corresponding files as values. This means that to extract the filename corresponding to the FA of the first subject, we can do:

FA_fname = myafq.export("dti_fa")["01"]

# We will then use `nibabel` to load the deriviative file and retrieve the
# data array.

FA_img = nib.load(FA_fname)
FA = FA_img.get_fdata()

Visualize the result with Matplotlib#

At this point FA is an array, and we can use standard Python tools to visualize it or perform additional computations with it.

In this case we are going to take an axial slice halfway through the FA data array and plot using a sequential color map.

Note

The data array is structured as a xyz coordinate system.

fig, ax = plt.subplots(1)
ax.matshow(FA[:, :, FA.shape[-1] // 2], cmap='viridis')
ax.axis("off")
plot 001 afq api
(-0.5, 105.5, 80.5, -0.5)

Recognizing the bundles and calculating tract profiles:#

Typically, users of pyAFQ are interested in calculating not only an overall map of the FA, but also the major white matter pathways (or bundles) and tract profiles of tissue properties along their length. To trigger the pyAFQ pipeline that calculates the profiles, users can call the export(‘profiles’) method:

Note

Running the code below triggers the full pipeline of operations leading to the computation of the tract profiles. Therefore, it takes a little while to run (about 40 minutes, typically).

myafq.export('profiles')
(TractActor pid=4922)
0it [00:00, ?it/s]
(TractActor pid=4921)
1it [00:00,  3.35it/s]
(TractActor pid=4922)
1it [00:00,  2.06it/s]
(TractActor pid=4923)
19it [00:00, 186.41it/s]
(TractActor pid=4921)
25it [00:00, 79.28it/s]
(TractActor pid=4922)
21it [00:00, 46.75it/s]
(TractActor pid=4923)
38it [00:00, 177.46it/s]
(TractActor pid=4921)
50it [00:00, 130.78it/s]
(TractActor pid=4922)
40it [00:00, 81.57it/s]
(TractActor pid=4923)
56it [00:00, 178.32it/s]
(TractActor pid=4921)
75it [00:00, 166.45it/s]
(TractActor pid=4922)
58it [00:00, 105.87it/s]
(TractActor pid=4923)
74it [00:00, 176.15it/s]
(TractActor pid=4921)
103it [00:00, 199.94it/s]
(TractActor pid=4922)
78it [00:00, 130.28it/s]
(TractActor pid=4923)
97it [00:00, 191.59it/s]
(TractActor pid=4921)
127it [00:00, 206.10it/s]
(TractActor pid=4922)
104it [00:00, 165.12it/s]
(TractActor pid=4923)
119it [00:00, 196.92it/s]
(TractActor pid=4921)
150it [00:00, 192.36it/s]
(TractActor pid=4922)
125it [00:01, 170.55it/s]
(TractActor pid=4923)
139it [00:00, 189.40it/s]
(TractActor pid=4921)
171it [00:01, 186.25it/s]
(TractActor pid=4922)
145it [00:01, 153.26it/s]
(TractActor pid=4923)
158it [00:00, 158.19it/s]
(TractActor pid=4921)
195it [00:01, 198.43it/s]
(TractActor pid=4922)
163it [00:01, 155.18it/s]
(TractActor pid=4923)
176it [00:01, 159.13it/s]
(TractActor pid=4921)
221it [00:01, 213.70it/s]
(TractActor pid=4922)
181it [00:01, 156.72it/s]
(TractActor pid=4923)
196it [00:01, 167.59it/s]
(TractActor pid=4921)
244it [00:01, 207.60it/s]
(TractActor pid=4922)
201it [00:01, 167.81it/s]
(TractActor pid=4923)
215it [00:01, 172.25it/s]
(TractActor pid=4921)
266it [00:01, 210.50it/s]
(TractActor pid=4922)
221it [00:01, 175.14it/s]
(TractActor pid=4923)
233it [00:01, 170.50it/s]
(TractActor pid=4921)
288it [00:01, 191.30it/s]
(TractActor pid=4922)
240it [00:01, 168.31it/s]
(TractActor pid=4923)
251it [00:01, 166.73it/s]
(TractActor pid=4921)
312it [00:01, 201.77it/s]
(TractActor pid=4922)
258it [00:01, 163.99it/s]
(TractActor pid=4923)
268it [00:01, 166.77it/s]
(TractActor pid=4921)
333it [00:01, 199.34it/s]
(TractActor pid=4923)
285it [00:01, 145.59it/s]
(TractActor pid=4921)
355it [00:01, 202.96it/s]
(TractActor pid=4922)
278it [00:02, 144.47it/s]
(TractActor pid=4923)
301it [00:01, 146.76it/s]
(TractActor pid=4921)
382it [00:02, 221.25it/s]
(TractActor pid=4922)
295it [00:02, 149.46it/s]
(TractActor pid=4923)
318it [00:01, 151.28it/s]
(TractActor pid=4921)
405it [00:02, 210.65it/s]
(TractActor pid=4922)
314it [00:02, 159.53it/s]
(TractActor pid=4923)
337it [00:02, 160.25it/s]
(TractActor pid=4921)
427it [00:02, 209.84it/s]
(TractActor pid=4922)
331it [00:02, 157.84it/s]
(TractActor pid=4921)
452it [00:02, 219.75it/s]
(TractActor pid=4922)
348it [00:02, 160.40it/s]
(TractActor pid=4923)
354it [00:02, 157.32it/s]
(TractActor pid=4922)
367it [00:02, 163.72it/s]
(TractActor pid=4923)
375it [00:02, 171.94it/s]
(TractActor pid=4921)
475it [00:02, 205.32it/s]
(TractActor pid=4922)
388it [00:02, 170.92it/s]
(TractActor pid=4921)
497it [00:02, 207.78it/s]
(TractActor pid=4923)
393it [00:02, 171.77it/s]
(TractActor pid=4922)
407it [00:02, 174.82it/s]
(TractActor pid=4923)
411it [00:02, 169.44it/s]
(TractActor pid=4921)
519it [00:02, 207.88it/s]
544it [00:02, 219.10it/s]
(TractActor pid=4922)
425it [00:02, 171.52it/s]
(TractActor pid=4923)
429it [00:02, 168.00it/s]
(TractActor pid=4922)
443it [00:03, 168.65it/s]
(TractActor pid=4923)
447it [00:02, 169.70it/s]
(TractActor pid=4921)
567it [00:02, 218.54it/s]
(TractActor pid=4922)
460it [00:03, 168.23it/s]
(TractActor pid=4921)
589it [00:03, 217.63it/s]
(TractActor pid=4923)
465it [00:02, 166.10it/s]
(TractActor pid=4921)
612it [00:03, 220.56it/s]
(TractActor pid=4922)
477it [00:03, 154.37it/s]
(TractActor pid=4923)
482it [00:02, 157.22it/s]
(TractActor pid=4922)
496it [00:03, 164.02it/s]
(TractActor pid=4923)
500it [00:03, 162.15it/s]
(TractActor pid=4921)
635it [00:03, 210.24it/s]
(TractActor pid=4922)
514it [00:03, 165.70it/s]
(TractActor pid=4923)
517it [00:03, 160.52it/s]
(TractActor pid=4921)
657it [00:03, 205.59it/s]
(TractActor pid=4922)
531it [00:03, 161.61it/s]
(TractActor pid=4923)
535it [00:03, 164.87it/s]
(TractActor pid=4921)
679it [00:03, 207.60it/s]
(TractActor pid=4922)
552it [00:03, 174.89it/s]
(TractActor pid=4923)
555it [00:03, 170.29it/s]
(TractActor pid=4921)
704it [00:03, 218.77it/s]
(TractActor pid=4922)
570it [00:03, 170.46it/s]
(TractActor pid=4923)
573it [00:03, 173.00it/s]
(TractActor pid=4921)
726it [00:03, 193.26it/s]
(TractActor pid=4922)
588it [00:03, 169.28it/s]
(TractActor pid=4923)
591it [00:03, 171.64it/s]
(TractActor pid=4921)
753it [00:03, 213.42it/s]
(TractActor pid=4923)
609it [00:03, 172.06it/s]
(TractActor pid=4921)
775it [00:03, 207.97it/s]
(TractActor pid=4922)
606it [00:04, 167.74it/s]
(TractActor pid=4923)
629it [00:03, 176.67it/s]
(TractActor pid=4921)
803it [00:04, 224.94it/s]
(TractActor pid=4922)
627it [00:04, 176.24it/s]
(TractActor pid=4923)
647it [00:03, 161.25it/s]
(TractActor pid=4921)
827it [00:04, 226.29it/s]
(TractActor pid=4922)
645it [00:04, 159.93it/s]
(TractActor pid=4923)
665it [00:03, 165.88it/s]
(TractActor pid=4921)
852it [00:04, 232.86it/s]
(TractActor pid=4922)
663it [00:04, 164.27it/s]
(TractActor pid=4923)
682it [00:04, 164.82it/s]
(TractActor pid=4921)
876it [00:04, 224.12it/s]
(TractActor pid=4922)
681it [00:04, 165.70it/s]
(TractActor pid=4923)
702it [00:04, 171.03it/s]
(TractActor pid=4921)
899it [00:04, 223.56it/s]
(TractActor pid=4922)
700it [00:04, 171.56it/s]
(TractActor pid=4921)
922it [00:04, 217.04it/s]
(TractActor pid=4923)
720it [00:04, 146.76it/s]
(TractActor pid=4921)
946it [00:04, 222.90it/s]
(TractActor pid=4922)
718it [00:04, 145.91it/s]
(TractActor pid=4923)
739it [00:04, 156.09it/s]
(TractActor pid=4921)
970it [00:04, 227.74it/s]
(TractActor pid=4922)
738it [00:04, 156.79it/s]
(TractActor pid=4923)
758it [00:04, 161.31it/s]
(TractActor pid=4923)
0it [00:00, ?it/s] [repeated 2x across cluster] (Ray deduplicates logs by default. Set RAY_DEDUP_LOGS=0 to disable log deduplication, or see https://docs.ray.io/en/master/ray-observability/user-guides/configure-logging.html#log-deduplication for more options.)
(TractActor pid=4921)
993it [00:04, 219.91it/s]
(TractActor pid=4922)
758it [00:05, 161.69it/s]
(TractActor pid=4923)
775it [00:04, 162.28it/s]
(TractActor pid=4921)
1016it [00:04, 221.02it/s]
(TractActor pid=4922)
775it [00:05, 162.58it/s]
(TractActor pid=4923)
798it [00:04, 176.83it/s]
(TractActor pid=4921)
1039it [00:05, 219.99it/s]
(TractActor pid=4922)
798it [00:05, 176.86it/s]
(TractActor pid=4923)
817it [00:04, 180.16it/s]
(TractActor pid=4921)
1062it [00:05, 220.28it/s]
(TractActor pid=4922)
817it [00:05, 180.08it/s]
(TractActor pid=4923)
836it [00:04, 175.26it/s]
(TractActor pid=4921)
1085it [00:05, 222.64it/s]
(TractActor pid=4922)
836it [00:05, 175.26it/s]
(TractActor pid=4923)
856it [00:05, 182.15it/s]
(TractActor pid=4922)
856it [00:05, 182.11it/s]
(TractActor pid=4923)
875it [00:05, 184.38it/s]
(TractActor pid=4921)
1108it [00:05, 212.17it/s]
(TractActor pid=4922)
875it [00:05, 184.30it/s]
(TractActor pid=4923)
894it [00:05, 179.99it/s]
(TractActor pid=4921)
1130it [00:05, 210.53it/s]
(TractActor pid=4922)
894it [00:05, 179.92it/s]
(TractActor pid=4923)
913it [00:05, 172.58it/s]
(TractActor pid=4921)
1152it [00:05, 171.09it/s]
(TractActor pid=4922)
913it [00:05, 172.75it/s]
(TractActor pid=4923)
931it [00:05, 169.51it/s]
(TractActor pid=4921)
1176it [00:05, 186.03it/s]
(TractActor pid=4922)
931it [00:05, 169.56it/s]
(TractActor pid=4923)
952it [00:05, 178.67it/s]
(TractActor pid=4921)
1199it [00:05, 194.85it/s]
(TractActor pid=4922)
952it [00:06, 178.67it/s]
(TractActor pid=4923)
971it [00:05, 179.93it/s]
(TractActor pid=4921)
1225it [00:06, 210.98it/s]
(TractActor pid=4922)
971it [00:06, 180.02it/s]
(TractActor pid=4923)
990it [00:05, 176.60it/s]
(TractActor pid=4921)
1249it [00:06, 216.43it/s]
(TractActor pid=4922)
990it [00:06, 176.68it/s]
(TractActor pid=4921)
1278it [00:06, 234.67it/s]
(TractActor pid=4922)
1008it [00:06, 165.97it/s]
(TractActor pid=4923)
1008it [00:05, 165.96it/s]
(TractActor pid=4922)
1026it [00:06, 169.66it/s]
(TractActor pid=4923)
1026it [00:06, 169.67it/s]
(TractActor pid=4921)
1302it [00:06, 223.91it/s]
(TractActor pid=4922)
1045it [00:06, 174.19it/s]
(TractActor pid=4923)
1045it [00:06, 174.20it/s]
(TractActor pid=4921)
1325it [00:06, 223.91it/s]
(TractActor pid=4923)
1063it [00:06, 172.80it/s]
(TractActor pid=4921)
1348it [00:06, 202.94it/s]
(TractActor pid=4922)
1063it [00:06, 164.38it/s]
(TractActor pid=4923)
1086it [00:06, 186.92it/s]
(TractActor pid=4921)
1369it [00:06, 200.82it/s]
(TractActor pid=4922)
1080it [00:06, 165.13it/s]
(TractActor pid=4923)
1105it [00:06, 183.84it/s]
(TractActor pid=4921)
1394it [00:06, 213.01it/s]
(TractActor pid=4922)
1098it [00:06, 167.55it/s]
(TractActor pid=4923)
1124it [00:06, 180.42it/s]
(TractActor pid=4921)
1416it [00:06, 210.43it/s]
(TractActor pid=4922)
1117it [00:07, 171.95it/s]
(TractActor pid=4923)
1143it [00:06, 164.37it/s]
(TractActor pid=4921)
1438it [00:07, 204.49it/s]
(TractActor pid=4922)
1135it [00:07, 165.73it/s]
(TractActor pid=4921)
1461it [00:07, 210.57it/s]
(TractActor pid=4923)
1160it [00:06, 133.76it/s]
(TractActor pid=4921)
1486it [00:07, 217.85it/s]
(TractActor pid=4922)
1152it [00:07, 126.94it/s]
(TractActor pid=4923)
1178it [00:07, 143.80it/s]
(TractActor pid=4922)
1172it [00:07, 142.85it/s]
(TractActor pid=4923)
1196it [00:07, 152.75it/s]
(TractActor pid=4921)
1508it [00:07, 196.45it/s]
(TractActor pid=4922)
1188it [00:07, 146.54it/s]
(TractActor pid=4923)
1213it [00:07, 155.45it/s]
(TractActor pid=4921)
1533it [00:07, 209.23it/s]
(TractActor pid=4922)
1205it [00:07, 152.23it/s]
(TractActor pid=4923)
1233it [00:07, 166.46it/s]
(TractActor pid=4921)
1555it [00:07, 193.15it/s]
(TractActor pid=4922)
1226it [00:07, 165.80it/s]
(TractActor pid=4923)
1252it [00:07, 171.89it/s]
(TractActor pid=4921)
1578it [00:07, 201.28it/s]
(TractActor pid=4922)
1244it [00:07, 167.35it/s]
(TractActor pid=4923)
1274it [00:07, 184.93it/s]
(TractActor pid=4921)
1602it [00:07, 210.42it/s]
(TractActor pid=4922)
1265it [00:08, 179.20it/s]
(TractActor pid=4923)
1294it [00:07, 187.73it/s]
(TractActor pid=4921)
1629it [00:07, 226.60it/s]
(TractActor pid=4922)
1287it [00:08, 187.70it/s]
(TractActor pid=4923)
1314it [00:07, 175.35it/s]
(TractActor pid=4921)
1655it [00:08, 235.31it/s]
(TractActor pid=4922)
1307it [00:08, 177.09it/s]
(TractActor pid=4923)
1332it [00:07, 164.88it/s]
(TractActor pid=4921)
1679it [00:08, 228.50it/s]
(TractActor pid=4922)
1326it [00:08, 174.24it/s]
(TractActor pid=4923)
1351it [00:08, 170.90it/s]
(TractActor pid=4922)
1344it [00:08, 169.75it/s]
(TractActor pid=4923)
1369it [00:08, 172.42it/s]
(TractActor pid=4921)
1703it [00:08, 184.54it/s]
(TractActor pid=4922)
1362it [00:08, 166.15it/s]
(TractActor pid=4923)
1388it [00:08, 175.49it/s]
(TractActor pid=4921)
1726it [00:08, 195.09it/s]
(TractActor pid=4922)
1382it [00:08, 172.63it/s]
(TractActor pid=4923)
1406it [00:08, 174.67it/s]
(TractActor pid=4921)
1748it [00:08, 200.34it/s]
(TractActor pid=4922)
1400it [00:08, 174.63it/s]
(TractActor pid=4921)
1775it [00:08, 218.33it/s]
(TractActor pid=4922)
1418it [00:08, 172.08it/s]
(TractActor pid=4923)
1424it [00:08, 168.54it/s]
(TractActor pid=4921)
1798it [00:08, 209.94it/s]
(TractActor pid=4923)
1441it [00:08, 162.36it/s]
(TractActor pid=4921)
1820it [00:08, 211.70it/s]
(TractActor pid=4922)
1436it [00:09, 164.62it/s]
(TractActor pid=4923)
1459it [00:08, 167.10it/s]
(TractActor pid=4921)
1844it [00:08, 217.18it/s]
(TractActor pid=4922)
1453it [00:09, 162.88it/s]
(TractActor pid=4923)
1478it [00:08, 171.84it/s]
(TractActor pid=4921)
1867it [00:09, 219.30it/s]
(TractActor pid=4922)
1472it [00:09, 168.45it/s]
(TractActor pid=4923)
1496it [00:08, 164.91it/s]
(TractActor pid=4921)
1890it [00:09, 219.85it/s]
(TractActor pid=4922)
1489it [00:09, 165.35it/s]
(TractActor pid=4923)
1513it [00:09, 151.09it/s]
(TractActor pid=4921)
1914it [00:09, 224.64it/s]
(TractActor pid=4922)
1506it [00:09, 157.86it/s]
(TractActor pid=4923)
1531it [00:09, 157.55it/s]
(TractActor pid=4921)
1937it [00:09, 222.33it/s]
(TractActor pid=4922)
1522it [00:09, 153.60it/s]
(TractActor pid=4923)
1548it [00:09, 151.29it/s]
(TractActor pid=4921)
1961it [00:09, 227.43it/s]
(TractActor pid=4922)
1539it [00:09, 155.64it/s]
(TractActor pid=4923)
1566it [00:09, 158.46it/s]
(TractActor pid=4921)
1984it [00:09, 224.84it/s]
(TractActor pid=4922)
1555it [00:09, 152.71it/s]
(TractActor pid=4923)
1584it [00:09, 159.88it/s]
(TractActor pid=4921)
2007it [00:09, 218.67it/s]
(TractActor pid=4922)
1574it [00:09, 161.13it/s]
(TractActor pid=4923)
1603it [00:09, 167.70it/s]
(TractActor pid=4921)
2029it [00:09, 213.75it/s]
(TractActor pid=4922)
1591it [00:09, 161.85it/s]
(TractActor pid=4923)
1623it [00:09, 176.22it/s]
(TractActor pid=4921)
2051it [00:09, 211.29it/s]
(TractActor pid=4922)
1611it [00:10, 171.16it/s]
(TractActor pid=4923)
1643it [00:09, 180.11it/s]
(TractActor pid=4921)
2074it [00:10, 214.53it/s]
(TractActor pid=4922)
1632it [00:10, 181.97it/s]
(TractActor pid=4923)
1662it [00:09, 178.28it/s]
(TractActor pid=4921)
2096it [00:10, 215.71it/s]
(TractActor pid=4922)
1651it [00:10, 182.41it/s]
(TractActor pid=4923)
1680it [00:09, 177.52it/s]
(TractActor pid=4921)
2121it [00:10, 222.68it/s]
(TractActor pid=4922)
1670it [00:10, 177.30it/s]
(TractActor pid=4921)
2144it [00:10, 224.12it/s]
(TractActor pid=4922)
1688it [00:10, 172.15it/s]
(TractActor pid=4923)
1698it [00:10, 134.66it/s]
(TractActor pid=4921)
2167it [00:10, 206.75it/s]
(TractActor pid=4923)
1715it [00:10, 142.69it/s]
(TractActor pid=4921)
2188it [00:10, 203.87it/s]
(TractActor pid=4922)
1706it [00:10, 134.37it/s]
(TractActor pid=4923)
1732it [00:10, 148.54it/s]
(TractActor pid=4921)
2212it [00:10, 213.23it/s]
(TractActor pid=4922)
1724it [00:10, 142.05it/s]
(TractActor pid=4923)
1750it [00:10, 155.36it/s]
(TractActor pid=4921)
2234it [00:10, 196.05it/s]
(TractActor pid=4922)
1741it [00:10, 146.57it/s]
(TractActor pid=4923)
1770it [00:10, 165.74it/s]
(TractActor pid=4922)
1761it [00:11, 156.30it/s]
(TractActor pid=4923)
1789it [00:10, 168.73it/s]
(TractActor pid=4921)
2254it [00:10, 183.29it/s]
(TractActor pid=4922)
1781it [00:11, 167.62it/s]
(TractActor pid=4923)
1808it [00:10, 174.19it/s]
(TractActor pid=4921)
2277it [00:11, 194.07it/s]
(TractActor pid=4922)
1799it [00:11, 170.57it/s]
(TractActor pid=4923)
1826it [00:10, 171.19it/s]
(TractActor pid=4921)
2300it [00:11, 202.54it/s]
(TractActor pid=4922)
1817it [00:11, 169.43it/s]
(TractActor pid=4923)
1844it [00:11, 171.30it/s]
(TractActor pid=4921)
2324it [00:11, 212.91it/s]
(TractActor pid=4922)
1836it [00:11, 173.64it/s]
(TractActor pid=4923)
1862it [00:11, 173.72it/s]
(TractActor pid=4921)
2346it [00:11, 169.42it/s]
(TractActor pid=4922)
1854it [00:11, 170.37it/s]
(TractActor pid=4923)
1880it [00:11, 169.85it/s]
(TractActor pid=4921)
2369it [00:11, 183.46it/s]
(TractActor pid=4922)
1872it [00:11, 167.60it/s]
(TractActor pid=4923)
1898it [00:11, 167.45it/s]
(TractActor pid=4921)
2389it [00:11, 186.10it/s]
(TractActor pid=4922)
1889it [00:11, 167.09it/s]
(TractActor pid=4923)
1917it [00:11, 171.38it/s]
(TractActor pid=4921)
2413it [00:11, 199.27it/s]
(TractActor pid=4922)
1906it [00:11, 165.63it/s]
(TractActor pid=4921)
2437it [00:11, 209.01it/s]
(TractActor pid=4922)
1923it [00:12, 164.85it/s]
(TractActor pid=4923)
1935it [00:11, 167.20it/s]
(TractActor pid=4921)
2459it [00:11, 209.73it/s]
(TractActor pid=4922)
1942it [00:12, 171.28it/s]
(TractActor pid=4923)
1954it [00:11, 171.79it/s]
(TractActor pid=4921)
2481it [00:12, 206.91it/s]
(TractActor pid=4922)
1961it [00:12, 175.97it/s]
(TractActor pid=4923)
1972it [00:11, 172.62it/s]
(TractActor pid=4921)
2505it [00:12, 215.94it/s]
(TractActor pid=4922)
1979it [00:12, 173.21it/s]
(TractActor pid=4923)
1990it [00:11, 168.63it/s]
(TractActor pid=4921)
2531it [00:12, 225.00it/s]
(TractActor pid=4922)
1997it [00:12, 162.36it/s]
(TractActor pid=4923)
2007it [00:11, 167.54it/s]
(TractActor pid=4922)
2017it [00:12, 172.22it/s]
(TractActor pid=4923)
2025it [00:12, 169.11it/s]
(TractActor pid=4921)
2557it [00:12, 225.30it/s]
(TractActor pid=4922)
2035it [00:12, 171.24it/s]
(TractActor pid=4921)
2581it [00:12, 229.35it/s]
(TractActor pid=4923)
2042it [00:12, 168.45it/s]
(TractActor pid=4923)
2059it [00:12, 164.88it/s]
(TractActor pid=4921)
2605it [00:12, 213.11it/s]
(TractActor pid=4922)
2053it [00:12, 169.75it/s]
(TractActor pid=4923)
2079it [00:12, 170.61it/s]
(TractActor pid=4921)
2631it [00:12, 224.62it/s]
(TractActor pid=4922)
2071it [00:12, 168.87it/s]
(TractActor pid=4923)
2097it [00:12, 172.49it/s]
(TractActor pid=4921)
2654it [00:12, 205.94it/s]
(TractActor pid=4922)
2088it [00:12, 169.09it/s]
2107it [00:13, 175.10it/s]
(TractActor pid=4923)
2117it [00:12, 178.44it/s]
(TractActor pid=4921)
2677it [00:12, 209.15it/s]
(TractActor pid=4922)
2125it [00:13, 176.01it/s]
(TractActor pid=4923)
2135it [00:12, 173.97it/s]
(TractActor pid=4921)
2703it [00:13, 221.67it/s]
(TractActor pid=4922)
2143it [00:13, 174.83it/s]
(TractActor pid=4923)
2153it [00:12, 164.44it/s]
(TractActor pid=4921)
2726it [00:13, 214.84it/s]
(TractActor pid=4923)
2170it [00:12, 160.16it/s]
(TractActor pid=4921)
2749it [00:13, 215.49it/s]
(TractActor pid=4922)
2161it [00:13, 161.31it/s]
(TractActor pid=4923)
2187it [00:13, 153.64it/s]
(TractActor pid=4921)
2771it [00:13, 214.21it/s]
(TractActor pid=4922)
2179it [00:13, 166.12it/s]
(TractActor pid=4923)
2204it [00:13, 157.08it/s]
(TractActor pid=4921)
2794it [00:13, 218.25it/s]
(TractActor pid=4922)
2196it [00:13, 159.97it/s]
(TractActor pid=4923)
2223it [00:13, 163.50it/s]
(TractActor pid=4921)
2816it [00:13, 202.58it/s]
(TractActor pid=4922)
2215it [00:13, 166.99it/s]
(TractActor pid=4921)
2843it [00:13, 219.55it/s]
(TractActor pid=4922)
2232it [00:13, 149.95it/s]
(TractActor pid=4923)
2240it [00:13, 143.00it/s]
(TractActor pid=4921)
2866it [00:13, 222.15it/s]
(TractActor pid=4922)
2248it [00:13, 144.10it/s]
(TractActor pid=4923)
2256it [00:13, 145.30it/s]
(TractActor pid=4921)
2891it [00:13, 226.58it/s]
(TractActor pid=4922)
2268it [00:14, 157.20it/s]
(TractActor pid=4923)
2276it [00:13, 157.40it/s]
(TractActor pid=4921)
2916it [00:14, 230.40it/s]
(TractActor pid=4923)
2293it [00:13, 158.57it/s]
(TractActor pid=4921)
2941it [00:14, 234.45it/s]
(TractActor pid=4922)
2285it [00:14, 152.38it/s]
(TractActor pid=4923)
2313it [00:13, 169.43it/s]
(TractActor pid=4922)
2306it [00:14, 166.31it/s]
(TractActor pid=4923)
2331it [00:13, 164.22it/s]
(TractActor pid=4921)
2965it [00:14, 220.93it/s]
(TractActor pid=4922)
2326it [00:14, 173.16it/s]
(TractActor pid=4921)
2988it [00:14, 210.26it/s]
(TractActor pid=4923)
2348it [00:14, 130.28it/s]
(TractActor pid=4921)
3010it [00:14, 209.41it/s]
(TractActor pid=4922)
2344it [00:14, 128.65it/s]
(TractActor pid=4923)
2364it [00:14, 135.66it/s]
(TractActor pid=4921)
3032it [00:14, 212.31it/s]
(TractActor pid=4922)
2361it [00:14, 137.78it/s]
(TractActor pid=4923)
2380it [00:14, 141.69it/s]
(TractActor pid=4921)
3056it [00:14, 216.45it/s]
(TractActor pid=4922)
2377it [00:14, 142.61it/s]
(TractActor pid=4923)
2398it [00:14, 151.78it/s]
(TractActor pid=4921)
3080it [00:14, 222.55it/s]
(TractActor pid=4922)
2395it [00:14, 150.87it/s]
(TractActor pid=4923)
2416it [00:14, 157.21it/s]
(TractActor pid=4921)
3104it [00:14, 224.24it/s]
(TractActor pid=4922)
2412it [00:15, 155.52it/s]
(TractActor pid=4923)
2436it [00:14, 166.10it/s]
(TractActor pid=4921)
3129it [00:14, 229.49it/s]
(TractActor pid=4922)
2433it [00:15, 170.02it/s]
(TractActor pid=4923)
2453it [00:14, 158.94it/s]
(TractActor pid=4921)
3155it [00:15, 237.66it/s]
(TractActor pid=4922)
2451it [00:15, 163.36it/s]
(TractActor pid=4923)
2474it [00:14, 171.40it/s]
(TractActor pid=4921)
3181it [00:15, 242.97it/s]
(TractActor pid=4922)
2470it [00:15, 167.47it/s]
(TractActor pid=4922)
2488it [00:15, 168.80it/s]
(TractActor pid=4923)
2492it [00:15, 131.57it/s]
(TractActor pid=4921)
3206it [00:15, 170.99it/s]
(TractActor pid=4922)
2510it [00:15, 183.00it/s]
(TractActor pid=4923)
2512it [00:15, 146.37it/s]
(TractActor pid=4921)
3229it [00:15, 183.03it/s]
(TractActor pid=4922)
2535it [00:15, 200.92it/s]
(TractActor pid=4923)
2532it [00:15, 158.04it/s]
(TractActor pid=4921)
3251it [00:15, 190.78it/s]
(TractActor pid=4922)
2556it [00:15, 203.04it/s]
(TractActor pid=4923)
2553it [00:15, 170.04it/s]
(TractActor pid=4921)
3272it [00:15, 194.06it/s]
(TractActor pid=4922)
2577it [00:15, 187.91it/s]
(TractActor pid=4923)
2572it [00:15, 162.76it/s]
(TractActor pid=4921)
3293it [00:15, 198.26it/s]
(TractActor pid=4922)
2597it [00:16, 170.72it/s]
(TractActor pid=4923)
2592it [00:15, 170.72it/s]
(TractActor pid=4921)
3317it [00:15, 208.04it/s]
(TractActor pid=4922)
2615it [00:16, 170.15it/s]
(TractActor pid=4923)
2610it [00:15, 158.70it/s]
(TractActor pid=4921)
3339it [00:16, 201.95it/s]
(TractActor pid=4922)
2634it [00:16, 172.36it/s]
(TractActor pid=4921)
3363it [00:16, 211.71it/s]
(TractActor pid=4923)
2630it [00:15, 166.59it/s]
(TractActor pid=4921)
3385it [00:16, 207.78it/s]
(TractActor pid=4922)
2652it [00:16, 158.70it/s]
(TractActor pid=4923)
2648it [00:16, 156.92it/s]
(TractActor pid=4921)
3407it [00:16, 201.03it/s]
(TractActor pid=4922)
2669it [00:16, 158.03it/s]
(TractActor pid=4923)
2665it [00:16, 151.28it/s]
(TractActor pid=4921)
3428it [00:16, 203.26it/s]
(TractActor pid=4922)
2688it [00:16, 166.53it/s]
(TractActor pid=4923)
2685it [00:16, 163.28it/s]
(TractActor pid=4921)
3455it [00:16, 220.55it/s]
(TractActor pid=4922)
2708it [00:16, 174.98it/s]
(TractActor pid=4923)
2706it [00:16, 173.31it/s]
(TractActor pid=4921)
3478it [00:16, 222.42it/s]
(TractActor pid=4922)
2726it [00:16, 175.82it/s]
(TractActor pid=4923)
2726it [00:16, 172.63it/s]
(TractActor pid=4921)
3501it [00:16, 214.00it/s]
(TractActor pid=4922)
2745it [00:16, 178.26it/s]
(TractActor pid=4923)
2745it [00:16, 175.76it/s]
(TractActor pid=4921)
3525it [00:16, 217.95it/s]
(TractActor pid=4922)
2763it [00:17, 176.29it/s]
(TractActor pid=4923)
2763it [00:16, 174.88it/s]
(TractActor pid=4921)
3547it [00:17, 218.45it/s]
(TractActor pid=4922)
2781it [00:17, 169.89it/s]
(TractActor pid=4923)
2781it [00:16, 168.94it/s]
(TractActor pid=4921)
3569it [00:17, 214.86it/s]
(TractActor pid=4922)
2799it [00:17, 167.28it/s]
(TractActor pid=4923)
2799it [00:16, 166.62it/s]
(TractActor pid=4921)
3591it [00:17, 216.20it/s]
(TractActor pid=4922)
2816it [00:17, 159.60it/s]
(TractActor pid=4923)
2816it [00:17, 158.73it/s]
(TractActor pid=4921)
3614it [00:17, 218.51it/s]
(TractActor pid=4922)
2837it [00:17, 169.54it/s]
(TractActor pid=4923)
2837it [00:17, 168.52it/s]
(TractActor pid=4921)
3639it [00:17, 226.48it/s]
(TractActor pid=4922)
2858it [00:17, 175.11it/s]
(TractActor pid=4921)
3662it [00:17, 225.76it/s]
(TractActor pid=4922)
2876it [00:17, 170.35it/s]
(TractActor pid=4923)
2858it [00:17, 173.55it/s]
(TractActor pid=4921)
3685it [00:17, 215.53it/s]
(TractActor pid=4922)
2896it [00:17, 176.95it/s]
(TractActor pid=4923)
2876it [00:17, 170.20it/s]
(TractActor pid=4922)
2916it [00:17, 182.68it/s]
(TractActor pid=4923)
2896it [00:17, 176.79it/s]
(TractActor pid=4921)
3707it [00:17, 204.19it/s]
(TractActor pid=4922)
2935it [00:18, 183.92it/s]
(TractActor pid=4923)
2916it [00:17, 182.45it/s]
(TractActor pid=4921)
3731it [00:17, 213.06it/s]
(TractActor pid=4922)
2954it [00:18, 183.80it/s]
(TractActor pid=4923)
2935it [00:17, 183.59it/s]
(TractActor pid=4921)
3753it [00:17, 212.20it/s]
(TractActor pid=4922)
2973it [00:18, 177.89it/s]
(TractActor pid=4923)
2954it [00:17, 183.09it/s]
(TractActor pid=4921)
3777it [00:18, 217.60it/s]
(TractActor pid=4922)
2991it [00:18, 168.02it/s]
(TractActor pid=4923)
2973it [00:17, 177.34it/s]
(TractActor pid=4921)
3799it [00:18, 215.81it/s]
(TractActor pid=4923)
2991it [00:18, 167.27it/s]
(TractActor pid=4921)
3821it [00:18, 215.17it/s]
(TractActor pid=4922)
3008it [00:18, 162.10it/s]
(TractActor pid=4923)
3008it [00:18, 162.16it/s]
(TractActor pid=4921)
3844it [00:18, 217.85it/s]
(TractActor pid=4922)
3025it [00:18, 162.27it/s]
(TractActor pid=4923)
3025it [00:18, 162.40it/s]
(TractActor pid=4921)
3866it [00:18, 215.93it/s]
(TractActor pid=4922)
3044it [00:18, 168.65it/s]
(TractActor pid=4923)
3044it [00:18, 168.14it/s]
(TractActor pid=4921)
3888it [00:18, 202.82it/s]
(TractActor pid=4922)
3062it [00:18, 171.08it/s]
(TractActor pid=4923)
3062it [00:18, 170.27it/s]
(TractActor pid=4921)
3914it [00:18, 217.05it/s]
(TractActor pid=4922)
3081it [00:18, 174.87it/s]
(TractActor pid=4923)
3081it [00:18, 173.73it/s]
(TractActor pid=4921)
3936it [00:18, 217.60it/s]
(TractActor pid=4922)
3100it [00:18, 177.21it/s]
(TractActor pid=4923)
3100it [00:18, 176.04it/s]
(TractActor pid=4921)
3958it [00:18, 217.25it/s]
(TractActor pid=4922)
3121it [00:19, 184.97it/s]
(TractActor pid=4923)
3121it [00:18, 184.50it/s]
(TractActor pid=4921)
3983it [00:19, 223.68it/s]
(TractActor pid=4922)
3140it [00:19, 181.41it/s]
(TractActor pid=4923)
3140it [00:18, 180.58it/s]
(TractActor pid=4921)
4006it [00:19, 222.42it/s]
(TractActor pid=4922)
3160it [00:19, 184.07it/s]
(TractActor pid=4923)
3160it [00:18, 183.65it/s]
(TractActor pid=4921)
4029it [00:19, 218.97it/s]
(TractActor pid=4922)
3181it [00:19, 189.25it/s]
(TractActor pid=4923)
3181it [00:19, 190.85it/s]
(TractActor pid=4921)
4051it [00:19, 212.19it/s]
(TractActor pid=4921)
4074it [00:19, 211.68it/s]
(TractActor pid=4922)
3200it [00:19, 135.99it/s]
(TractActor pid=4923)
3201it [00:19, 137.03it/s]
(TractActor pid=4921)
4097it [00:19, 210.26it/s]
(TractActor pid=4922)
3221it [00:19, 149.42it/s]
(TractActor pid=4923)
3221it [00:19, 148.46it/s]
(TractActor pid=4921)
4119it [00:19, 197.31it/s]
(TractActor pid=4922)
3239it [00:19, 154.59it/s]
(TractActor pid=4923)
3239it [00:19, 153.80it/s]
(TractActor pid=4921)
4142it [00:19, 206.19it/s]
(TractActor pid=4922)
3257it [00:19, 160.85it/s]
(TractActor pid=4923)
3257it [00:19, 160.24it/s]
(TractActor pid=4921)
4163it [00:19, 198.95it/s]
(TractActor pid=4922)
3275it [00:20, 159.95it/s]
(TractActor pid=4923)
3275it [00:19, 159.55it/s]
(TractActor pid=4921)
4184it [00:20, 199.70it/s]
(TractActor pid=4922)
3292it [00:20, 160.09it/s]
(TractActor pid=4923)
3292it [00:19, 159.77it/s]
(TractActor pid=4921)
4209it [00:20, 211.77it/s]
(TractActor pid=4922)
3311it [00:20, 164.87it/s]
(TractActor pid=4921)
4231it [00:20, 210.88it/s]
(TractActor pid=4922)
3328it [00:20, 164.26it/s]
(TractActor pid=4923)
3311it [00:19, 164.50it/s]
(TractActor pid=4922)
3345it [00:20, 165.05it/s]
(TractActor pid=4923)
3328it [00:20, 162.67it/s]
(TractActor pid=4922)
3362it [00:20, 165.49it/s]
(TractActor pid=4923)
3345it [00:20, 163.38it/s]
(TractActor pid=4921)
4253it [00:20, 150.73it/s]
(TractActor pid=4922)
3379it [00:20, 163.92it/s]
(TractActor pid=4923)
3362it [00:20, 164.85it/s]
(TractActor pid=4921)
4275it [00:20, 164.73it/s]
(TractActor pid=4922)
3396it [00:20, 160.80it/s]
(TractActor pid=4923)
3379it [00:20, 163.50it/s]
(TractActor pid=4921)
4299it [00:20, 179.53it/s]
(TractActor pid=4922)
3414it [00:20, 165.46it/s]
(TractActor pid=4923)
3396it [00:20, 159.96it/s]
(TractActor pid=4921)
4319it [00:20, 178.12it/s]
(TractActor pid=4922)
3431it [00:21, 165.26it/s]
(TractActor pid=4923)
3414it [00:20, 164.36it/s]
(TractActor pid=4921)
4345it [00:20, 198.18it/s]
(TractActor pid=4922)
3452it [00:21, 176.17it/s]
(TractActor pid=4923)
3431it [00:20, 165.00it/s]
(TractActor pid=4921)
4370it [00:21, 210.20it/s]
(TractActor pid=4922)
3470it [00:21, 175.48it/s]
(TractActor pid=4923)
3452it [00:20, 175.67it/s]
(TractActor pid=4921)
4392it [00:21, 207.74it/s]
(TractActor pid=4922)
3489it [00:21, 175.20it/s]
(TractActor pid=4923)
3470it [00:20, 175.14it/s]
(TractActor pid=4921)
4415it [00:21, 213.86it/s]
(TractActor pid=4922)
3507it [00:21, 164.15it/s]
(TractActor pid=4923)
3489it [00:21, 174.92it/s]
(TractActor pid=4921)
4437it [00:21, 212.82it/s]
(TractActor pid=4922)
3526it [00:21, 170.31it/s]
(TractActor pid=4923)
3507it [00:21, 163.88it/s]
(TractActor pid=4921)
4462it [00:21, 222.28it/s]
(TractActor pid=4922)
3544it [00:21, 170.11it/s]
(TractActor pid=4923)
3526it [00:21, 169.84it/s]
(TractActor pid=4921)
4490it [00:21, 236.65it/s]
(TractActor pid=4923)
3544it [00:21, 169.62it/s]
(TractActor pid=4921)
4517it [00:21, 245.97it/s]
(TractActor pid=4922)
3562it [00:21, 161.82it/s]
(TractActor pid=4923)
3562it [00:21, 161.16it/s]
(TractActor pid=4921)
4542it [00:21, 244.30it/s]
(TractActor pid=4922)
3580it [00:21, 164.48it/s]
(TractActor pid=4923)
3579it [00:21, 163.41it/s]
(TractActor pid=4921)
4567it [00:21, 240.95it/s]
(TractActor pid=4922)
3597it [00:22, 160.07it/s]
(TractActor pid=4923)
3596it [00:21, 161.28it/s]
(TractActor pid=4921)
4592it [00:21, 217.34it/s]
(TractActor pid=4922)
3619it [00:22, 176.32it/s]
(TractActor pid=4923)
3617it [00:21, 173.74it/s]
(TractActor pid=4921)
4616it [00:22, 222.45it/s]
(TractActor pid=4922)
3639it [00:22, 180.84it/s]
(TractActor pid=4923)
3638it [00:21, 180.38it/s]
(TractActor pid=4921)
4639it [00:22, 210.05it/s]
(TractActor pid=4922)
3660it [00:22, 186.99it/s]
(TractActor pid=4923)
3658it [00:22, 185.66it/s]
(TractActor pid=4921)
4663it [00:22, 217.10it/s]
(TractActor pid=4922)
3679it [00:22, 171.98it/s]
(TractActor pid=4923)
3677it [00:22, 172.80it/s]
(TractActor pid=4921)
4689it [00:22, 224.74it/s]
(TractActor pid=4922)
3697it [00:22, 168.07it/s]
(TractActor pid=4923)
3695it [00:22, 170.75it/s]
(TractActor pid=4921)
4712it [00:22, 218.80it/s]
(TractActor pid=4922)
3715it [00:22, 166.37it/s]
(TractActor pid=4921)
4736it [00:22, 224.47it/s]
(TractActor pid=4922)
3733it [00:22, 168.97it/s]
(TractActor pid=4923)
3713it [00:22, 164.41it/s]
(TractActor pid=4922)
3751it [00:22, 162.30it/s]
(TractActor pid=4923)
3730it [00:22, 165.87it/s]
(TractActor pid=4921)
4759it [00:22, 205.60it/s]
(TractActor pid=4922)
3770it [00:23, 168.00it/s]
(TractActor pid=4923)
3747it [00:22, 164.64it/s]
(TractActor pid=4921)
4785it [00:22, 216.86it/s]
(TractActor pid=4922)
3788it [00:23, 170.56it/s]
(TractActor pid=4923)
3764it [00:22, 162.97it/s]
(TractActor pid=4921)
4808it [00:22, 214.06it/s]
(TractActor pid=4922)
3806it [00:23, 161.02it/s]
(TractActor pid=4923)
3784it [00:22, 168.13it/s]
(TractActor pid=4921)
4830it [00:23, 206.87it/s]
(TractActor pid=4923)
3801it [00:22, 168.02it/s]
(TractActor pid=4921)
4854it [00:23, 213.74it/s]
(TractActor pid=4922)
3825it [00:23, 164.59it/s]
(TractActor pid=4923)
3818it [00:22, 165.68it/s]
(TractActor pid=4921)
4877it [00:23, 216.36it/s]
(TractActor pid=4922)
3844it [00:23, 169.03it/s]
(TractActor pid=4923)
3838it [00:23, 175.06it/s]
(TractActor pid=4921)
4899it [00:23, 206.77it/s]
(TractActor pid=4922)
3862it [00:23, 158.69it/s]
(TractActor pid=4923)
3857it [00:23, 179.17it/s]
(TractActor pid=4921)
4920it [00:23, 193.02it/s]
(TractActor pid=4922)
3879it [00:23, 159.41it/s]
(TractActor pid=4923)
3879it [00:23, 188.65it/s]
(TractActor pid=4921)
4940it [00:23, 194.52it/s]
(TractActor pid=4922)
3896it [00:23, 160.67it/s]
(TractActor pid=4923)
3898it [00:23, 186.59it/s]
(TractActor pid=4921)
4960it [00:23, 193.34it/s]
(TractActor pid=4922)
3916it [00:23, 169.70it/s]
(TractActor pid=4923)
3924it [00:23, 207.23it/s]
(TractActor pid=4922)
3934it [00:24, 167.98it/s]
(TractActor pid=4923)
3946it [00:23, 210.24it/s]
(TractActor pid=4921)
4980it [00:23, 175.90it/s]
(TractActor pid=4922)
3952it [00:24, 168.34it/s]
(TractActor pid=4923)
3969it [00:23, 214.44it/s]
(TractActor pid=4921)
4999it [00:23, 179.17it/s]
(TractActor pid=4922)
3969it [00:24, 168.01it/s]
(TractActor pid=4923)
3991it [00:23, 203.00it/s]
(TractActor pid=4921)
5019it [00:24, 183.71it/s]
(TractActor pid=4922)
3986it [00:24, 165.81it/s]
(TractActor pid=4923)
4014it [00:23, 210.27it/s]
(TractActor pid=4921)
5038it [00:24, 165.80it/s]
(TractActor pid=4922)
4003it [00:24, 164.01it/s]
(TractActor pid=4923)
4036it [00:24, 204.42it/s]
(TractActor pid=4921)
5056it [00:24, 165.02it/s]
(TractActor pid=4922)
4021it [00:24, 167.04it/s]
(TractActor pid=4923)
4059it [00:24, 209.65it/s]
(TractActor pid=4921)
5075it [00:24, 170.32it/s]
(TractActor pid=4922)
4038it [00:24, 155.59it/s]
(TractActor pid=4923)
4081it [00:24, 208.50it/s]
(TractActor pid=4921)
5093it [00:24, 161.16it/s]
(TractActor pid=4922)
4058it [00:24, 164.42it/s]
(TractActor pid=4923)
4102it [00:24, 208.60it/s]
(TractActor pid=4921)
5111it [00:24, 163.90it/s]
(TractActor pid=4922)
4075it [00:24, 159.73it/s]
(TractActor pid=4923)
4123it [00:24, 204.81it/s]
(TractActor pid=4921)
5129it [00:24, 167.88it/s]
(TractActor pid=4922)
4092it [00:24, 161.46it/s]
(TractActor pid=4923)
4145it [00:24, 207.69it/s]
(TractActor pid=4921)
5150it [00:24, 176.55it/s]
(TractActor pid=4922)
4109it [00:25, 163.12it/s]
(TractActor pid=4923)
4166it [00:24, 202.70it/s]
(TractActor pid=4921)
5168it [00:24, 176.76it/s]
(TractActor pid=4922)
4126it [00:25, 157.19it/s]
(TractActor pid=4923)
4187it [00:24, 203.56it/s]
(TractActor pid=4921)
5186it [00:25, 172.67it/s]
(TractActor pid=4923)
4208it [00:24, 200.26it/s]
(TractActor pid=4921)
5209it [00:25, 187.09it/s]
(TractActor pid=4922)
4143it [00:25, 155.83it/s]
(TractActor pid=4923)
4229it [00:25, 184.28it/s]
(TractActor pid=4921)
5235it [00:25, 205.46it/s]
(TractActor pid=4922)
4159it [00:25, 152.10it/s]
(TractActor pid=4921)
5257it [00:25, 208.10it/s]
(TractActor pid=4922)
4175it [00:25, 150.32it/s]
(TractActor pid=4921)
5283it [00:25, 220.36it/s]
(TractActor pid=4922)
4192it [00:25, 154.71it/s]
(TractActor pid=4923)
4248it [00:25, 129.87it/s]
(TractActor pid=4921)
5306it [00:25, 222.73it/s]
(TractActor pid=4922)
4211it [00:25, 164.54it/s]
(TractActor pid=4923)
4264it [00:25, 132.71it/s]
(TractActor pid=4921)
5329it [00:25, 223.90it/s]
(TractActor pid=4922)
4228it [00:25, 160.81it/s]
(TractActor pid=4923)
4281it [00:25, 140.90it/s]
(TractActor pid=4921)
5356it [00:25, 234.36it/s]
(TractActor pid=4923)
4300it [00:25, 152.06it/s]
(TractActor pid=4921)
5380it [00:25, 230.99it/s]
(TractActor pid=4922)
4245it [00:26, 114.62it/s]
(TractActor pid=4923)
4318it [00:25, 156.59it/s]
(TractActor pid=4921)
5404it [00:26, 226.10it/s]
(TractActor pid=4922)
4260it [00:26, 121.79it/s]
(TractActor pid=4923)
4339it [00:25, 170.77it/s]
(TractActor pid=4922)
4276it [00:26, 130.64it/s]
(TractActor pid=4923)
4359it [00:25, 178.12it/s]
(TractActor pid=4921)
5427it [00:26, 214.28it/s]
(TractActor pid=4922)
4294it [00:26, 141.88it/s]
(TractActor pid=4923)
4378it [00:26, 168.22it/s]
(TractActor pid=4921)
5450it [00:26, 215.67it/s]
(TractActor pid=4922)
4311it [00:26, 146.51it/s]
(TractActor pid=4923)
4399it [00:26, 176.64it/s]
(TractActor pid=4921)
5477it [00:26, 230.30it/s]
(TractActor pid=4922)
4331it [00:26, 159.55it/s]
(TractActor pid=4923)
4418it [00:26, 172.42it/s]
(TractActor pid=4921)
5505it [00:26, 241.21it/s]
(TractActor pid=4922)
4351it [00:26, 169.77it/s]
(TractActor pid=4923)
4436it [00:26, 167.09it/s]
(TractActor pid=4921)
5530it [00:26, 239.68it/s]
(TractActor pid=4922)
4369it [00:26, 172.17it/s]
(TractActor pid=4923)
4456it [00:26, 175.40it/s]
(TractActor pid=4921)
5555it [00:26, 221.31it/s]
(TractActor pid=4922)
4387it [00:26, 164.22it/s]
(TractActor pid=4923)
4477it [00:26, 183.22it/s]
(TractActor pid=4921)
5582it [00:26, 233.57it/s]
(TractActor pid=4922)
4408it [00:27, 176.06it/s]
(TractActor pid=4923)
4499it [00:26, 193.02it/s]
(TractActor pid=4921)
5609it [00:26, 242.83it/s]
(TractActor pid=4923)
4519it [00:26, 194.13it/s]
(TractActor pid=4922)
4426it [00:27, 162.99it/s]
(TractActor pid=4923)
4539it [00:26, 187.54it/s]
(TractActor pid=4921)
5634it [00:27, 167.21it/s]
(TractActor pid=4922)
4446it [00:27, 173.04it/s]
(TractActor pid=4923)
4559it [00:26, 190.00it/s]
(TractActor pid=4922)
4464it [00:27, 172.04it/s]
(TractActor pid=4921)
5655it [00:27, 172.83it/s]
(TractActor pid=4922)
4486it [00:27, 184.92it/s]
(TractActor pid=4923)
4579it [00:27, 187.60it/s]
(TractActor pid=4921)
5676it [00:27, 180.44it/s]
(TractActor pid=4922)
4507it [00:27, 191.44it/s]
(TractActor pid=4923)
4598it [00:27, 173.17it/s]
(TractActor pid=4921)
5697it [00:27, 187.75it/s]
(TractActor pid=4922)
4527it [00:27, 188.50it/s]
(TractActor pid=4923)
4617it [00:27, 177.44it/s]
(TractActor pid=4921)
5725it [00:27, 211.37it/s]
(TractActor pid=4922)
4548it [00:27, 192.64it/s]
(TractActor pid=4923)
4635it [00:27, 162.31it/s]
(TractActor pid=4921)
5749it [00:27, 215.64it/s]
(TractActor pid=4922)
4569it [00:27, 194.21it/s]
(TractActor pid=4923)
4653it [00:27, 166.43it/s]
(TractActor pid=4921)
5772it [00:27, 218.69it/s]
(TractActor pid=4922)
4589it [00:28, 175.49it/s]
(TractActor pid=4923)
4677it [00:27, 186.26it/s]
(TractActor pid=4921)
5795it [00:27, 204.39it/s]
(TractActor pid=4922)
4607it [00:28, 169.81it/s]
(TractActor pid=4923)
4697it [00:27, 188.81it/s]
(TractActor pid=4921)
5817it [00:28, 189.98it/s]
(TractActor pid=4922)
4625it [00:28, 166.80it/s]
(TractActor pid=4923)
4717it [00:27, 186.26it/s]
(TractActor pid=4921)
5838it [00:28, 194.83it/s]
(TractActor pid=4922)
4642it [00:28, 164.98it/s]
(TractActor pid=4923)
4736it [00:27, 185.40it/s]
(TractActor pid=4921)
5860it [00:28, 199.74it/s]
(TractActor pid=4922)
4661it [00:28, 169.89it/s]
(TractActor pid=4923)
4755it [00:28, 173.39it/s]
(TractActor pid=4921)
5883it [00:28, 206.90it/s]
(TractActor pid=4922)
4679it [00:28, 170.09it/s]
(TractActor pid=4921)
5905it [00:28, 192.86it/s]
(TractActor pid=4922)
4697it [00:28, 165.66it/s]
(TractActor pid=4923)
4773it [00:28, 166.38it/s]
(TractActor pid=4921)
5926it [00:28, 196.07it/s]
(TractActor pid=4922)
4714it [00:28, 166.21it/s]
(TractActor pid=4923)
4800it [00:28, 193.72it/s]
(TractActor pid=4921)
5947it [00:28, 196.28it/s]
(TractActor pid=4922)
4733it [00:28, 172.20it/s]
(TractActor pid=4923)
4820it [00:28, 180.41it/s]
(TractActor pid=4921)
5967it [00:28, 191.91it/s]
(TractActor pid=4923)
4839it [00:28, 171.74it/s]
(TractActor pid=4922)
4751it [00:29, 161.78it/s]
(TractActor pid=4923)
4861it [00:28, 182.94it/s]
(TractActor pid=4921)
5987it [00:28, 186.16it/s]
(TractActor pid=4922)
4768it [00:29, 158.09it/s]
(TractActor pid=4923)
4880it [00:28, 173.30it/s]
(TractActor pid=4921)
6009it [00:29, 193.00it/s]
6026it [00:29, 206.90it/s]
(TractActor pid=4922)
4789it [00:29, 171.15it/s]
(TractActor pid=4923)
4898it [00:28, 174.78it/s]
(TractActor pid=4922)
4808it [00:29, 174.98it/s]
(TractActor pid=4923)
4916it [00:29, 173.37it/s]
(TractActor pid=4922)
4826it [00:29, 164.33it/s]
(TractActor pid=4923)
4934it [00:29, 171.24it/s]
(TractActor pid=4922)
4844it [00:29, 166.46it/s]
(TractActor pid=4923)
4953it [00:29, 174.78it/s]
(TractActor pid=4922)
4864it [00:29, 175.64it/s]
(TractActor pid=4923)
4971it [00:29, 167.72it/s]
(TractActor pid=4922)
4882it [00:29, 168.74it/s]
(TractActor pid=4923)
4994it [00:29, 183.89it/s]
(TractActor pid=4922)
4902it [00:29, 175.68it/s]
(TractActor pid=4923)
5019it [00:29, 202.46it/s]
(TractActor pid=4922)
4925it [00:30, 189.71it/s]
(TractActor pid=4923)
5040it [00:29, 196.74it/s]
(TractActor pid=4922)
4948it [00:30, 200.91it/s]
(TractActor pid=4923)
5062it [00:29, 202.52it/s]
(TractActor pid=4922)
4970it [00:30, 200.62it/s]
(TractActor pid=4923)
5085it [00:29, 208.28it/s]
(TractActor pid=4922)
4995it [00:30, 212.12it/s]
(TractActor pid=4922)
5020it [00:30, 217.49it/s]
(TractActor pid=4923)
5108it [00:29, 211.24it/s]
(TractActor pid=4922)
5042it [00:30, 207.55it/s]
(TractActor pid=4923)
5134it [00:30, 225.01it/s]
(TractActor pid=4922)
5066it [00:30, 214.82it/s]
(TractActor pid=4923)
5160it [00:30, 232.62it/s]
(TractActor pid=4922)
5088it [00:30, 213.46it/s]
(TractActor pid=4923)
5184it [00:30, 233.18it/s]
(TractActor pid=4923)
5209it [00:30, 236.87it/s]
(TractActor pid=4922)
5110it [00:30, 210.25it/s]
(TractActor pid=4923)
5234it [00:30, 240.55it/s]
(TractActor pid=4922)
5136it [00:30, 223.97it/s]
(TractActor pid=4923)
5259it [00:30, 232.35it/s]
(TractActor pid=4922)
5161it [00:31, 228.73it/s]
(TractActor pid=4923)
5285it [00:30, 239.86it/s]
(TractActor pid=4922)
5185it [00:31, 230.05it/s]
(TractActor pid=4923)
5310it [00:30, 238.47it/s]
(TractActor pid=4922)
5213it [00:31, 241.54it/s]
(TractActor pid=4923)
5334it [00:30, 234.81it/s]
(TractActor pid=4922)
5238it [00:31, 239.90it/s]
(TractActor pid=4923)
5362it [00:31, 245.44it/s]
(TractActor pid=4922)
5263it [00:31, 235.54it/s]
(TractActor pid=4923)
5387it [00:31, 241.29it/s]
(TractActor pid=4922)
5289it [00:31, 239.57it/s]
(TractActor pid=4923)
5412it [00:31, 223.32it/s]
(TractActor pid=4922)
5313it [00:31, 236.74it/s]
(TractActor pid=4923)
5436it [00:31, 226.25it/s]
(TractActor pid=4922)
5338it [00:31, 238.26it/s]
(TractActor pid=4923)
5462it [00:31, 234.39it/s]
(TractActor pid=4922)
5362it [00:31, 235.77it/s]
(TractActor pid=4923)
5488it [00:31, 240.14it/s]
(TractActor pid=4922)
5386it [00:32, 233.33it/s]
(TractActor pid=4923)
5513it [00:31, 241.96it/s]
(TractActor pid=4922)
5410it [00:32, 218.64it/s]
(TractActor pid=4923)
5538it [00:31, 233.21it/s]
(TractActor pid=4922)
5433it [00:32, 219.28it/s]
(TractActor pid=4923)
5562it [00:31, 230.69it/s]
(TractActor pid=4922)
5461it [00:32, 234.82it/s]
(TractActor pid=4923)
5590it [00:31, 243.36it/s]
(TractActor pid=4922)
5487it [00:32, 241.66it/s]
(TractActor pid=4922)
5513it [00:32, 243.62it/s]
(TractActor pid=4923)
5615it [00:32, 184.56it/s]
(TractActor pid=4922)
5538it [00:32, 235.78it/s]
(TractActor pid=4922)
5562it [00:32, 232.93it/s]
(TractActor pid=4923)
5636it [00:32, 180.96it/s]
(TractActor pid=4922)
5590it [00:32, 245.78it/s]
(TractActor pid=4923)
5658it [00:32, 190.31it/s]
(TractActor pid=4923)
5679it [00:32, 187.40it/s]
(TractActor pid=4922)
5615it [00:33, 180.49it/s]
(TractActor pid=4923)
5704it [00:32, 203.03it/s]
(TractActor pid=4923)
5730it [00:32, 216.55it/s]
(TractActor pid=4922)
5636it [00:33, 177.73it/s]
(TractActor pid=4923)
5756it [00:32, 226.51it/s]
(TractActor pid=4922)
5658it [00:33, 187.67it/s]
(TractActor pid=4923)
5780it [00:32, 223.11it/s]
(TractActor pid=4922)
5681it [00:33, 197.61it/s]
(TractActor pid=4923)
5803it [00:33, 206.40it/s]
(TractActor pid=4922)
5705it [00:33, 206.61it/s]
(TractActor pid=4923)
5825it [00:33, 207.73it/s]
(TractActor pid=4922)
5731it [00:33, 220.68it/s]
(TractActor pid=4923)
5847it [00:33, 203.13it/s]
(TractActor pid=4922)
5757it [00:33, 230.77it/s]
(TractActor pid=4923)
5872it [00:33, 215.64it/s]
(TractActor pid=4922)
5781it [00:33, 225.01it/s]
(TractActor pid=4923)
5895it [00:33, 218.72it/s]
(TractActor pid=4922)
5804it [00:33, 209.58it/s]
(TractActor pid=4923)
5922it [00:33, 233.15it/s]
(TractActor pid=4922)
5826it [00:34, 198.73it/s]
(TractActor pid=4923)
5946it [00:33, 228.26it/s]
(TractActor pid=4922)
5847it [00:34, 197.98it/s]
(TractActor pid=4923)
5969it [00:33, 212.45it/s]
(TractActor pid=4922)
5872it [00:34, 211.92it/s]
(TractActor pid=4922)
5895it [00:34, 216.73it/s]
(TractActor pid=4923)
5991it [00:33, 204.79it/s]
(TractActor pid=4922)
5923it [00:34, 232.63it/s]
(TractActor pid=4923)
6012it [00:34, 199.57it/s]
6026it [00:34, 176.48it/s]
(TractActor pid=4922)
5947it [00:34, 227.19it/s]
(TractActor pid=4922)
5970it [00:34, 210.36it/s]
(TractActor pid=4922)
5992it [00:34, 207.25it/s]
(TractActor pid=4922)
6013it [00:34, 199.33it/s]
6027it [00:35, 172.04it/s]

{'01': '/home/runner/AFQ_data/stanford_hardi/derivatives/afq/sub-01/ses-01/sub-01_ses-01_coordsys-RASMM_trkmethod-probCSD_recogmethod-AFQ_desc-profiles_dwi.csv'}

Visualizing the bundles and calculating act profiles:#

The pyAFQ API provides several ways to visualize bundles and profiles.

First, we will run a function that exports an html file that contains an interactive visualization of the bundles that are segmented.

Note

By default we resample a 100 points within a bundle, however to reduce processing time we will only resample 50 points.

Once it is done running, it should pop a browser window open and let you interact with the bundles.

Note

You can hide or show a bundle by clicking the legend, or select a single bundle by double clicking the legend. The interactive visualization will also all you to pan, zoom, and rotate.

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

We can also visualize the tract profiles in all of the bundles. These plots show both FA (left) and MD (right) layed out anatomically. To make this plot, it is required that you install with pip install pyAFQ[plot] so that you have the necessary dependencies.

fig_files = myafq.export("tract_profile_plots")["01"]
  0%|          | 0/28 [00:00<?, ?it/s]
  4%|▎         | 1/28 [00:00<00:07,  3.50it/s]
  7%|▋         | 2/28 [00:00<00:07,  3.65it/s]
 11%|█         | 3/28 [00:00<00:06,  3.87it/s]
 14%|█▍        | 4/28 [00:01<00:05,  4.00it/s]
 18%|█▊        | 5/28 [00:01<00:05,  4.06it/s]
 21%|██▏       | 6/28 [00:01<00:05,  3.94it/s]
 25%|██▌       | 7/28 [00:01<00:05,  3.88it/s]
 29%|██▊       | 8/28 [00:02<00:05,  3.85it/s]
 46%|████▋     | 13/28 [00:02<00:01, 10.46it/s]
 54%|█████▎    | 15/28 [00:02<00:01,  9.39it/s]
 64%|██████▍   | 18/28 [00:02<00:01,  9.63it/s]
 82%|████████▏ | 23/28 [00:02<00:00, 15.49it/s]
 93%|█████████▎| 26/28 [00:03<00:00, 13.74it/s]
100%|██████████| 28/28 [00:03<00:00, 11.67it/s]
100%|██████████| 28/28 [00:03<00:00,  8.24it/s]

  0%|          | 0/28 [00:00<?, ?it/s]
  4%|▎         | 1/28 [00:00<00:07,  3.67it/s]
  7%|▋         | 2/28 [00:00<00:06,  3.75it/s]
 11%|█         | 3/28 [00:00<00:05,  4.31it/s]
 14%|█▍        | 4/28 [00:00<00:05,  4.10it/s]
 18%|█▊        | 5/28 [00:01<00:05,  4.43it/s]
 21%|██▏       | 6/28 [00:01<00:04,  4.67it/s]
 25%|██▌       | 7/28 [00:01<00:04,  4.79it/s]
 29%|██▊       | 8/28 [00:01<00:03,  5.02it/s]
 50%|█████     | 14/28 [00:01<00:00, 14.61it/s]
 57%|█████▋    | 16/28 [00:02<00:01, 11.56it/s]
 64%|██████▍   | 18/28 [00:02<00:00, 10.01it/s]
 82%|████████▏ | 23/28 [00:02<00:00, 16.34it/s]
 93%|█████████▎| 26/28 [00:02<00:00, 13.94it/s]
100%|██████████| 28/28 [00:03<00:00, 11.61it/s]
100%|██████████| 28/28 [00:03<00:00,  9.06it/s]
tutorials/tutorial_examples/{{fig_files[0]}}

We can even use altair to visualize the tract profiles in all of the bundles. We provide a more customizable interface for visualizing the tract profiles using altair. Again, to make this plot, it is required that you install with pip install pyAFQ[plot] so that you have the necessary dependencies.

profiles_df = myafq.combine_profiles()
altair_df = ava.combined_profiles_df_to_altair_df(profiles_df)
altair_chart = ava.altair_df_to_chart(altair_df)
altair_chart.display()
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/scipy/stats/_distn_infrastructure.py:2285: RuntimeWarning:

invalid value encountered in multiply

/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/scipy/stats/_distn_infrastructure.py:2286: RuntimeWarning:

invalid value encountered in multiply

alt.VConcatChart(...)

We can check the number of streamlines per bundle, to make sure every bundle is found with a reasonable amount of streamlines.

bundle_counts = pd.read_csv(myafq.export("sl_counts")["01"], index_col=[0])
for ind in bundle_counts.index:
    if ind == "Total Recognized":
        threshold = 1000
    else:
        threshold = 10
    if bundle_counts["n_streamlines"][ind] < threshold:
        raise ValueError((
            "Small number of streamlines found "
            f"for bundle(s):\n{bundle_counts}"))

Total running time of the script: (3 minutes 41.026 seconds)

Estimated memory usage: 1859 MB

Gallery generated by Sphinx-Gallery