## Introduction

In this example walkthrough, we will use some example fixel data to demonstrate the steps of using ModelArray and its companion python package, ConFixel. By following the vignette("installations") page, you should have successfully installed ModelArray, ConFixel, and MRtrix. We expect that ConFixel has been installed in a conda environment called modelarray.

We will first prepare the data and convert it into the format that ModelArray requires (Step 1), then we’ll use ModelArray to perform the statistical analysis (Step 2). Finally we will convert the results into original file format and view them (Step 3).

## Step 1. Prepare your data

We first create a folder called “myProject” on the Desktop. In a terminal console:

$cd ~/Desktop$ mkdir myProject
$cd myProject$ pwd       # print the full path of this folder

On a linux machine, you’ll see the printed full path of this folder is /home/<username>/Desktop/myProject

Here, we provide some demo fixel data. This demo data includes 100 subjects aged 8-22 years from the Philadelphia Neurodevelopmental Cohort (PNC) Satterthwaite et al., 2014. This data was generated by following fixel-based analysis Raffelt et al., 2017 and are ready for fixel-wise statistical analysis. You can get the data by running the following:

$wget -cO - https://osf.io/tce9d/download > download.tar.gz$ tar -xzf download.tar.gz
$fixelstats_write \ --index-file FDC/index.mif \ --directions-file FDC/directions.mif \ --cohort-file cohort_FDC_n100.csv \ --relative-root /home/<username>/Desktop/myProject \ --analysis-name results_lm \ --input-hdf5 demo_FDC_n100.h5 \ --output-dir results_lm # remember to use your specific path in --relative-root; # we recommend it's a full path too! After it’s done, in the main folder myProject, there will be a new folder called results_lm, and converted result mif files are in this new folder: results_lm/ ├── directions.mif ├── index.mif ├── results_lm_Age.1m.p.value.fdr.mif ├── results_lm_Age.1m.p.value.mif ├── results_lm_Age.estimate.mif ├── results_lm_Age.p.value.fdr.mif ├── results_lm_Age.p.value.mif ├── results_lm_Age.statistic.mif ├── results_lm_dti64MeanRelRMS.1m.p.value.fdr.mif ├── results_lm_dti64MeanRelRMS.1m.p.value.mif ├── results_lm_dti64MeanRelRMS.estimate.mif ├── results_lm_dti64MeanRelRMS.p.value.fdr.mif ├── results_lm_dti64MeanRelRMS.p.value.mif ├── results_lm_dti64MeanRelRMS.statistic.mif ├── results_lm_element_id.mif ├── results_lm_Intercept.1m.p.value.fdr.mif ├── ... ├── results_lm_model.1m.p.value.fdr.mif ├── results_lm_model.1m.p.value.mif ├── results_lm_model.adj.r.squared.mif ├── results_lm_model.p.value.fdr.mif ├── results_lm_model.p.value.mif ├── results_lm_sex.1m.p.value.fdr.mif ├── ... 0 directories, 32 files Here, 1m.p.value.* means it’s the 1 - p-value image. ### Step 3.2. View the results in MRtrix’s MRView You can launch MRView from the terminal with mrview: # Suppose you're in myProject folder:$ cd results_lm   # switch to results folder
\$ mrview

Click File -> Open, select index.mif. Then click Tools -> Fixel plot, you’ll see a side panel of “Fixel plot”. Within this side panel, click button “Open fixel image” (see below, highlighted in red):

From there, select index.mif file again. You’ll see colored directions.mif. Now you can choose which image to display. Click the filename next to “colour by”, select results_lm_Age.estimate.mif; then click the button next to “threshold by”, select results_lm_model.p.value.fdr.mif, check/tick the option of upper limit, then enter “0.005”. You may change the view by clicking “View” in the upper panel. Below is an example view: