diff --git a/Makefile b/Makefile index de0f924d..62e6b9f0 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,13 @@ help: .PHONY: help Makefile +# This calls sphinx-apidoc to create an api folder in SOURCEDIR with +# documentation for all Python modules +buildapi: + @sphinx-apidoc -fMeET -o docsrc/api designer + @echo "Auto-generation of API documentation finished. " \ + "The generated files are in 'api/'" + github: @make html @cp -a docs/html/. ./docs diff --git a/README.md b/README.md index f96ba66e..d1f2265e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # PyDesigner -[![Docker Pulls](https://img.shields.io/docker/pulls/dmri/neurodock?logo=docker)](https://hub.docker.com/r/dmri/neurodock) - [Please view updated documentation here](https://m-ama.github.io/PyDesigner/)

@@ -29,463 +27,7 @@ PyDesigner was inspired by [NYU's DESIGNER](https://github.com/NYU-DiffusionMRI/

-## Table of Contents -**[Abstract](#pydesigner)**
-**[General Information](#general-information)**
-**[Introduction](#introduction)**
-[|__ The PyDesigner Pipeline](#the-pydesigner-pipeline)
-[|__ Image Acquisition](#image-acquisition)
-[|__ Preprocessing](#preprocessing)
-[|__ Tensor Estimation](#tensor-estimation)
-**[Installation](#installation)**
-[|__ FSL](#fsl)
-[|__ MRTRIX3](#mrtrix3)
-[|__ Python](#python)
-[|__ PyDesigner](#pydesigner)
-**[Running PyDesigner](#running-pydesigner)**
-[|__ Before Running PyDesigner](#before-running-pydesigner)
-[|__ To Run PyDesigner](#to-run-pydesigner)
-[|__ Basic PyDesigner Flags](#basic-pydesigner-flags)
-**[Docker Setup](#docker-setup)**
-[|__ Docker Installation](#docker-installation)
-[|__ Configure Docker](#configure-docker)
-**[Compiling Instructions](#compiling-instructions)**
-[|__ Via DockerHub](#via-dockerhub)
-[|__ Via GitHub](#via-github)
-**[Running NeuroDock](#running-neurodock)**
-[|__ SSH Mode](#ssh-mode)
-[|__ Command-basis mode](#command-basis-mode)
-[|__ Alias](#alias)
-**[Information for Developers](#information-for-developers)**
-[|__ General Pipeline Flow](#general-pipeline-flow)
-[|__ List of Files](#list-of-files)
-**[Future Plans](#future-plans)**
-**[Questions and Issues](#questions-and-issues)**
-**[Meet the Team](#meet-the-team)**
- -## General Information -### Introduction -We here provide the code to estimate the diffusion kurtosis tensors from diffusion-weighted images. The (constrained) weighted linear least squares estimator is here preferred because of its accuracy and precision. See “Veraart, J., Sijbers, J., Sunaert, S., Leemans, A. & Jeurissen, B., Weighted linear least squares estimation of diffusion MRI parameters: strengths, limitations, and pitfalls. NeuroImage, 2013, 81, 335-346” for more details. Next, a set of diffusion and kurtosis parameters, including the white matter tract integrity metrics, can be calculated form the resulting kurtosis tensor. - -Some important notes needs to be considered: - -1. Since the apparent diffusion tensor has 6 independent elements and the kurtosis tensor has 15 elements, there is a total of 21 parameters to be estimated. As an additional degree of freedom is associated with the noise free nondiffusion-weighted signal, at least 22 diffusion-weighted images must be acquired for DKI. It can be further shown that there must be at least three distinct b-values, which only differ in the gradient magnitude. Furthermore, at least 15 distinct diffusion (gradient) directions are required (Jensen et al. 2005). Some additional consideration must be made. The maximal b-value should be chosen carefully and is a trade-off between accuracy and precision. While for DTI, diffusion-weighted images are typically acquired with rather low b-values, about 1000 s⁄mm^2 , somewhat stronger diffusion sensitizing gradients need to be applied for DKI as the quadratic term in the b-value needs to be apparent. It is shown that b-values of about 2000 s⁄mm^2 are sufficient to measure the degree of non-Gaussianity with an acceptable precision (Jensen & Helpern 2010). - -2. Outliers, or “black voxels”, in kurtosis maps are not uncommon. They result from undesired signal fluctuations due to motion, Gibbs ringing, or noise, which can often only be reduced using sophisticated tools. Unfortunately, those outliers will interfere with the visual and statistical inspection of the kurtosis parameters maps. Smoothing is typically used to suppress those outliers. Use of smoothing must be done with care as image blur partial voluming effects might be introduced. - -### The PyDesigner Pipeline -There are three main stages involved in DTI/DKI: image acquisition, preprocessing, and tensor estiamation. The scanner handles the first stage, while our PyDesigner pipeline handles the last two. - -#### Image acquisition -Like with any other bioimaging modalities, the first step is always acquiring imaging data. Depending on your institution, ensure that you are using the most recent protocol for either DTI or DKI. - -#### Preprocessing -The next step is to boost SNR of the acquired image through various preprocessing steps. These steps include: - -1. Denoising (MRTRIX3's `dwidenoise`) -2. Removal of Gibbs ringing artifact (MRTRIX3's `mrdegibbs`) -3. Rigid body alignment of multiple DWI series (MRTRIX3's `mrregister` and `mrtransform`) -4. Distortion correction (FSL's `eddy` and `topup` via MRTRIX3's `dwidenoise`) -5. Brain mask extraction (FSL's `bet`) -6. Smoothing -7. Rician correction (MRTRIX3's `mrcalc`) - -These corrections are performs with command-line executables from FSL and MRTRIX, making it mandatory to have these installed prior to running PyDesigner. - -#### Tensor Estimation -The third and final stage performs actual metric extraction using mathematical means entirely via Pyhton dependencies. The basic tensor estiamtion pipeline flows something like this: - -1. IRLLS outlier detection and tensor estimation -2. Precise tensor fitting with constraints -3. DTI parameter extraction -4. AKC outlier detection -5. DKI parameter extraction - -Performing these calculations require only Python dependencies which can easily be obtained via `pip install ...` or `conda install ...`. More information will be provided in the [installation](#installation) section. - -## Installation -There are three dependencies for PyDesigner: 1) FSL, 2) MRTRIX3, and 3) Python. Configuration and means of obtaining said dependencies are listed below. - -**Note**: All testing was conducted using Python 3.7, MRtrix3, and FSL 6.0.1. Usage of DESIGNER with alternative versions of these dependencies has not been tested and is not recommended. - -### FSL -FSL is a collection of tools and software used to process fMRI, MRI and DWI data. [Visit their installation page](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation) for download and installation guide. - -**FSL 6.0.1 is recommended.** All testing has been done using FSL 6.0.1. PyDesigner has not been tested with other versions of FSL. - -To check your FSL version: - -``` -FLIRT -version -``` - -**If you are currently running an FSL version after v6.0.1 and using NVIDIA CUDA:** - -As of most recent FSL 6.0.3, `eddy` does not support CUDA 10, while `bedpost` and `probtrakx` do. Moreover, the version supplied after FSL v6.0.1 fails on certain datasets. If running on a CUDA system, users are advised to downgrade to CUDA 9.1 for maximum compatibility, and to do so prior to installing FSL. - -After the installation of FSL, Create a backup of original `eddy_cuda9.1` by renaming it to to `eddy_cuda9.1.BAK`. Then, replace `eddy_cuda9.1` with the one from [FSL v6.0.1](https://users.fmrib.ox.ac.uk/~thanayik/eddy_cuda9.1). End by making the new file executable with `sudo chmod +x /path/to/eddy_cuda9.1`. - -Replace/Install [bedpostx for GPU](https://users.fmrib.ox.ac.uk/~moisesf/Bedpostx_GPU/Installation.html) for CUDA 9.1. - -### MRTRIX3 -MRTRIX3 is another software suite aimed at analysis of DWI data. Here are some of their helpful pages. -1. [Homepage](https://www.mrtrix.org/) -2. [Download and Install](https://www.mrtrix.org/download/) - -To check your MRtrix version: - -``` -mrconvert -version -``` - -### Python -PyDesigner was built and tested on Python 3.7, so we enourage all users to adopt this version as well. While you may use the Python supplied by default on your OS, we highly enocurage users to adopt a Conda-based Python like [Miniconda](https://docs.conda.io/en/latest/miniconda.html) or [Anaconda](https://www.anaconda.com/). Conda is a command line tool that allows the creation of separated environments with different python versions and packages. This of it as running multiple virtual machines on the a single host - you can easily switch between any for different needs, or run them simultaneously. - -Refer to either of these distributions' page for installation. This guide assumes a conda (Miniconda) installation for setting up Python. If you already have conda, or prefer using the default Python supplied by your OS, skip to package installation at the end of this subsection. - -First, update conda with -``` -conda update conda -``` - -Creating a conda environment is recommended as this will keep all of the dependencies required for this project isolated to just the conda environment called `dmri`. For more information about conda environments, see [The Definitive Guide to Conda Environments](https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533). Next, create a conda environment specifically for dMRI preprocessing, called `dmri`. You can choose any name, but be sure to replace `dmri` in this guide with the name of your choice. - -If you prefer not to create this environment, skip to package installation. In addition, we'll be installing `pip` to this environment, in the even `conda install ` fails to compile and install a package. - -``` -conda create -n dmri python=3.7 -conda install -n dmri pip -``` -Activate the new environment with: -``` -conda activate dmri -``` -**Note**: Environment activation (`conda activate dmri`) needs to be done each time a new terminal window is opened. If this behavior is undesired, you may set this environment as default python environment. Refer to advanced conda user guides or Google search how to do this. - -#### Pepare Python for PyDesigner -**Note: Skip to [automated install](#automated-install) to configure pydesigner automatically** - -Once the base environment is created and activated, proceed with the installation of all packages. - -1. [NumPy](https://numpy.org/) -2. [SciPy](https://www.scipy.org/) -3. [CVXPY](https://www.cvxpy.org/) -4. [NiBabel](https://nipy.org/nibabel/) -5. [Multiprocessing](https://docs.python.org/3.4/library/multiprocessing.html?highlight=process) -6. [Joblib](https://joblib.readthedocs.io/en/latest/) -7. [TQDM](https://tqdm.github.io/) -8. [py-cpuinfo](https://github.com/workhorsy/py-cpuinfo) -9. [matplotlib](https://matplotlib.org/) - -Install necessary packages with the commands: -``` -conda install -c anaconda numpy scipy joblib -conda install -c conda-forge tqdm nibabel multiprocess matplotlib py-cpuinfo -pip install --upgrade setuptools -pip install cvxpy -``` - -If conda fails to install a package, use pip to install the package with: -``` -pip install [package name] -``` - -Completion of this step will ready your system for dMRI processing. Let's go! - -### PyDesigner -On the [main PyDesigner Github page](https://github.com/m-ama/PyDesigner), click the green "Clone or download" button to access the latest PyDesigner build. Click "Download ZIP". When the download is complete, find the PyDesigner-master.zip in your Downloads folder and unzip. - -PyDesigner is located here: `/PyDesigner-master/designer/pydesigner.py` - -#### Automated Install -PyDesigner can be automatically installed with all dependencies by opening -a CLI and changing directory to root PyDesigner directory, followed by -``` -pip install . -``` -This will execute the setup.py script in root directory to automatically -configure your Python environment for PyDesigner. When running the -automated methods, PyDesigner can simply be called with the commad -`pydesigner` instead of specifying the `python pydesigner.py` prefix. - -**Note:** If you need a stable and tested build, download the most recent release from the [Release tab](https://github.com/m-ama/PyDesigner/releases). Click on `Source code (zip)` link and decompress (unzip) to any folder you desire. - -## Running PyDesigner -With PyDesigner installed and ready to run, let's floor the pedal. - -### Before Running PyDesigner -Ensure that all your DICOMS are converted to NifTi files and that all diffusion series have a valid `.json` file, as well as `.bvec` and `.bval` files where applicable. Dicom to nifti conversion can be done with [dcm2niix available for download here](https://github.com/rordenlab/dcm2niix). - -Ensure that none of your file or folder names contain a period (aside from the file extension; eg. DKI.nii). - -### To Run PyDesigner -Switch to the appropriate conda environment; run `conda activate dmri` if you followed this guide. Then, for any given subject, call PyDesigner with the relevant flags: - -``` -python /Path/to/pydesigner.py \ ---denoise \ ---degibbs \ ---smooth \ ---rician \ ---mask \ --o /Path/to/output/folder \ -/Path/to/input_file.nii -``` - -**Note**: Flags can be added and removed as needed. It is recommended to always run PyDesigner with the `--mask` flag, as this flag utilizes a brain mask with excludes non-brain voxels and subsequently speeds up processing. - -If your dataset contains more than one DKI average per subject, your file input may contain all relevant nifti files separated by a comma (no space superceding a comma): - -``` -python /Path/to/pydesigner.py \ ---denoise \ ---degibbs \ ---smooth \ ---rician \ ---mask \ --o /Path/to/output/folder \ -/Path/to/DKI_avg_1.nii,/Path/to/DKI_avg_2.nii -``` - -As long as all sequences come from the same acquisition with the same parameters (phase encoding direction, gradients, etc.), they can be combined to preprocess and produce DTI/DKI maps. - -**Note**: Multiple average inputs with additional interleved B0s can be given to PyDesigner but suport for separate B0 sequences is experimental. See [PR #84](https://github.com/m-ama/PyDesigner/pull/84) for further information. - -If your dataset contains a top up sequence, you can use the `--topup` and `--undistort` flags: - -``` -python /Path/to/pydesigner.py \ ---denoise \ ---degibbs \ ---smooth \ ---rician \ ---mask \ ---topup /Path/to/reverse_phase.nii \ --o /Path/to/output/folder \ -/Path/to/input_file.nii -``` - -**Note**: Using `--undistort` and `--topup` without supplying top up data will return an error. - -### Basic PyDesigner Flags -Flags are to be preceeded by `--`. For example, to parse a _denoise_ flag, one would type the flag as `--denoise`. - - | Flag | Description | - | :---------- | :- | - |`-h`|opens help text| - |`-o, --output`|specifies output folder| - |`-s, --standard` | runs the standard pipeline (denoising, gibbs unringing, topup + eddy, b1 bias correction, CSF-excluded smoothing, rician bias correction, normalization to white matter in the first B0 image, IRWLLS, CWLLS DKI fit, outlier detection and removal) | - |`--denoise` |performs denoising| - |`--extent [n,n,n,]` |Denoising extent formatted n,n,n; default: 5,5,5; forces denoising| - |`--degibbs` |performs gibbs unringing correction| - |`--smooth` |performs smoothing| - |`--fwhm [FWHM]`|specifies the full width half maximum (FWHM) for smoothing; default: 1.25| - |`--rician` |performs rician bias correction| - |`--mask` |computes brain mask prior to tensor fitting; recommended| - |`--maskthr` |FSL bet threshold used for brain masking; default: 0.25; specify only when using `--mask`| - |`--user_mask` |path to user-provided mask| - |`--undistort`|performs image undistortion via FSL eddy| - |`--epiboost`|discards all but one B0 from each phase encoding direction to speed up TOPUP| - |`--wmti` |computes WMTI parameters| - |`--fit_constraints [n,n,n,]`|specifies constraints for WLLS fitsting; formatted n,n,n| - |`--force` |overwrites existing files in output folder| - |`--resume` |resumes processing from a previous state; only if same output folder| - |`--nofit` |preprocess only; does not perform tensor fitting and parameter extraction| - |`--noakc` |disables outlier correction on kurtosis fitting metrics| - |`--nooutliers`|disables IRWLLS outlier detection (not recommended for DKI)| - |`--noqc`|disables computation of acqusition QC metrics| - |`--nthreads` |specify number of CPU workers to use in processing| - |`--verbose` |prints out all output: recommended for debugging| - |`--adv` |disables safety checks for advanced users who want to force a preprocessing step. **WARNING: FOR ADVANCED USERS ONLY**| - -## Docker Setup - -

- - MUSC DKI Page - -

- -**Before proceeding, please ensure that your hardware is capable of virtualization. Most modern Intel and AMD processors are compatible. 16 GB minimum RAM is recommended.** - -### Docker Installation -The first step is actually installing Docker. One can easily download and install this from the [Docker Desktop](https://www.docker.com/products/docker-desktop) page by following instructions for respective platforms. - -**Windows Users**: Please ensure that Hyper-V is enabled on your machine by following the guide [here](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v). - -### Configure Docker -Run docker after installation, then head over to docker preferences by opening the **Docker menu > Preferences...**, via the Docker icon in your taskbar. - -

- Docker preferences button - -

- -Head over to the advanced tab and select the maximum number of CPU to make available to Docker. For dMRI processing, upward of 4 is recommended. Then allocate 16.0 GiB or more memory with 1.0 GiB of Swap. - -

- Docker advanced preferences - -

- -Users are encouraged not to allocate all their physical CPUs to Docker. As a guideline, it is okay to allcate up to 75% of all physical cores. - -### Compiling Instructions -There are two ways to build a the NeuroDock docker image, through the [GitHub repository](https://github.com/m-ama/PyDesigner) or via [DockerHub](https://hub.docker.com/r/dmri/neurodock), where the latter is highly recommended. - -#### Via DockerHub -DockerHub is a repository of Docker images and containers for every occassion. -The greatest advantage to using DockerHub is the ease and speed of building a container, where a simple commands can fetch a precompiled image. One can easily build NeuroDocker with the [`docker pull`](https://docs.docker.com/engine/reference/commandline/pull/) command: - -``` -docker pull dmri/neurodock -``` - -Total estimated download for `dmri/neurodock:latest` is approximately 6.0 GB. - -#### Via GitHub -To build a docker image via the GitHub repo, begin by cloning the repository to your local machine and take note of its path. - -Then, in your command line, type: - -**To build latest from master:** -``` -docker build -t -f /docker/Dockerfile_latest /docker -``` -Builds from master may not be stable, so we highly recommend building from latest release. - - -**To build from latest release:** -``` -docker build -t -f /docker/Dockerfile_release /docker -``` - - -Where `` is the name given to the container, and `` is the absolute path where the NeuroDock repository is located. For additional building information, please see the [`docker build`](https://docs.docker.com/engine/reference/commandline/build/) documentation. - -As a real example, here is the command parsed on one of the lab's computers to build this Docker image: -``` -docker build -t neurodock -f /Users/sid/Repos/PyDesigner/docker/Dockerfile_release /Users/sid/Repos/PyDesigner/docker -``` - -Total buildtime on an 8-core/16-thread machine is approximately 45 minutes. - -### Running NeuroDock -Congratulations on building NeuroDock! Let's proceed to container usage, it's fairly simple! - -There are two ways to run NeuroDock, either in SSH mode or on a command-basis. SSH mode is akin to having a command-line window entirely to NeuroDock via an SSH. The latter allows NeuroDock to behave like an installed package which allows FSL, MRtrix3 and PyDesigner commands to be called from command line. - -Both methods are initiated by the [`docker run`](https://docs.docker.com/engine/reference/run/) command. - -#### SSH Mode -Simply execute the command below to run NeuroDock in SSH mode: -``` -docker run -it --rm -v : dmri/neurodock -``` - It is higly recommended to run NeuroDock with the cleanup flag `--rm`, which cleans up and removes the filesystem from Docker when it exits to prevent storage waste. - - The `-v ` allows one to [bind mount](https://docs.docker.com/storage/bind-mounts/) a local folder/drive to make it visible to the container. This folder is mounted at the ``. - - A real-world usage command to demonstrate this is given below. This command mounts the local folder `/Users/sid/Documents/Projects` to `/Data` within the container. - - ``` - docker run -it --rm -v /Users/sid/Documents/Projects:/Data dmri/neurodock - ``` - - Once in SSH mode, the terminal window will only accept commands from the NeuroDock container - these are FSL, MRtrix3 and PyDesigner commands. To leave exit the container and leave SSH mode, simply type `exit` to leave the container. - - #### Command-basis mode - This mode of running a NeuroDock allows one to run FSL, MRtrix3, or PyDesigner commands easily without executing the entire container in SSH mode. The container will exit as soon as the command given terminates. The syntax is the same as running in SSH mode, with the addition of the command. For example, to call FSL's bet, one would run: - -``` -docker run -it --rm -v : dmri/neurodock bet -m -t 0.25 -``` - -Similarly, one can run PyDesigner with: -``` -docker run -it --rm -v : dmri/neurodock python3 pydesigner.py [options] inputs -``` - -Here's a real example: -``` -docker run -it --rm \ --v /Users/sid/Documents/Projects/IAM/Dataset/NifTi/IAM_1122:/Proc \ -python3 pydesigner.py \ ---denoise \ ---rician \ ---degibbs \ ---smooth \ ---undistort --rpe_none \ ---mask \ ---verbose \ --o /Proc/pyd \ -/Proc/dwi/IAM_1122_15_DKI_BIPOLAR_2_5mm_64dir_50slices.nii -``` - -#### Alias -It is cumbersome to add long commands such those above each time. An alias acts as a shortcut to a command, thus allowing us to shorten a command drastically. To call PyDesigner in a docker environment, an alias can be set up like this: - -``` -alias pydesigner="docker run -it --rm -v : dmri/neurodock python3 pydesigner.py" -``` - -Now, simply parsing the command `pydesigner` into your CLI will execute PyDesigner in a container. Running `pydesigner -h` will open up the PyDesigner help text. - -Take note that the alias is assigned to a specific mounted volume defined by the flag `-v :`. To process several subjects, it is advisable to mount an entire drive to the alias. - -## Information for Developers -This sections covers information on the various files provided in this package. Users contributing to the project should refer to this section to understand the order of operations. - -### General Pipeline Flow -The pipeline is designed to process NifTi acquisitions as a starting point, and end with DTI/DKI maps. This pipeline can be broken down into two important segments: - -1. Preprocessing -2. Tensor estimation - -Each segment is responsible for unique sets of computations to produce useful metrics. - -### List of Files -There are several files in this package that allow the two segemnts to flow smoothly. The table in this section lists all these files and their purpose. - -| File | Purpose | -| :---------- | :- | -| **Main Script** | -| `pydesigner.py` | main PyDesigner script that controls preprocessing steps and tensor fitting | -| `Tensor_Fitting_Guide.ipynb` | a Jupyter Notebook that details functioning of `fitting/dwi.py` for tensor fitting only| -| **Preprocessing** | found in `PyDesigner/designer/preprocessing` | -| `preparation.py` | adds utilities for preparing the data for eddy and analysis | -| `rician.py` | performs Rician correction on a DWI with a noisemap from MRTRIX3's `dwipreproc` | -| `smoothing.py` | applies nan-smoothing to input DWI | -| `ulti.py` | utilities for the command-line interface and file I/O handling | -| **Tensor Estimation** | found in `PyDesigner/designer/fitting/`| -| `dirs30.csv` | csv file containing 30 static directions for constraint creation | -| `dirs256.csv` | csv file containing 250 static directions for parameter extraction | -| `dirs10000.csv` | csv file containing 10,000 static directions for AKC correction and WMTI parameter extraction | -| `dwidirs.py` | handles loading of static directions into `np.array` | -| `dwipi.py` | main tensor fitting script to handle IRWLLS, WLLS, parameter extraction and filtering | -| **Extras** | found in 'PyDesigner/Extras' | -| `des2dke.m` | legacy MATLAB script for converting PyDesigner processed file to DKE-compatible input for validation | -| `dke_parameters.txt` | DKE parameters file, used by `des2dke.m` to activate DKE compatibility | - -## Future Plans -PyDesigner is still in early stages of development. Release of a stable build will allow us to explore extending the pipeline even further with the inclusion of (in no particular order of preference): - -1. Publishing PyDesigner on [PyPi](https://pypi.org/) and [Conda](https://docs.conda.io/en/latest/) -2. ~~Docker container with FSL, MRTRIX3 and Python dependencies for deployment on HPC clusters and cross-platform compute capabilites across Linux, Mac OS and Microsoft Windows~~ -3. Fiber ball imaging (FBI) for microstructural parameters. See [Fiber ball imaging](https://www.ncbi.nlm.nih.gov/pubmed/26432187), and [modeling white matter microstructure with fiber ball imaging](https://www.ncbi.nlm.nih.gov/pubmed/29660512) for more information -4. Deterministic and probabilistic tractography - -## Questions and Issues -For any questions not answered in the above documentation, see the contacts below. - -To report any bugs or issues, see [the Issues tool on the PyDesigner GitHub page.](https://github.com/m-ama/PyDesigner/issues) - -## Meet the Team -PyDesigner is a joint collarobation and as such consists of several developers. - -### Developers +## Developers diff --git a/designer/test/modules.rst b/designer/test/modules.rst new file mode 100644 index 00000000..cb478776 --- /dev/null +++ b/designer/test/modules.rst @@ -0,0 +1,6 @@ +est +=== + +.. toctree:: + :maxdepth: 4 + diff --git a/docs/.buildinfo b/docs/.buildinfo index 17b25162..1d0ba129 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 4ede22ff1c6822f7145efaf41eb8eaa5 +config: cdb9c8ea2f194b766698f10b6619310d tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_sources/api/api.rst.txt b/docs/_sources/api/api.rst.txt new file mode 100644 index 00000000..05209b0d --- /dev/null +++ b/docs/_sources/api/api.rst.txt @@ -0,0 +1,9 @@ +API Documentation +================= + +Information on specific functions, classes, and methods. + +.. toctree:: + :glob: + + api/* \ No newline at end of file diff --git a/docs/_sources/api/designer.fitting.dwidirs.rst.txt b/docs/_sources/api/designer.fitting.dwidirs.rst.txt new file mode 100644 index 00000000..1a35bc8f --- /dev/null +++ b/docs/_sources/api/designer.fitting.dwidirs.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.fitting.dwidirs + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.fitting.dwipy.rst.txt b/docs/_sources/api/designer.fitting.dwipy.rst.txt new file mode 100644 index 00000000..51292f94 --- /dev/null +++ b/docs/_sources/api/designer.fitting.dwipy.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.fitting.dwipy + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.fitting.rst.txt b/docs/_sources/api/designer.fitting.rst.txt new file mode 100644 index 00000000..a211e69e --- /dev/null +++ b/docs/_sources/api/designer.fitting.rst.txt @@ -0,0 +1,15 @@ +designer.fitting package +======================== + +.. automodule:: designer.fitting + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.fitting.dwidirs + designer.fitting.dwipy diff --git a/docs/_sources/api/designer.info.rst.txt b/docs/_sources/api/designer.info.rst.txt new file mode 100644 index 00000000..0640ec2a --- /dev/null +++ b/docs/_sources/api/designer.info.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.info + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.postprocessing.filters.rst.txt b/docs/_sources/api/designer.postprocessing.filters.rst.txt new file mode 100644 index 00000000..bf3d4802 --- /dev/null +++ b/docs/_sources/api/designer.postprocessing.filters.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.postprocessing.filters + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.postprocessing.rst.txt b/docs/_sources/api/designer.postprocessing.rst.txt new file mode 100644 index 00000000..2b9f0fef --- /dev/null +++ b/docs/_sources/api/designer.postprocessing.rst.txt @@ -0,0 +1,14 @@ +designer.postprocessing package +=============================== + +.. automodule:: designer.postprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.postprocessing.filters diff --git a/docs/_sources/api/designer.preprocessing.mrinfoutil.rst.txt b/docs/_sources/api/designer.preprocessing.mrinfoutil.rst.txt new file mode 100644 index 00000000..60dbcd09 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.mrinfoutil.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.mrinfoutil + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.mrpreproc.rst.txt b/docs/_sources/api/designer.preprocessing.mrpreproc.rst.txt new file mode 100644 index 00000000..86987655 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.mrpreproc.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.mrpreproc + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.preparation.rst.txt b/docs/_sources/api/designer.preprocessing.preparation.rst.txt new file mode 100644 index 00000000..751b1266 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.preparation.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.preparation + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.rician.rst.txt b/docs/_sources/api/designer.preprocessing.rician.rst.txt new file mode 100644 index 00000000..5d23d6f8 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.rician.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.rician + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.rst.txt b/docs/_sources/api/designer.preprocessing.rst.txt new file mode 100644 index 00000000..c4382851 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.rst.txt @@ -0,0 +1,20 @@ +designer.preprocessing package +============================== + +.. automodule:: designer.preprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.preprocessing.mrinfoutil + designer.preprocessing.mrpreproc + designer.preprocessing.preparation + designer.preprocessing.rician + designer.preprocessing.smoothing + designer.preprocessing.snrplot + designer.preprocessing.util diff --git a/docs/_sources/api/designer.preprocessing.smoothing.rst.txt b/docs/_sources/api/designer.preprocessing.smoothing.rst.txt new file mode 100644 index 00000000..4efdecc9 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.smoothing.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.smoothing + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.snrplot.rst.txt b/docs/_sources/api/designer.preprocessing.snrplot.rst.txt new file mode 100644 index 00000000..1a8df83a --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.snrplot.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.snrplot + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.util.DWIFile.rst.txt b/docs/_sources/api/designer.preprocessing.util.DWIFile.rst.txt new file mode 100644 index 00000000..dfef0f17 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.DWIFile.rst.txt @@ -0,0 +1,35 @@ +DWIFile +======= + +.. currentmodule:: designer.preprocessing.util + +.. autoclass:: DWIFile + :show-inheritance: + + .. rubric:: Methods Summary + + .. autosummary:: + + ~DWIFile.getBVAL + ~DWIFile.getBVEC + ~DWIFile.getFull + ~DWIFile.getJSON + ~DWIFile.getName + ~DWIFile.getPath + ~DWIFile.hasJSON + ~DWIFile.isAcquisition + ~DWIFile.isPartialFourier + ~DWIFile.print + + .. rubric:: Methods Documentation + + .. automethod:: getBVAL + .. automethod:: getBVEC + .. automethod:: getFull + .. automethod:: getJSON + .. automethod:: getName + .. automethod:: getPath + .. automethod:: hasJSON + .. automethod:: isAcquisition + .. automethod:: isPartialFourier + .. automethod:: print diff --git a/docs/_sources/api/designer.preprocessing.util.DWIParser.rst.txt b/docs/_sources/api/designer.preprocessing.util.DWIParser.rst.txt new file mode 100644 index 00000000..76f26a0a --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.DWIParser.rst.txt @@ -0,0 +1,21 @@ +DWIParser +========= + +.. currentmodule:: designer.preprocessing.util + +.. autoclass:: DWIParser + :show-inheritance: + + .. rubric:: Methods Summary + + .. autosummary:: + + ~DWIParser.cat + ~DWIParser.getPath + ~DWIParser.json2fslgrad + + .. rubric:: Methods Documentation + + .. automethod:: cat + .. automethod:: getPath + .. automethod:: json2fslgrad diff --git a/docs/_sources/api/designer.preprocessing.util.bvec_is_fullsphere.rst.txt b/docs/_sources/api/designer.preprocessing.util.bvec_is_fullsphere.rst.txt new file mode 100644 index 00000000..c9cbfcbb --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.bvec_is_fullsphere.rst.txt @@ -0,0 +1,6 @@ +bvec_is_fullsphere +================== + +.. currentmodule:: designer.preprocessing.util + +.. autofunction:: bvec_is_fullsphere diff --git a/docs/_sources/api/designer.preprocessing.util.find_valid_ext.rst.txt b/docs/_sources/api/designer.preprocessing.util.find_valid_ext.rst.txt new file mode 100644 index 00000000..fa372392 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.find_valid_ext.rst.txt @@ -0,0 +1,6 @@ +find_valid_ext +============== + +.. currentmodule:: designer.preprocessing.util + +.. autofunction:: find_valid_ext diff --git a/docs/_sources/api/designer.preprocessing.util.rst.txt b/docs/_sources/api/designer.preprocessing.util.rst.txt new file mode 100644 index 00000000..6ab0aa26 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.util + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.preprocessing.util.vecs_are_fullsphere.rst.txt b/docs/_sources/api/designer.preprocessing.util.vecs_are_fullsphere.rst.txt new file mode 100644 index 00000000..06477505 --- /dev/null +++ b/docs/_sources/api/designer.preprocessing.util.vecs_are_fullsphere.rst.txt @@ -0,0 +1,6 @@ +vecs_are_fullsphere +=================== + +.. currentmodule:: designer.preprocessing.util + +.. autofunction:: vecs_are_fullsphere diff --git a/docs/_sources/api/designer.pydesigner.rst.txt b/docs/_sources/api/designer.pydesigner.rst.txt new file mode 100644 index 00000000..d3b44351 --- /dev/null +++ b/docs/_sources/api/designer.pydesigner.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.pydesigner + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.rst.txt b/docs/_sources/api/designer.rst.txt new file mode 100644 index 00000000..556a3df7 --- /dev/null +++ b/docs/_sources/api/designer.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/api/designer.system.rst.txt b/docs/_sources/api/designer.system.rst.txt new file mode 100644 index 00000000..5da5b3da --- /dev/null +++ b/docs/_sources/api/designer.system.rst.txt @@ -0,0 +1,14 @@ +designer.system package +======================= + +.. automodule:: designer.system + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.system.systemtools diff --git a/docs/_sources/api/designer.system.systemtools.rst.txt b/docs/_sources/api/designer.system.systemtools.rst.txt new file mode 100644 index 00000000..937d9f6c --- /dev/null +++ b/docs/_sources/api/designer.system.systemtools.rst.txt @@ -0,0 +1,4 @@ +.. automodule:: designer.system.systemtools + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/docker/docker_configuration.rst.txt b/docs/_sources/docker/docker_configuration.rst.txt new file mode 100644 index 00000000..142c74a4 --- /dev/null +++ b/docs/_sources/docker/docker_configuration.rst.txt @@ -0,0 +1,117 @@ +Docker Configuration +==================== + +Docker can be configured in a wide-varietry of ways based on hardware +resources available. Parameters such as CPU cores, RAM and storage can +be assigned to Docker for running NeuroDock. + +For validations purposes, the NeuroDock image was tested to work as +intended on the following three systems: + +.. csv-table:: + :header: "Part", "Machine A", "Machine B", "Machine C" + + "Build", "Apple iMac Pro", "Custom", "Custom" + "OS", "Mac OS X Mojave", "Ubuntu 18.04", "Microsoft Windows 10 Pro" + "CPU", "Intel Xeon W [8C/16T]", "AMD Ryzen R9 2700X [8C/16T]", "AMD Ryzen R9 2700X [8C/16T]" + "Memory", 64 GB, 16 GB, 16 GB + "Video", Raden Pro Vega 56 8 GB, Nvidia GTX 1080 8 GB, Nvidia GTX 1080 8 GB + +We found identical results across the three operating systes on all +these configurations. + +Docker Preferences +------------------ + +Based on Docker's system requirements, we recommend assigning the +following sysem resources to Docker: + +.. csv-table:: + :header: "Parameter", "Value" + + "CPUs", 8 + "Memory", 16.00 GB + "Disk image size", 32.00 GB + +By default, Docker assigns itself half the number of available +CPU cores and 2 GB of memory. Considering that the entire NeuroDock +image is ~14.5 GB, we recommend at least double in disk image size. +You may configure your Docker Engine to run on this configuration, or +input your own values based on your processing needs. The following +sections detail how to set these parameters. + +Linux +~~~~~ + +CPU and memory access to Docker containers on Linux machines is +manipulated via CFGS scheduler flags at run time. These flags are: + +.. csv-table:: + :header: "Flag", "Description" + + :code:`--cpus=`, specify how many CPU cores to use + :code:`-m` or :code:`--memory`, specify the maximum amount of memory available to containers + +For a more comprehensive list of manupulable system parameters for +for Linux, please visit the `Runtime options with Memory, CPUs, and GPUs`_ +page on Docker documentation. + +.. _Runtime options with Memory, CPUs, and GPUs: https://docs.docker.com/config/containers/resource_constraints/ + +Mac OS +~~~~~~ + +Manipulating these three variables is very simple on Mac OS because +these parameters are located in the GUI. + +1. On the Docker icon in the status bar, right-click on the Docker +icon, then **Preferences**. + +2. Click on the **Resources** tab on the left + +.. figure:: /images/Docker_Mac_resources.png + :scale: 75 % + :align: center + + Docker Mac preferences GUI; click on resources + +3. The **Resourcs** menu will show you the configuration, please +change them to desired valus. You may leave "Swap" at default. + +.. figure:: /images/Docker_Mac_configs.png + :scale: 75 % + :align: center + + Docker Mac resources configuration + + +Windows +~~~~~~~ + +Similar to the Mac, the same sequence of steps apply for the Windows +platform. + +1. Right-click on the Dpcker icon in the taskbar, then click on +**Preferences**. + +2. Clock on the **Resources** tab on the left. + +.. figure:: /images/Docker_Win_configs.png + :scale: 75 % + :align: center + + Docker Windows preferences GUI; configure as desired + +3. The **Resourcs** menu will show you the configuration, please +change them to desired valus. You may leave "Swap" at default. + +Setting the correct configuration will force Docker to not exceed +these constraints. By splitting up CPU and memory loads, researchers +can process multiple DWIs simultaneously. + +GPU Support +----------- + +At this time, there is no CUDA or ROCm GPU support. These feature are +planned for a later release. Please use the non-Docker, native Linux +configuration to utilize GPU for eddy and EPI correction. diff --git a/docs/_sources/docker/docker_install.rst.txt b/docs/_sources/docker/docker_install.rst.txt new file mode 100644 index 00000000..cbf858c4 --- /dev/null +++ b/docs/_sources/docker/docker_install.rst.txt @@ -0,0 +1,191 @@ +Docker Installation +=================== + +Docker is relatively straightforward to install and run. +Windows and Mac users are able to install Docker like any other +GUI-based software package installtion. The installation is not +dependent on console arguments, like Linux. + +Please efer to the instructions below for links and guide. + +Linux +----- + +Users may refer to the Docker Engine installation guide located +`here`_, for installation instructions on their Linux disribution. the +steps covered below are targeted for Debian-based or Ubuntu +distributions. + +.. _here: https://docs.docker.com/install/linux/docker-ce/ubuntu/ + +Uninstall Docker +~~~~~~~~~~~~~~~~ + +1. Uninstall older version or any traces of existing Docker +installations + +.. code-block:: console + + $ sudo apt-get remove docker docker-engine docker.io containerd runc + +Don't panic if :code:`apt-get` returns an a warning about missing +packages. It's good they are missing, since we're trying to purge +existing installations of Docker + +Install Docker Engine +~~~~~~~~~~~~~~~~~~~~~ + +Once all taces of existing Docker installation and dependencies have +been purged, you may proceed with the following steps to install the +Docker Engine - Community. + +1. Update the debian package list with: + +.. code-block:: console + + $ sudo apt-get Update + +2. Install basic packages that enable installation of Docker Engine +and its dependencies with: + +.. code-block:: console + + $ sudo apt-get install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common + +3. Add the Docker official GNU Privacy Guard (GPG) key to enable +encryption and decryption of communication with the Docker server: + +.. code-block:: console + + $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + + +You may verify this key by following the full guide on official Docker +documentation, the link to which is located at the beginning of this +page. + +4. Add the stable Docker Engine repository to your package list with +the command: + +.. code-block:: console + + $ sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" + +Adding a repository to your Linux distribution allows the OS to pull +software packages from the developers' servers. It directs the OS to +the location where these packages are stored. + +Then, update your package manager repository with the command: + +.. code-block:: console + + $ sudo apt-get update + +This updates the list of softwares your OS can fetch from various +repositories. + +5. Once your Debian-based system becomes aware of the Docker Engine, +you may install it simply via the command: + +.. code-block:: console + + $ sudo apt-get install docker-ce docker-ce-cli containerd.io + +6. Verify your Docker Engine installation with the command: + +.. code-block:: console + + $ sudo docker run hello-world + +If the following information prints in the console window, your Docker +Engine installation was sucessful. + +.. code-block:: console + :linenos: + + Hello from Docker! + This message shows that your installation appears to be working correctly. + + To generate this message, Docker took the following steps: + 1. The Docker client contacted the Docker daemon. + 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. + (amd64) + 3. The Docker daemon created a new container from that image which runs the + executable that produces the output you are currently reading. + 4. The Docker daemon streamed that output to the Docker client, which sent it + to your terminal. + + To try something more ambitious, you can run an Ubuntu container with: + "$ docker run -it ubuntu bash" + + Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + + For more examples and ideas, visit: + https://docs.docker.com/get-started/ + +You may now proceed with the fetching of NeuroDock Docker image. + + +Mac OS +------ + +1. Download Docker `Docker Desktop for Mac`_. + +.. _Docker Desktop for Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/ + +2. Double-click on the downloaded `Docker.dmg` to start the install +process. Follw all on-screen instrcutions and prompts. + +3. Docker should start automatically, indicated by the whale icon in +the status bar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in Terminal: + +.. code-block:: console + + $ docker version + +Or you may run the `hello-world` container to verify the installation: + +.. code-block:: + + $ docker run hello-world + +If you information text being printed into the PowerShell windows, +then Docker has been installed successfully. + + +Windows +------- + +1. Download `Docker Desktop for Windows`_. + +.. _Docker Desktop for Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows/ + +2. Double-click the `Docker for Windows Installer` to run the +installer. + +3. Docker should start automatically, indicated by the whale icon in +the taskbar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in PowerShell. + +.. code-block:: console + + $ docker version + +Or you may run the `hello-world` container to verify the installation: + +.. code-block:: + + $ docker run hello-world + +If you information text being printed into the PowerShell windows, +then Docker has been installed successfully. \ No newline at end of file diff --git a/docs/_sources/docker/docker_neurodock.rst.txt b/docs/_sources/docker/docker_neurodock.rst.txt new file mode 100644 index 00000000..20e6e5b9 --- /dev/null +++ b/docs/_sources/docker/docker_neurodock.rst.txt @@ -0,0 +1,71 @@ +Install NeuroDock +================= + +Aftet successfully installing and configuring docker, you can install +the NeuroDock container in one of two ways: + +1. Pulling pre-build image from Docker Hub with :code:`docker pull [image]` +2. Building the image yourself with :code:`docker build [path to image]` + +The first option is the recommended method because prebuilt images are +guaranteed to work and enhance repatibility even further. In additon, +they are numbered version-controlled for referencing. Your copy +of NeuroDock will be configured exactly the same other another +person's. + +The second option is intended for devopers who make frequent changes +to the PyDesigner source code and wish to test their changes in a +Docker environment. The Dockerfile script is designed to build a +Docker image using PyDesigner in the root directory of the repository. + +Docker Hub +---------- + +Pulling pre-built NeuroDock is incredibly straight forward. Run the +following command to pull NeuroDock. + +.. code-block:: console + + $ docker pull docker pull dmri/neurodock:tagname + +where :code:`tagname` is the version you'd like to pull. To install +NeuroDock v0.2, you would run the command + +.. code-block:: console + + $ docker pull dmri/neurodock:v0.2 + +And that's it! All you have to do now is to wait for the NeuroDock +image to finish downloading. + +Local Build +----------- + +**Disclaimer** + It must be reiterated that this option is preserved for developoers; + regular users are encoruaged to stay away from this method because + there is no sematic versioning to referece. + +1. Open up a command line interface and change directory to your +PyDesigner repository + +.. code-block:: console + + $ cd [PyDesginer Repo Path] + +2. To build a Docker image using your local PyDesigner copy, run the +command: + +.. code-block:: console + + $ docker build -t [tagname] . + +Here, :code:`tagname` can be any name you wish to give this image. If +you wish to build an image called neurodock, run the command: + +.. code-block:: console + + $ docker build -t neurodock . + +This will build a Docker image called NeuroDock based on your local +Pyesigner repository. diff --git a/docs/_sources/docker/docker_neurodock_run.rst.txt b/docs/_sources/docker/docker_neurodock_run.rst.txt new file mode 100644 index 00000000..02aad165 --- /dev/null +++ b/docs/_sources/docker/docker_neurodock_run.rst.txt @@ -0,0 +1,133 @@ +Run NeuroDock +============= + +Congratulations, you've come this far. You've installed Docker and +NeuroDock, and are probably wondering how what else to do... + +**You're done. Not even kidding!** You can now start processing data +with PyDesigner and NeuroDock. It's almost as if FSL, MRtrix3 and +PyDesigner commands are built natively into your OS - be it Linux, +Mac OS, or even Windows! + +Intro to Docker Run +------------------- + +Use the following form of :code:`docker run` command to call all +command made availble by NeuroDock: + +.. code-block:: console + + $ docker run [OPTIONS] IMAGE [COMMAND] [ARG...] + +where, + +.. csv-table:: + :header: "Flag", "Definition" + + :code:`[OPTIONS]`, "docker options to use when running the container; common options are :code:`-it`, :code:`-v`, :code:`-d`" + :code:`IMAGE`, "image name to run; in this instance, this is :code:`dmri/neurodock`" + :code:`[COMMAND]`, "specify which NeuroDock commands to run; these can be FSL, MRtrix3 or PyDesigner commands" + :code:`[ARG]`, "arguments for :code:`[COMMAND]`" + + +Users are encouraged to visit the `Docker run reference`_ documentation +for more information on controlling the :code:`docker run ` command. + +.. _Docker run reference: https://docs.docker.com/engine/reference/run/ + +Practical Run +------------- + +The section above convered a generic way to use the :code:`docker run` +command. For actual data analysis, we use the following options. + +1. :code:`-it --rm` to run docker in interative TTY mode. What this +implies is that your NeuroDock command will run like any other OS +commands such as :code:`ipconfig`, :code:`watch`, :code:`ls` etc. + +2. :code:`-v` to mount the file system or folder to processing + +Bind Mount +~~~~~~~~~~ + +The second flag. :code:`-v`, makes visible the host's local filesystem +to a Docker container, which otherwise runs in a completely isolated +system. By mounting a folder for NeuroDock, you are able to make it +process data in said folder. The general guideline is to mount one +subject folder at a time. It is advisable that users read through +`Docker's bind mounts`_ to understand how Docker containers handle +storage. + +.. _Docker's bind mounts: https://docs.docker.com/storage/bind-mounts/ + +The correct syntax for the :code:`-v` flag is: + +.. code-block:: console + + -v [HOST PATH TO MOUNT]:[v] + +Suppose a subject folder :code:`bond_007` in need of processing is +structured the following way: + +| bond_007 +| │ +| ├── nifti +| │ ├── bond_dwi.bval +| │ ├── bond_dwi.bvec +| │ ├── bond_dwi.bval +| │ ├── bond_dwi.json +| │ ├── bond_topup.json +| │ └── bond_topup.nii +| │ +| └── processed (empty dir) + +This subject needs to be processed PyDesigner read the input nifti +files in the :code:`nifti` directory, and saves the outputs in the +:code:`processed` directory. Since both :code:`nifti` and +:code:`processed` folders belong to a common parent directory, the +:code:`bond_007` directory can be mounted to give NeurDock access to +both child directories simultaneously. + +Here, the directory :code:`bond_007` is the :code:`[HOST PATH TO MOUNT]`, +the directory that NeuroDock will not be able to see. + +Next, we need to define where within the container this directory is +mounted, :code:`[TARGET AT WHICH TO MOUNT]`. You may simply mount this +in the root NeuroDock directory at :code:`/data`. + +The flag to reflect this would then be: + +.. code-block:: console + + -v /Users/sid/Desktop/bond_007:/data + +This would make the contents of host directory :code:`bond_007` +available in the NeuroDock at :code:`\data`. Say, for example, the +nifti file :code:`bond_dwi.nii`, is located in the host system at +:code:`/Users/sid/Desktop/bond_007/nifti/bond_dwi.nii`. If the above +mounting scheme is used, the NeuroDock container will see this file in +:code:`/data/nifti/bond_dwi.nii` + +This filesystem transformation is particularly important when writing +scripts for automatic or batch processing of subject directories using +the NeuroDock container. + +Put it all together +~~~~~~~~~~~~~~~~~~~ + +Considering everything on this page, it becomes incredibly easy to +process a subject using the NeuoDock container. Sticking to +:code:`bond_007` example above, and combining everthing so far, one +could process Mr. Bond's DWI with the command: + +.. code-block:: console + + $ docker run -it --rm -v /Users/sid/Desktop/bond_007:/data \ + dmri/neurodock pydesigner --standard \ + --output /data/processed \ + /data/nifti/bond_dwi.nii,/data/nifti/bond_topup.nii + +This command runs the :code:`--standard` PyDesigner pipeline on +the input files :code:`/Users/sid/Desktop/bond_007/nifti/bond_dwi.nii` +and :code:`/Users/sid/Desktop/bond_007/nifti/bond_topup.nii`, and +saves all outputs into the directory :code:`Users/sid/Desktop/bond_007/processed` diff --git a/docs/_sources/docker/introduction.rst.txt b/docs/_sources/docker/introduction.rst.txt new file mode 100644 index 00000000..fb7cb7da --- /dev/null +++ b/docs/_sources/docker/introduction.rst.txt @@ -0,0 +1,64 @@ +NeuroDock +===================== + +Docker is a contaner technology desgned to package an application and +all its needs, such as libraried and other dependencies, into one +package. We adapted PyDesigner and its dependencies for compatibility +with the Docker Engine to bring DTI/DKI analyses to every one. + +We bring you, `NeuroDock`_ + +.. _NeuroDock: https://hub.docker.com/r/dmri/neurodock + +.. image:: /images/NeuroDock_Logo.png + :align: center + :width: 256pt + +.. image:: /images/MUSC_TAG_00447c.png + :align: center + :width: 128pt + +NeuroDock is a Docker image containing the most cutting-edge tools +required for diffusion and kurtosis imaging. This container was +designer for complete dMRI processing pipelines to be platform +agnostic. NeuroDock was inspired by the lack of easily-accessible +tools across various platforms. NeuroDock is 100% compatible across +Windows, Linux, and Mac - while making available the full suite of +FSL, MRtrix3 and PyDesigner commands. + + +Why Docker +---------- + +By packaging fixed versions of FSL, MRtrix3, and PyDesigner, we are +able to guarantee repeatbility and concistency across all platforms. +Regardless of whether researchers are running Linux, Windows, or Mac +OS, identical results can be replicated with Docker technology. + +A side-effect to ensuring repeatiblity with Docker is that it becomes +host operating system (OS) agnostic. This allows users to run FSL, +MRtrix3, or PyDesigner commands at near-native speed, even on +Microsoft Windows. + +Additionally, researchers can easily deploy Docker containers to HPCs +for rapid processing of large-cohort or longitudinal studies with +ease. + +Docker vs Virtual Machines +-------------------------- +Okay, so you may ask, "why not just load up a VM?". You have a point. +While the two technologies appear to be behaving the same way, at +least on the surface level, their inner mechanisms are differ vastly. + +Unlike a VM, rather than creating a whole virtual OS loaded with +dependencies and other applications, Docker allows applications to +share the same OS kernel, thereby providing a significant performance +uplift while saving up storage space. With the removal of an entire +guest OS in VMs, Docker containers save tons of computational +resources that can be diverted towards better performance. + +Now that you know some differences, it is time to move on to preparing +the Docker image! + + + diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt index e599586e..7613eb7b 100644 --- a/docs/_sources/index.rst.txt +++ b/docs/_sources/index.rst.txt @@ -61,6 +61,20 @@ Slack channel`_ for live support. .. _Issues: https://github.com/m-ama/PyDesigner/issues .. _M-AMA Slack channel: https://join.slack.com/t/m-ama/shared_invite/enQtOTUyOTU0MTQ1OTQxLTQwOGZlMzI4YmY2YTUxOWY2NmYxMjgwM2E4ODdkNmU3MGYyMjFiMThlYTIwOGQyNzEzMTAzYTZmMmMyM2NjNTc +**System Requirements** + Parallel processing in PyDesigner scales almost linearly with the + nummber of CPU cores present. The application is also memory-intensive + due to the number of parameter maps being computed. + + Based on this evaluation, for processing a single DWI using + PyDesigner, we recommend the following minimum system specifications: + + - Ubuntu 18.04 + - Intel i7-9700 or AMD Ryzen 1800X [8 cores] + - 16 GB RAM + - 12 GB free storage + - Nvidia CUDA-enabled GPU + .. toctree:: :maxdepth: 1 :caption: Installation @@ -71,7 +85,26 @@ Slack channel`_ for live support. installation/python installation/pydesigner +.. toctree:: + :maxdepth: 1 + :caption: NeuroDock (Docker) + + docker/introduction + docker/docker_install + docker/docker_configuration + docker/docker_neurodock + docker/docker_neurodock_run + +.. toctree:: + :maxdepth: 4 + :caption: List of Functions + + modules/modules + +.. autosummary:: + :toctree: modules + Indices and tables ================== diff --git a/docs/_sources/installation/fsl.rst.txt b/docs/_sources/installation/fsl.rst.txt index 587bd96b..758adf7e 100644 --- a/docs/_sources/installation/fsl.rst.txt +++ b/docs/_sources/installation/fsl.rst.txt @@ -15,7 +15,7 @@ To check your FSL version: .. code-block:: console - flirt -version + $ flirt -version A return value of at least :code:`FLIRT version 6.0` indicates successful installation of FSL, and that meets the PyD requirement. diff --git a/docs/_sources/installation/pydesigner.rst.txt b/docs/_sources/installation/pydesigner.rst.txt index 92e1be43..95e3765a 100644 --- a/docs/_sources/installation/pydesigner.rst.txt +++ b/docs/_sources/installation/pydesigner.rst.txt @@ -16,7 +16,7 @@ To clone the PyDesigner repository, in terminal, run: .. code-block:: console - git clone https://github.com/m-ama/PyDesigner.git + $ git clone https://github.com/m-ama/PyDesigner.git Install ------- @@ -26,7 +26,7 @@ followed by .. code-block:: console - pip install . + $ pip install . This will execute the :code:`setup.py` script in root directory to automatically configure your Python environment for PyDesigner. When diff --git a/docs/_sources/installation/python.rst.txt b/docs/_sources/installation/python.rst.txt index e4a27320..5b6b2d35 100644 --- a/docs/_sources/installation/python.rst.txt +++ b/docs/_sources/installation/python.rst.txt @@ -27,7 +27,7 @@ First, update conda with .. code-block:: console - conda update conda + $ conda update conda Create new environment ---------------------- @@ -44,10 +44,10 @@ in this guide with any name of your choice. Next, execute the following two line to create a Python environment ready for PyD installation. -.. code-block:: python +.. code-block:: console - conda create -n dmri python=3.7 - conda install -n dmri pip + $ conda create -n dmri python=3.7 + $ conda install -n dmri pip The first line create an environment with Python v3.7, while the second line installs the PyPi package manager. diff --git a/docs/_sources/modules/designer.fitting.rst.txt b/docs/_sources/modules/designer.fitting.rst.txt new file mode 100644 index 00000000..38787220 --- /dev/null +++ b/docs/_sources/modules/designer.fitting.rst.txt @@ -0,0 +1,27 @@ +designer.fitting package +======================== + +.. automodule:: designer.fitting + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.fitting.dwidirs module +------------------------------- + +.. automodule:: designer.fitting.dwidirs + :members: + :undoc-members: + :show-inheritance: + +designer.fitting.dwipy module +----------------------------- + +.. automodule:: designer.fitting.dwipy + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/modules/designer.postprocessing.rst.txt b/docs/_sources/modules/designer.postprocessing.rst.txt new file mode 100644 index 00000000..cc2d642c --- /dev/null +++ b/docs/_sources/modules/designer.postprocessing.rst.txt @@ -0,0 +1,19 @@ +designer.postprocessing package +=============================== + +.. automodule:: designer.postprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.postprocessing.filters module +-------------------------------------- + +.. automodule:: designer.postprocessing.filters + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/modules/designer.preprocessing.rst.txt b/docs/_sources/modules/designer.preprocessing.rst.txt new file mode 100644 index 00000000..ad0c6c0e --- /dev/null +++ b/docs/_sources/modules/designer.preprocessing.rst.txt @@ -0,0 +1,67 @@ +designer.preprocessing package +============================== + +.. automodule:: designer.preprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.preprocessing.mrinfoutil module +---------------------------------------- + +.. automodule:: designer.preprocessing.mrinfoutil + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.mrpreproc module +--------------------------------------- + +.. automodule:: designer.preprocessing.mrpreproc + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.preparation module +----------------------------------------- + +.. automodule:: designer.preprocessing.preparation + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.rician module +------------------------------------ + +.. automodule:: designer.preprocessing.rician + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.smoothing module +--------------------------------------- + +.. automodule:: designer.preprocessing.smoothing + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.snrplot module +------------------------------------- + +.. automodule:: designer.preprocessing.snrplot + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.util module +---------------------------------- + +.. automodule:: designer.preprocessing.util + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/modules/designer.rst.txt b/docs/_sources/modules/designer.rst.txt new file mode 100644 index 00000000..90eef4b8 --- /dev/null +++ b/docs/_sources/modules/designer.rst.txt @@ -0,0 +1,45 @@ +designer package +================ + +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + designer.fitting + designer.postprocessing + designer.preprocessing + designer.system + +Submodules +---------- + +designer module +--------------- + +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: + +designer.info module +-------------------- + +.. automodule:: designer.info + :members: + :undoc-members: + :show-inheritance: + +designer.pydesigner module +-------------------------- + +.. automodule:: designer.pydesigner + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/modules/designer.system.rst.txt b/docs/_sources/modules/designer.system.rst.txt new file mode 100644 index 00000000..a6324415 --- /dev/null +++ b/docs/_sources/modules/designer.system.rst.txt @@ -0,0 +1,19 @@ +designer.system package +======================= + +.. automodule:: designer.system + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.system.systemtools module +---------------------------------- + +.. automodule:: designer.system.systemtools + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/modules/modules.rst.txt b/docs/_sources/modules/modules.rst.txt new file mode 100644 index 00000000..3edfa1a7 --- /dev/null +++ b/docs/_sources/modules/modules.rst.txt @@ -0,0 +1,7 @@ +designer +======== + +.. toctree:: + :maxdepth: 4 + + designer diff --git a/docs/_sources/references/designer_commands/designer.fitting.rst.txt b/docs/_sources/references/designer_commands/designer.fitting.rst.txt new file mode 100644 index 00000000..38787220 --- /dev/null +++ b/docs/_sources/references/designer_commands/designer.fitting.rst.txt @@ -0,0 +1,27 @@ +designer.fitting package +======================== + +.. automodule:: designer.fitting + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.fitting.dwidirs module +------------------------------- + +.. automodule:: designer.fitting.dwidirs + :members: + :undoc-members: + :show-inheritance: + +designer.fitting.dwipy module +----------------------------- + +.. automodule:: designer.fitting.dwipy + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/references/designer_commands/designer.postprocessing.rst.txt b/docs/_sources/references/designer_commands/designer.postprocessing.rst.txt new file mode 100644 index 00000000..cc2d642c --- /dev/null +++ b/docs/_sources/references/designer_commands/designer.postprocessing.rst.txt @@ -0,0 +1,19 @@ +designer.postprocessing package +=============================== + +.. automodule:: designer.postprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.postprocessing.filters module +-------------------------------------- + +.. automodule:: designer.postprocessing.filters + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/references/designer_commands/designer.preprocessing.rst.txt b/docs/_sources/references/designer_commands/designer.preprocessing.rst.txt new file mode 100644 index 00000000..ad0c6c0e --- /dev/null +++ b/docs/_sources/references/designer_commands/designer.preprocessing.rst.txt @@ -0,0 +1,67 @@ +designer.preprocessing package +============================== + +.. automodule:: designer.preprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.preprocessing.mrinfoutil module +---------------------------------------- + +.. automodule:: designer.preprocessing.mrinfoutil + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.mrpreproc module +--------------------------------------- + +.. automodule:: designer.preprocessing.mrpreproc + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.preparation module +----------------------------------------- + +.. automodule:: designer.preprocessing.preparation + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.rician module +------------------------------------ + +.. automodule:: designer.preprocessing.rician + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.smoothing module +--------------------------------------- + +.. automodule:: designer.preprocessing.smoothing + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.snrplot module +------------------------------------- + +.. automodule:: designer.preprocessing.snrplot + :members: + :undoc-members: + :show-inheritance: + +designer.preprocessing.util module +---------------------------------- + +.. automodule:: designer.preprocessing.util + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/references/designer_commands/designer.rst.txt b/docs/_sources/references/designer_commands/designer.rst.txt new file mode 100644 index 00000000..90eef4b8 --- /dev/null +++ b/docs/_sources/references/designer_commands/designer.rst.txt @@ -0,0 +1,45 @@ +designer package +================ + +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + designer.fitting + designer.postprocessing + designer.preprocessing + designer.system + +Submodules +---------- + +designer module +--------------- + +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: + +designer.info module +-------------------- + +.. automodule:: designer.info + :members: + :undoc-members: + :show-inheritance: + +designer.pydesigner module +-------------------------- + +.. automodule:: designer.pydesigner + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/references/designer_commands/designer.system.rst.txt b/docs/_sources/references/designer_commands/designer.system.rst.txt new file mode 100644 index 00000000..a6324415 --- /dev/null +++ b/docs/_sources/references/designer_commands/designer.system.rst.txt @@ -0,0 +1,19 @@ +designer.system package +======================= + +.. automodule:: designer.system + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +designer.system.systemtools module +---------------------------------- + +.. automodule:: designer.system.systemtools + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/_sources/references/designer_commands/modules.rst.txt b/docs/_sources/references/designer_commands/modules.rst.txt new file mode 100644 index 00000000..3edfa1a7 --- /dev/null +++ b/docs/_sources/references/designer_commands/modules.rst.txt @@ -0,0 +1,7 @@ +designer +======== + +.. toctree:: + :maxdepth: 4 + + designer diff --git a/docs/_sources/references/ref_commands.rst.txt b/docs/_sources/references/ref_commands.rst.txt new file mode 100644 index 00000000..3edfa1a7 --- /dev/null +++ b/docs/_sources/references/ref_commands.rst.txt @@ -0,0 +1,7 @@ +designer +======== + +.. toctree:: + :maxdepth: 4 + + designer diff --git a/docs/_sources/references/ref_commands_BAK.rst.txt b/docs/_sources/references/ref_commands_BAK.rst.txt new file mode 100644 index 00000000..d3f77f88 --- /dev/null +++ b/docs/_sources/references/ref_commands_BAK.rst.txt @@ -0,0 +1,8 @@ +List of PyDesigner Commands +=========================== + +Preprocessing +------------- +These functions are reponsible for PyDesigner's preprocessing. + + diff --git a/docs/_static/graphviz.css b/docs/_static/graphviz.css new file mode 100644 index 00000000..8ab69e01 --- /dev/null +++ b/docs/_static/graphviz.css @@ -0,0 +1,19 @@ +/* + * graphviz.css + * ~~~~~~~~~~~~ + * + * Sphinx stylesheet -- graphviz extension. + * + * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +img.graphviz { + border: 0; + max-width: 100%; +} + +object.graphviz { + max-width: 100%; +} diff --git a/docs/api/api.html b/docs/api/api.html new file mode 100644 index 00000000..7684a402 --- /dev/null +++ b/docs/api/api.html @@ -0,0 +1,207 @@ + + + + + + + + + + + API Documentation — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

API Documentation

+

Information on specific functions, classes, and methods.

+
+
+
+ + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.fitting.dwidirs.html b/docs/api/designer.fitting.dwidirs.html new file mode 100644 index 00000000..6b209085 --- /dev/null +++ b/docs/api/designer.fitting.dwidirs.html @@ -0,0 +1,201 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.fitting.dwipy.html b/docs/api/designer.fitting.dwipy.html new file mode 100644 index 00000000..fb12ee3a --- /dev/null +++ b/docs/api/designer.fitting.dwipy.html @@ -0,0 +1,784 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+
+class designer.fitting.dwipy.DWI(imPath, nthreads=-1)
+

Bases: object

+
+
+akccorrect(akc_out, window=3, connectivity='face')
+

Applies AKC outlier map to DT to replace outliers with a +moving median. +Run this only after tensor fitting and akc outlier detection +Classification: Method

+

dwi.akccorrect(akc_out), where dwi is the DWI class object

+

akc_out: 3D map containing outliers from DWI.akcoutliers +window: width of square matrix filter.

+
+

default: 5 +type: int

+
+
+
connectivity: specifies what kind of connected-component

connectivity to use for median determination +choices: ‘all’ (default) or ‘face’ +type: string

+
+
+
+ +
+
+akcoutliers(iter=10)
+

Uses 100,000 direction in chunks of 10 to iteratively find +outliers. Returns a mask of locations where said violations +occur. Multiprocessing is disabled because this is a +memory-intensive task. +To be run only after tensor fitting. +Classification: Method

+

akc_out = dwi.akoutliers(), where dwi is the DWI class object

+
+
iter: number of iterations to perform out of 10. Default: 10

reduce this number if your computer does not have +sufficient RAM

+
+
+
+
akc_out: 3D map containing outliers where AKC falls fails the

inequality test -2 < AKC < 10

+
+
+
+ +
+
+createConstraints(constraints=[0, 1, 0])
+

Generates constraint array for constrained minimization quadratic +programming

+

C = dwi.createConstraints([0, 1, 0])

+

constraints: [1 X 3] logical vector indicating which constraints +out of three to enable

+
+

C1 is Dapp > 0 +C1 is Kapp > 0 +C3 is Kapp < 3/(b*Dapp)

+
+
+
C: array containing constraints to consider during

minimization +C is shaped [number of constraints enforced * +number of directions, 22]

+
+
+
+ +
+
+createTensorOrder(order=None)
+
+
Creates tensor order array and indices

Classification: Method

+

(cnt, ind) = dwi.createTensorOrder(order)

+
+
order: 2 or 4 (int or None)

Tensor order number, 2 for diffusion and 4 for kurtosis. +Default: None; auto-detect

+
+
+

cnt: vector (int) +ind: array (int)

+

The tensors for this pipeline are based on NYU’s designer layout as +depicted in the table below. This will soon be depreciated and +updated with MRTRIX3’s layout. +============================= +——D—— +1 | D11 +2 | D12 +3 | D13 +4 | D22 +5 | D23 +6 | D33 +——K——

+
+
+

1 | W1111 +2 | W1112 +3 | W1113 +4 | W1122 +5 | W1123 +6 | W1133 +7 | W1222 +8 | W1223 +9 | W1233 +10 | W1333 +11 | W2222 +12 | W2223 +13 | W2233 +14 | W2333 +15 | W3333

+
+ +
+
+diffusionCoeff(dt, dir)
+

Computes apparent diffusion coefficient (ADC) +Classification: Method

+

adc = dwi.diffusionCoeff(dt, dir)

+

dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

+

adc: matrix containing apparent diffusion coefficient

+
+ +
+
+dkiTensorParams(v1, dt)
+

Uses average directional statistics to approximate axial +kurtosis(AK) and radial kurtosis (RK) +Classification: Method

+

(rk, ak) = dwi.dkiTensorParams(v1, dt)

+

v1: first eigenvector +dt: diffusion tensor

+

rk: radial kurtosis +ak: axial kurtosis +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor

+
+ +
+
+dtiTensorParams(nn)
+

Computes sorted DTI tensor eigenvalues and eigenvectors +Classification: Method

+

(values, vectors) = dwi.dtiTensorParams(DT)

+

DT: diffusion tensor

+

values: sorted eigenvalues +vectors: sorted eigenvectors

+
+ +
+
+extractDKI()
+

Extract all DKI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

+

(mk, rk, ak, fe, trace) = dwi.extractDTI(), where dwi is the DWI +class object

+

(none)

+

mk: mean diffusivity +rk: radial diffusivity +ak: axial diffusivity +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor +trace: sum of first eigenvalues

+
+ +
+
+extractDTI()
+

Extract all DTI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

+

(md, rd, ad, fa) = dwi.extractDTI(), where dwi is the DWI class +object

+

(none)

+

md: mean diffusivity +rd: radial diffusivity +ad: axial diffusivity +fa: fractional anisotropy +fe: first eigenvectors +trace: sum of first eigenvalues

+
+ +
+
+extractWMTI()
+

Returns white matter tract integrity (WMTI) parameters. Warning: +this can only be run after fitting and DWI.extractDTI().

+

(none)

+

awf: axonal water fraction +eas_ad: extra-axonal space axial diffusivity +eas_rd: extra-axonal space radial diffusivity +eas_tort: extra-axonal space tortuosity +ias_ad: intra-axonal space axial diffusivity +ias_rd: intra-axonal space radial diffusivity +ias_tort: intra-axonal space tortuosity

+
+ +
+
+fibonacciSphere(samples=1, randomize=True)
+

Returns evenly spaced points on a sphere +Classification: Method

+

dirs = dwi.fibonacciSphere(256, True)

+
+
samples: Positive real integer

number of points to compute from sphere

+
+
randomize: True or False (bool)

choose whether sampling is random or not

+
+
+

points: [3 x samples] array containing evenly spaced points +from a sphere

+
+ +
+
+findViols(c=[0, 1, 0])
+

Returns a 3D violation map of voxels that violate constraints. +Classification: Method

+

map = findViols(img, [0 1 0]

+

img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

+
+

c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

+
+
+
map: 3D array containing locations of voxels that incur directional

violations. Voxels with values contain violaions and voxel +values represent proportion of directional violations.

+
+
+
+ +
+
+findVoxelViol(adcVox, akcVox, maxB, c)
+

Returns the proportions of violations occurring at a voxel. +Classification: Method

+

map = findViols(voxel, [0 1 0]

+

img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

+
+

c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

+
+

n: Number ranging from 0 to 1 that indicates proportion of +violations occuring at voxel.

+
+ +
+
+fit(constraints=None, reject=None)
+

Returns fitted diffusion or kurtosis tensor

+

dwi.fit() +dwi.fit(constraints=[0,1,0], reject=irlls_output)

+
+
constraits: [1 x 3] vector (int)

Specifies which constraints to use

+
+
reject: 4D matrix containing information on voxels to exclude

from DT estimation

+
+
+

self.dt: return diffusion tensor within DWI class

+
+ +
+
+getBvals()
+

Returns a vector of b-values, requires no input arguments +Classification: Method

+

bvals = dwi.getBvals(), where dwi is the DWI class object

+
+ +
+
+getBvecs()
+

Returns an array of gradient vectors, requires no input +parameters +Classification: Method

+

bvecs = dwi.getBvecs(), where dwi is the DWI class object

+
+ +
+
+getndirs()
+

Returns the number of gradient directions acquired from scanner

+

n = dwi.getndirs(), where dwi is the DWI class object

+

Retun +n: integer quantifying number of directions

+
+ +
+
+goodDirections(outliers)
+

Creates a 3D maps of good directions from IRLLS outlier map +For any given voxel, a violation is computed using logical or +operant for all b-values. Whether +an outlier occurs at b1000 or b1000 and b2000, that voxel is still +a violation unless none of the b-values have outliers.

+

map = dwi.goodDirections(outliers)

+

outliers: 4D maps of outliers from IRLLS

+

map: 3D maps of number of good directions

+
+ +
+
+irlls(excludeb0=True, maxiter=25, convcrit=0.001, mode='DKI', leverage=0.85, bounds=3)
+

This functions performs outlier detection and robust parameter +estimation for diffusion MRI using the iterative reweigthed +linear least squares (IRLLS) approach. +Classification: Method

+

outliers = dwi.irlls()

+
+
exludeb0: True (default) or False (bool)

Exlude the b0 images when removing outliers?

+
+
maxiter: Integer; default: 25

Maximum number of iterations in the iterative +reweighting loop

+
+
convcrit: Real positive double; default: 1e-3

Fraction of L2-norm of estimated diffusion parameter +vector that the L2-norm of different vector should get +under un order to reach convergence in the iterative +reweighted loop

+
+
mode: ‘DTI’ or ‘DKI’ (string); default: ‘DKI’

Specifies whether to use DTi or DKI model

+
+
leverage: Double ranging from 0 to 1; default: 0.85

Measurements with a leverage above this threshold will +not be excluded in estimation of DT after +outlier detection

+
+
Bounds: Integer; default: 3

Set the threshold of the number of standard deviation +that are needed to exclude a measurement

+
+
+
+
outliers: 4D image same size as input dwi marking voxels

that are outliers

+
+
+

dt: IRLLS method of DT estimation

+
+ +
+
+irllsviolmask(reject)
+

Computes 3D violation mask of outliers detected from IRLLS +method +Classification: Method

+

mask = dwi.irllsviolmask(outliers)

+

reject: 4D input outlier map from IRLLS

+

Returns +propviol: 3D mask where voxel value is the percentage of +directional violations

+
+ +
+
+isdki()
+

Returns logical value to answer the mystical question whether +the input image is DKI

+

ans = dwi.isdki(), where dwi is the DWI class object

+

ans: True or False (bool)

+
+ +
+
+kurtosisCoeff(dt, dir)
+

Computes apparent kurtosis coefficient (AKC) +Classification: Method

+

adc = dwi.kurtosisCoeff(dt, dir)

+

dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

+

adc: matrix containing apparent kurtosis coefficient

+
+ +
+
+maxBval()
+

Returns the maximum b-value in a dataset to determine between +DTI and DKI, requires no input parameters +Classification: Method

+

a = dwi.maxBval(), where dwi is the DWI class object

+
+ +
+
+multiplyMask(img)
+

Multiplies a 3D image by the brain mask

+

img: 3D image to be multiplied

+

multiplied image

+
+ +
+
+parfindViols(c=[0, 0, 0])
+
+ +
+
+radialSampling(dir, n)
+

Get the radial component of a metric from a set of directions +Classification: Method

+

grad = dwi.radiansampling(dir, number_of_dirs)

+

dir: [n x 3] input matrix +n: number of rows, n

+

dirs: Matrix containing radial components

+
+ +
+
+tensorReorder(dwiType)
+

Reorders tensors in DT to those of MRTRIX in accordance to +the table below

+

MRTRIX3 Tensors DESIGNER Tensors +————— —————-

+

0 D0 1 1 1 1 +1 D1 2 2 1 2 +2 D2 3 3 1 3 +3 D3 1 2 2 2 +4 D4 1 3 2 3 +5 D5 2 3 3 3

+

6 K0 1 1 1 1 1 1 1 1 +7 K1 2 2 2 2 1 1 1 2 +8 K2 3 3 3 3 1 1 1 3 +9 K3 1 1 1 2 1 1 2 2 +10 K4 1 1 1 3 1 1 2 3 +11 K5 1 2 2 2 1 1 3 3 +12 K6 1 3 3 3 1 2 2 2 +13 K7 2 2 2 3 1 2 2 3 +14 K8 2 3 3 3 1 2 3 3 +15 K9 1 1 2 2 1 3 3 3 +16 K10 1 1 3 3 2 2 2 2 +17 K11 2 2 3 3 2 2 2 3 +18 K12 1 1 2 3 2 2 3 3 +19 K13 1 2 2 3 2 3 3 3 +20 K14 1 2 3 3 3 3 3 3

+

MRTRIX3 DESIGNER +——- ——–

+
+

0 0 +1 3 +2 5 +3 1 +4 2 +5 4

+

6 6 +7 16 +8 20 +9 7 +10 8 +11 12 +12 15 +13 17 +14 19 +15 9 +16 11 +17 18 +18 10 +19 13 +20 14

+
+

dt = dwi.tensorReorder()

+
+
dwiType: ‘dti’ or ‘dki’ (string)

Indicates whether image is DTI or DKI

+
+
+

DT: 4D image containing DT tensor +KT: 4D image containing KT tensor

+
+ +
+
+tensorType()
+

Returns whether input image is DTI or DKI compatible, requires +no input parameters +Classification: Method

+

a = dwi.tensorType(), where dwi is the DWI class object

+

a: ‘dti’ or ‘dki’ (string)

+
+ +
+
+wlls(shat, dwi, b, cons=None, warmup=None)
+

Estimates diffusion and kurtosis tenor at voxel with +unconstrained Moore-Penrose pseudoinverse or constrained +quadratic convex optimization. This is a helper function for +dwi.fit() so a multiprocessing parallel loop can be iterated over +voxels +Classification: Method

+

For Unconstrained Fitting: +In the absence of constraints, an exact formulation in the form +Cx = b is produced. This is further simplified to x_hat = C^+ * +b. One can use the Moore-Penrose method to compute the +pseudoinverse to approximate diffusion tensors.

+

For Constrained Fitting: +The equation |Cx -b|^2 expands to 0.5*x.T(C.T*A)*x -(C.T*b).T

+
+
+
——- ——

P q

+
+
+
+

where A is denoted by multiplier matrix (w * b) +Multiplying by a positive constant (0.5) does not change the value +of optimum x*. Similarly, the constant offset b.T*b does not +affect x*, therefore we can leave these out.

+
+
Minimize: || C*x -b ||_2^2

subject to A*x <= b +No lower or upper bounds

+
+
+

dt = dwi.wlls(shat, dwi, b, constraints)

+
+
shat: [ndir x 1] vector (float)

S_hat, approximated signal intensity at voxel

+
+
dwi: [ndir x 1] vector (float)

diffusion weighted intensity values at voxel, for all +b-values

+
+
b: [ndir x 1] vector (float)

b-values vector

+
+
cons: [(n * dir) x 22) vector (float)

matrix containing inequality constraints for fitting

+
+
+

warmup: estimate dt vector (22, 0) at each voxel

+

dt: diffusion tensor

+
+ +
+ +
+
+designer.fitting.dwipy.clipImage(img, range)
+

Clips input matrix within desired range. Min and max values are +inclusive of range

+

clippedImage = clipImage(image, [0 3]) +Clips input matrix in the range 0 to 3

+

img: input image matrix +range: [1 x 2] vector specifying range to clip

+

clippedImage: clipped image; same size as img

+
+ +
+
+designer.fitting.dwipy.highprecisionexp(array, maxp=1e+32)
+

Prevents overflow warning with numpy.exp by assigning overflows +to a maxumum precision value +Classification: Function

+

a = highprecisionexp(array)

+

array: array or scalar of number to run np.exp on +maxp: maximum preicison to assign if overflow

+
+

default: 1E32

+
+

exponent or max-precision

+
+ +
+
+designer.fitting.dwipy.vectorize(img, mask)
+

Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

+

vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

+

vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

+
+ +
+
+designer.fitting.dwipy.writeNii(map, hdr, outDir, range=None)
+

Write clipped NifTi images +Classification: Function

+

writeNii(matrix, header, output_directory, [0, 2])

+

map: 3D matrix to write +header: NifTi header file containing NifTi properties +outDir: string

+
+

Output file name

+
+

range: Range to clip images, inclusive of values in range

+

None

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.fitting.html b/docs/api/designer.fitting.html new file mode 100644 index 00000000..1c9daeb2 --- /dev/null +++ b/docs/api/designer.fitting.html @@ -0,0 +1,209 @@ + + + + + + + + + + + designer.fitting package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

designer.fitting package

+
+

Submodules

+
+
+
+
+ + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.html b/docs/api/designer.html new file mode 100644 index 00000000..2f85f27a --- /dev/null +++ b/docs/api/designer.html @@ -0,0 +1,201 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.info.html b/docs/api/designer.info.html new file mode 100644 index 00000000..feb345bc --- /dev/null +++ b/docs/api/designer.info.html @@ -0,0 +1,201 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.postprocessing.filters.html b/docs/api/designer.postprocessing.filters.html new file mode 100644 index 00000000..9a71e5f4 --- /dev/null +++ b/docs/api/designer.postprocessing.filters.html @@ -0,0 +1,233 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

This module contains filter(s) for postprocessing DTI/DKI maps

+
+
+designer.postprocessing.filters.median(input, output, mask=None)
+

Applies median filtering to input nifti file

+

input: path to input nifti file +output: path to output nifti file +mask: path to brainmask nifti file

+
+

default: None

+
+

written to drive

+
+ +
+
+designer.postprocessing.filters.readnii(input)
+

Reads nifti files and returns header and numpy data array

+

input: path to nifti fule

+

img: numpy array +hdr: image header

+
+ +
+
+designer.postprocessing.filters.writenii(hdr, img, output)
+

Write nupy array to nifti file

+

hdr: image header +img: numpy array +output: path to save file as

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.postprocessing.html b/docs/api/designer.postprocessing.html new file mode 100644 index 00000000..d1b14b4b --- /dev/null +++ b/docs/api/designer.postprocessing.html @@ -0,0 +1,209 @@ + + + + + + + + + + + designer.postprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

designer.postprocessing package

+
+

Submodules

+
+
+
+
+ + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.html b/docs/api/designer.preprocessing.html new file mode 100644 index 00000000..de4fff2d --- /dev/null +++ b/docs/api/designer.preprocessing.html @@ -0,0 +1,209 @@ + + + + + + + + + + + designer.preprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

designer.preprocessing package

+
+

Submodules

+
+
+
+
+ + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.mrinfoutil.html b/docs/api/designer.preprocessing.mrinfoutil.html new file mode 100644 index 00000000..a4175e05 --- /dev/null +++ b/docs/api/designer.preprocessing.mrinfoutil.html @@ -0,0 +1,356 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Utilities for extracting information on various input files using +MRtrix3’s mrinfo tool. All values are returned in basic Python data +types.

+
+
+designer.preprocessing.mrinfoutil.commandhistory(path)
+

Returns a list of command history (manipulations or transformations) +performed on MRtrix file format .mif

+
+
path: string

path to input image or directory

+
+
+

List

+
+ +
+
+designer.preprocessing.mrinfoutil.datatype(path)
+

Returns the data type used for image storage

+
+
path: string

path to input image or directory

+
+
+

Str, mrtrix3 datatypes

+
+ +
+
+designer.preprocessing.mrinfoutil.dwscheme(path)
+

Returns a list of diffusion weighting scheme

+
+
path: string

path to input image or directory

+
+
+

List

+
+ +
+
+designer.preprocessing.mrinfoutil.format(path)
+

Returns the file format of DWI at path

+
+
path: string

path to input image or directory

+
+
+

String indicating format

+
+ +
+
+designer.preprocessing.mrinfoutil.getconsole(path, flag)
+

Fetches the console output of mrinfo

+
+
path: string

path to input image or directory

+
+
flag: string

flag to pass onto mrinfo

+
+
+

String, information for flag

+
+ +
+
+designer.preprocessing.mrinfoutil.multiplier(path)
+

Returns the image intensity multiplier

+
+
path: string

path to input image or directory

+
+
+

Float, image intensity multiplier

+
+ +
+
+designer.preprocessing.mrinfoutil.ndim(path)
+

Returns the number of image dimensions

+
+
path: string

path to input image or directory

+
+
+

Int, number of dimensions in image

+
+ +
+
+designer.preprocessing.mrinfoutil.offset(path)
+

Returns the image intensity offset

+
+
path: string

path to input image or directory

+
+
+

Flaot, image intensity offset

+
+ +
+
+designer.preprocessing.mrinfoutil.pescheme(path)
+

Returns a list of phase encoding scheme. If len(pescheme) > 1, +the .mif DWI contains more than one directons

+
+
path: string

path to input image or directory

+
+
+
+
nPE: int

numer of PE directions

+
+
PE: int or int list

Phase encoding direction(s)

+
+
+
+ +
+
+designer.preprocessing.mrinfoutil.size(path)
+

Returns the size of image along each axis

+
+
path: string

path to input image or directory

+
+
+

Int tuple, number of voxels in [X, Y, Z, B-value]

+
+ +
+
+designer.preprocessing.mrinfoutil.spacing(path)
+

Returns the voxel spacing along each image dimension

+
+
path: string

path to input image or directory

+
+
+

Int tuple, number of spacing between voxels [X, Y, Z, B-value]

+
+ +
+
+designer.preprocessing.mrinfoutil.strides(path)
+

Returns data strides

+
+
path: string

path to input image or directory

+
+
+

Int tuple, mrtrix3 strides

+
+ +
+
+designer.preprocessing.mrinfoutil.transform(path)
+

Returns the 4-by-4 voxel to image transformation matrix

+
+
path: string

path to input image or directory

+
+
+

Tuple float list

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.mrpreproc.html b/docs/api/designer.preprocessing.mrpreproc.html new file mode 100644 index 00000000..66610687 --- /dev/null +++ b/docs/api/designer.preprocessing.mrpreproc.html @@ -0,0 +1,356 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Utilities for running various MRtrix3’s DWI preprocessing tools

+
+
+designer.preprocessing.mrpreproc.brainmask(input, output, thresh=0.25, nthreads=None, force=False, verbose=False)
+

Creates a brainmask using FSL’s Brain Extraction Tool (BET) and +MRtrix3’s file manipulation tools.

+

input (str): path to input .mif file +output (str): path to output .nii brainmask file +thresh (flt): BET threshold ranging from 0 to 1 (default: 0.25) +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.degibbs(input, output, nthreads=None, force=False, verbose=False)
+

Runs MRtrix3’s mrdegibbs command with optimal parameters for +PyDesigner.

+

input (str): path to input .mif file

+

output (str): path to output .mif file +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.denoise(input, output, noisemap=True, extent='5, 5, 5', nthreads=None, force=True, verbose=False)
+

Runs MRtrix3’s dwidenoise command with optimal parameters for +PyDesigner.

+

input (str): path to input .mif file

+

output (str): path to output .mif file +noisemap (bool): specify whether or not to save the noisemap as a

+
+

nifti file (default: True)

+
+
+
extent (str): set the window size of the denoising filter.

(default: 5,5,5)

+
+
+

nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.extractbzero(input, output, nthreads=None, force=False, verbose=False)
+

Extracts only bzero shells from an input mif file.

+

input (str): path to input .mif file +output (str): path to output .mif file +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

+

(none) system call

+
+ +
+
+designer.preprocessing.mrpreproc.extractnonbzero(input, output, nthreads=None, force=False, verbose=False)
+

Extracts only non-bzero shells from an input mif file.

+

input (str): path to input .mif file +output (str): path to output .mif file

+

(none) system call

+
+ +
+
+designer.preprocessing.mrpreproc.miftonii(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
+

Converts input .mif images to output .nii images

+

input (str): path to input .mif file +output (str): path to output .nii file +strides (str): specify the strides of the output data in memory

+
+

(default: ‘1,2,3,4’)

+
+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.niitomif(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
+

Converts input .nii images to output .nif images provided that +all BVEC, BVAL and JSON files are provided and named same as input .nii

+

input (str): path to input .nii file +output (str): path to output .mif file +strides (str): specify the strides of the output data in memory

+
+

(default: ‘1,2,3,4’)

+
+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.riciancorrect(input, output, noise=None)
+

Performs Rician correction on input .mif

+

input (str): path to input .mif file +output (str): path to output .mif file +noise (float): path to noise map from dwidenoise in .nii format

+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.smooth(input, output, fwhm=1.25)
+

Performs Gaussian smoothing on input .mif image

+

input (str): path to input .mif file +output (str): path to output .mif file +fwhm (float): full-width half-maximum (FWHM) of smoothing to apply

+

system call: (none)

+
+ +
+
+designer.preprocessing.mrpreproc.topupboost(input, output, idx=None, nthreads=None, force=False, verbose=False)
+

Analyzes an input .mif’s PE direction to split into two different +phase encoding (PE) DWIs. B0s from opposing PE are then extracted +and concatenated with the DWI. This reduces the number of B0s used +in undistortion for a better and speedier estimation of the +distortion field.

+

input (str): path to input .mif file +output (str): path to output .mif file +idx (int): list of B0 indexes to use in topup (default: 0) +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

+

(none) system call

+
+ +
+
+designer.preprocessing.mrpreproc.undistort(input, output, rpe='rpe_header', qc=None, nthreads=None, force=False, verbose=False)
+

Runs MRtrix3’s dwipreproc command with optimal parameters for +PyDesigner.

+

input (str): path to input .mif file

+

output (str): path to output .mif file +rpe (str): reverse phase encoding of the dataset (default:

+
+

rpe_header)

+
+
+
qc (bool): specify whether to generate eddy QC metric (

default: True)

+
+
+

nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

+

system call: (none)

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.preparation.html b/docs/api/designer.preprocessing.preparation.html new file mode 100644 index 00000000..ee43abaf --- /dev/null +++ b/docs/api/designer.preprocessing.preparation.html @@ -0,0 +1,235 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Adds utilities for preparing the data for eddy and analysis

+
+
+designer.preprocessing.preparation.fix_bval(bvalfile)
+

Converts all whitespace into newlines in the file

+
+
bvalfile :obj: str

The .bval to ensure is the correct format for mrtrix

+
+
+

None, overwrites bval

+
+ +
+
+designer.preprocessing.preparation.make_se_epi(filetable)
+

Makes a single spin-echo epi from the topup and the dwi

+
+
filetable :dict:

The filetable that pydesigner.py uses to track files

+
+
+

None, writes file

+
+ +
+
+designer.preprocessing.preparation.make_simple_mif(filetable)
+

Makes a single .mif from the HEAD dwi file

+
+
filetable :dict:

The filetable that pydesigner.py uses to track files

+
+
+

None, writes file

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.rician.html b/docs/api/designer.preprocessing.rician.html new file mode 100644 index 00000000..310cb979 --- /dev/null +++ b/docs/api/designer.preprocessing.rician.html @@ -0,0 +1,236 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+
+designer.preprocessing.rician.rician_correct(dwi, noisemap)
+

Smooths a DWI dataset

+
+
dwi(X x Y x Z x N) img_like object

Image to be corrected, where N is the number of volumes in +the DWI acquisition.

+
+
csfmask(X x Y x Z x N) img_like object

The noise map from dwidenoise

+
+
width:obj: float, optional

The full width half max in voxels to be smoothed. Default: 1.25

+
+
+
+
corrected(X x Y x Z x N) array_like or img_like object

The rician-corrected version of dwi

+
+
+
+ +
+
+designer.preprocessing.rician.rician_img_correct(dwiname, noisemapname, outpath=None)
+

Performs Rician correction on a dataset with a noisemap

+
+
dwiname:obj: string

Filename of image to be corrected

+
+
noisemapname :obj: string

Filename of noisemap to use for correction

+
+
outpath :obj: string

Path to put resulting file

+
+
+

None; writes out file

+

rician_correct(dwi, noise) is wrapped by this function

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.smoothing.html b/docs/api/designer.preprocessing.smoothing.html new file mode 100644 index 00000000..148b15a3 --- /dev/null +++ b/docs/api/designer.preprocessing.smoothing.html @@ -0,0 +1,265 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+
+designer.preprocessing.smoothing.nansmooth(imgslice, fwhm)
+

Smooths an image slice while ignoring NaNs

+
+
imgslice(X x Y) img_like or array_like object

2D image to be smoothed

+
+
fwhm:obj: float

The full width half max to be used for smoothing

+
+
+
+
smoothslice(X x Y) array_like object

2D smoothed image

+
+
+

This is done because a masked dataset will contain NaNs. In typical +operations and filtering, the NaNs will propagate instead of being +ignored (which is the desired behavior). During runtime, divide by 0 +warnings are suppressed due to the high probability of its occuring. +The operation to avoid this is as follows:

+
+ +
+
+designer.preprocessing.smoothing.smooth(dwi, csfmask=None, width=1.25)
+

Smooths a DWI dataset

+
+
dwi(X x Y x Z x N) img_like object

Image to be smoothed, where N is the number of volumes in +the DWI acquisition.

+
+
csfmask(S) img_like object

The mask of CSF that will be applied to each volume in DWI

+
+
width:obj: float, optional

The full width half max in voxels to be smoothed. Default: 1.25

+
+
+
+
smoothed(X x Y x Z x N) array_like or img_like object

The smoothed version of dwi

+
+
+

This is done mainly to reduce the Gibbs ringing. It might be +recommended to only smooth the high SNR (or b-valued) data in order +not to alter the Rice distribution of the low SNR data. This is +important to maintain the high accuracy of WLLS. If a CSF mask is +given as an additional argument, CSF infiltration in microstructural +signal is avoided during smoothing.

+
+ +
+
+designer.preprocessing.smoothing.smooth_image(dwiname, csfname=None, outname='dwism.nii', width=1.2)
+

Smooths a DWI dataset

+
+
dwiname:obj: string

Filename of image to be smoothed

+
+
csfname:obj: string

Filename of CSF mask

+
+
outname:obj: string

Filename to be written out

+
+
width:obj: float

The full width half max in voxels to be smoothed. Default: 1.25

+
+
+

None; writes out file

+

smooth(dwi, csfmask=None, width=1.25) is wrapped by this function

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.snrplot.html b/docs/api/designer.preprocessing.snrplot.html new file mode 100644 index 00000000..a0a19368 --- /dev/null +++ b/docs/api/designer.preprocessing.snrplot.html @@ -0,0 +1,288 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+
+class designer.preprocessing.snrplot.makesnr(dwilist, noisepath=None, maskpath=None)
+

Bases: object

+

Class object that computes and prints SNR plots for any number of +input DWIs

+
+
dwilist: string list

list of 4D DWI (nifti-format) paths to evaluate and plot

+
+
noisepath: string

path to noise map from “dwidenoise”

+
+
maskpath: string (optional)

path to brain mask

+
+
+

__init__: constructs makesnr class +getuniquebval: creates a list of unique B-values for the purpose of

+
+

SNR computation

+
+

computesnr: performs SNR computation +histcount: bins SNR values +makeplot: creates and saves SNR plot from bin counts

+
+
+computesnr()
+

Computes SNR of all DWIs in class object

+

(none)

+

snr_dwi: Numpy array of SNR across all DWI.

+
+ +
+
+getuniquebval()
+

Creates a list of unique B-values for the purpose of SNR +computation. In the calculation of SNR, B0 signal can be averaged +becase they are not associated to any direction. This is not true +for non-B0 values however, because every 3D volume represents a +different direction. To compute SNR appropriately, differences in +gradients have to be accounted. This function creates a list of +B-values in the order they need to appear for the calculation of +SNR.

+

(none)

+
+
b_list: Numpy vector containing list of B-vals to be used in

SNR calculation

+
+
+
+ +
+
+histcount(nbins=100)
+

Bins SNR into nbins and returns various counting properties

+

nbins: int +:return:

+
+ +
+
+makeplot(path, smooth=True, smoothfactor=5)
+

Creates and saves SNR plot to a path as SNR.png

+
+
path: string

directory to save the plot in

+
+
smooth: bool

Specify whether to interpolate and smooth

+
+
smoothfactor: int

smoothing factor to apply

+
+
+

(none): saves plotted image into directory as SNR.png

+
+ +
+ +
+
+designer.preprocessing.snrplot.vectorize(img, mask)
+

Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

+

vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

+

vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.DWIFile.html b/docs/api/designer.preprocessing.util.DWIFile.html new file mode 100644 index 00000000..05108673 --- /dev/null +++ b/docs/api/designer.preprocessing.util.DWIFile.html @@ -0,0 +1,382 @@ + + + + + + + + + + + DWIFile — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

DWIFile

+
+
+class designer.preprocessing.util.DWIFile(name)
+

Bases: object

+

Diffusion data file object, used for handling paths and extensions.

+

Helps interface different extensions, group .bval/.bvec seamlessly to +the programmer. Offers interactive tools to try and locate a file if +it can’t be found. Likely a bit overkill, but reduces uberscript +coding.

+
+
pathstring

The path to the file

+
+
namestring

The base name of the file

+
+
extarray

The valid extensions for this grouping of dwi data

+
+
acquisitionbool

Indicates if a DWI acquisition or not, relevant for .bval/.bvec

+
+
jsonstruct

The contents of the .json metadata if available

+
+
+

Methods Summary

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

getBVAL()

Returns the .bval filename for this DWIFile

getBVEC()

Returns the .bvec filename for this DWIFile

getFull()

Get the path and name combined for thsi dwifile

getJSON()

Returns the .json filename for this DWIFile

getName()

Get the name without the path for this dwifile

getPath()

Get the path without the name for this dwifile

hasJSON()

Checks if this object has a .json file

isAcquisition()

Check if this object is an acquisition

isPartialFourier()

Returns whether the volume is partial fourier encoded

print([json])

+

Methods Documentation

+
+
+getBVAL()
+

Returns the .bval filename for this DWIFile

+
+
string

The full path to the .bval

+
+
+
+ +
+
+getBVEC()
+

Returns the .bvec filename for this DWIFile

+
+
string

The full path to the .bvec

+
+
+
+ +
+
+getFull()
+

Get the path and name combined for thsi dwifile

+
+
string

The full path and filename with extension

+
+
+
+ +
+
+getJSON()
+

Returns the .json filename for this DWIFile

+
+
string

The full path to the .json file

+
+
+
+ +
+
+getName()
+

Get the name without the path for this dwifile

+
+
string

Name of the file without extensions

+
+
+
+ +
+
+getPath()
+

Get the path without the name for this dwifile

+
+
string

The path to this file

+
+
+
+ +
+
+hasJSON()
+

Checks if this object has a .json file

+
+

True if has .json, False if not

+
+
+ +
+
+isAcquisition()
+

Check if this object is an acquisition

+
+
bool

True if acquisition, False if not

+
+
+
+ +
+
+isPartialFourier()
+

Returns whether the volume is partial fourier encoded

+
+
boolean

Whether the encoding is partial fourier or not

+
+
+
+ +
+
+print(json=False)
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.DWIParser.html b/docs/api/designer.preprocessing.util.DWIParser.html new file mode 100644 index 00000000..982727ba --- /dev/null +++ b/docs/api/designer.preprocessing.util.DWIParser.html @@ -0,0 +1,305 @@ + + + + + + + + + + + DWIParser — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

DWIParser

+
+
+class designer.preprocessing.util.DWIParser(path)
+

Bases: object

+

Parses a list of DWIs and concatenates them into a single 4D NifTi +with appropriate BVEC, BVALS.

+
+
DWIlistlist of strings

Contains paths to all input series

+
+
DWInlist: list of strings

Contains path to file names without extension

+
+
DWIext: list of strings

Contains extension of input files

+
+
BVALlist: list of strings

Contains paths to all BVAL files

+
+
BVEClist: list of strings

Contains paths to all BVEC files

+
+
JSONlist: list of strings

Contains paths to all JSON files

+
+
nDWI: int

Number of DWIs entered

+
+
+

Methods Summary

+ ++++ + + + + + + + + + + + +

cat(path[, ext, verbose, force, resume])

Concatenates all input series when nDWI > 1 into a 4D NifTi along with a appropriate BVAL, BVEC and JSON files.

getPath()

Returns directory where first file in DWI list is stored

json2fslgrad(path)

Creates FSL .bvec and .bval for series missing that information.

+

Methods Documentation

+
+
+cat(path, ext='.nii', verbose=False, force=False, resume=False)
+

Concatenates all input series when nDWI > 1 into a 4D NifTi +along with a appropriate BVAL, BVEC and JSON files. +Concatenation of series via MRTRIX3 requires every NifTi file to +come with BVAL/BVEC to produce a .json with dw_scheme.

+
+
path: string

Directory where to store concatenated series

+
+
ext: string

Extenstion to save concatenated file in. Refer to MRTRIX3’s +mrconvert function for a list of possible extensions

+
+
verbose: bool

Displays MRTRIX3’s console output

+
+
force: bool

Forces file overwrite if they already exist

+
+
+
+ +
+
+getPath()
+

Returns directory where first file in DWI list is stored

+
+ +
+
+json2fslgrad(path)
+

Creates FSL .bvec and .bval for series missing that information. +Some datasets have their B0s separately that do not produce fsl +gradients upon conversion to NifTi. This function creates those +missing features for complete concatenation from .json file. Use +with caution if and only if you know your input series is a DWI.

+
+
path: string

Path to NifTi file

+
+
+
+ +
+ +
+ + +
+ +
+
+ + + + +
+ +
+

+ © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.bvec_is_fullsphere.html b/docs/api/designer.preprocessing.util.bvec_is_fullsphere.html new file mode 100644 index 00000000..7af5d315 --- /dev/null +++ b/docs/api/designer.preprocessing.util.bvec_is_fullsphere.html @@ -0,0 +1,236 @@ + + + + + + + + + + + bvec_is_fullsphere — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

bvec_is_fullsphere

+
+
+designer.preprocessing.util.bvec_is_fullsphere(bvec)
+

Determines if .bvec file is full or half-sphere

+
+
bvecstring

The filename of the bvec

+
+
+

True if full-sphere, False if half

+
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.find_valid_ext.html b/docs/api/designer.preprocessing.util.find_valid_ext.html new file mode 100644 index 00000000..00354046 --- /dev/null +++ b/docs/api/designer.preprocessing.util.find_valid_ext.html @@ -0,0 +1,239 @@ + + + + + + + + + + + find_valid_ext — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

find_valid_ext

+
+
+designer.preprocessing.util.find_valid_ext(pathname)
+

Finds valid extensions for dwifile, helper function

+
+
pathnamestring

The name to try and find extensions for

+
+
+
+
array

Array of valid file extensions for the basename

+
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.html b/docs/api/designer.preprocessing.util.html new file mode 100644 index 00000000..42922fb7 --- /dev/null +++ b/docs/api/designer.preprocessing.util.html @@ -0,0 +1,423 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Adds utilities for the command-line interface

+
+
+class designer.preprocessing.util.DWIFile(name)
+

Bases: object

+

Diffusion data file object, used for handling paths and extensions.

+

Helps interface different extensions, group .bval/.bvec seamlessly to +the programmer. Offers interactive tools to try and locate a file if +it can’t be found. Likely a bit overkill, but reduces uberscript +coding.

+
+
pathstring

The path to the file

+
+
namestring

The base name of the file

+
+
extarray

The valid extensions for this grouping of dwi data

+
+
acquisitionbool

Indicates if a DWI acquisition or not, relevant for .bval/.bvec

+
+
jsonstruct

The contents of the .json metadata if available

+
+
+
+
+getBVAL()
+

Returns the .bval filename for this DWIFile

+
+
string

The full path to the .bval

+
+
+
+ +
+
+getBVEC()
+

Returns the .bvec filename for this DWIFile

+
+
string

The full path to the .bvec

+
+
+
+ +
+
+getFull()
+

Get the path and name combined for thsi dwifile

+
+
string

The full path and filename with extension

+
+
+
+ +
+
+getJSON()
+

Returns the .json filename for this DWIFile

+
+
string

The full path to the .json file

+
+
+
+ +
+
+getName()
+

Get the name without the path for this dwifile

+
+
string

Name of the file without extensions

+
+
+
+ +
+
+getPath()
+

Get the path without the name for this dwifile

+
+
string

The path to this file

+
+
+
+ +
+
+hasJSON()
+

Checks if this object has a .json file

+
+

True if has .json, False if not

+
+
+ +
+
+isAcquisition()
+

Check if this object is an acquisition

+
+
bool

True if acquisition, False if not

+
+
+
+ +
+
+isPartialFourier()
+

Returns whether the volume is partial fourier encoded

+
+
boolean

Whether the encoding is partial fourier or not

+
+
+
+ +
+
+print(json=False)
+
+ +
+ +
+
+class designer.preprocessing.util.DWIParser(path)
+

Bases: object

+

Parses a list of DWIs and concatenates them into a single 4D NifTi +with appropriate BVEC, BVALS.

+
+
DWIlistlist of strings

Contains paths to all input series

+
+
DWInlist: list of strings

Contains path to file names without extension

+
+
DWIext: list of strings

Contains extension of input files

+
+
BVALlist: list of strings

Contains paths to all BVAL files

+
+
BVEClist: list of strings

Contains paths to all BVEC files

+
+
JSONlist: list of strings

Contains paths to all JSON files

+
+
nDWI: int

Number of DWIs entered

+
+
+
+
+cat(path, ext='.nii', verbose=False, force=False, resume=False)
+

Concatenates all input series when nDWI > 1 into a 4D NifTi +along with a appropriate BVAL, BVEC and JSON files. +Concatenation of series via MRTRIX3 requires every NifTi file to +come with BVAL/BVEC to produce a .json with dw_scheme.

+
+
path: string

Directory where to store concatenated series

+
+
ext: string

Extenstion to save concatenated file in. Refer to MRTRIX3’s +mrconvert function for a list of possible extensions

+
+
verbose: bool

Displays MRTRIX3’s console output

+
+
force: bool

Forces file overwrite if they already exist

+
+
+
+ +
+
+getPath()
+

Returns directory where first file in DWI list is stored

+
+ +
+
+json2fslgrad(path)
+

Creates FSL .bvec and .bval for series missing that information. +Some datasets have their B0s separately that do not produce fsl +gradients upon conversion to NifTi. This function creates those +missing features for complete concatenation from .json file. Use +with caution if and only if you know your input series is a DWI.

+
+
path: string

Path to NifTi file

+
+
+
+ +
+ +
+
+designer.preprocessing.util.bvec_is_fullsphere(bvec)
+

Determines if .bvec file is full or half-sphere

+
+
bvecstring

The filename of the bvec

+
+
+

True if full-sphere, False if half

+
+ +
+
+designer.preprocessing.util.find_valid_ext(pathname)
+

Finds valid extensions for dwifile, helper function

+
+
pathnamestring

The name to try and find extensions for

+
+
+
+
array

Array of valid file extensions for the basename

+
+
+
+ +
+
+designer.preprocessing.util.vecs_are_fullsphere(bvecs)
+

Determines if input vectors are full or half-sphere

+
+
bvecsndarray

Matrix of size [n_vectors x 3]

+
+
+

True if full-sphere, False if half

+

Adapted from Chris Rorden’s nii_preprocess as seen here: +https://github.com/neurolabusc/nii_preprocess/blob/dd1c84f23f8828923dd5fc493a22156b7006a3d4/nii_preprocess.m#L1786-L1824 +and reproduced from the original designer pipeline here: +https://github.com/m-ama/PyDesigner/blob/7a39ec4cb9679f1c3e9ead68baa8f8c111b0618a/designer/designer.py#L347-L368

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.preprocessing.util.vecs_are_fullsphere.html b/docs/api/designer.preprocessing.util.vecs_are_fullsphere.html new file mode 100644 index 00000000..bcd8f214 --- /dev/null +++ b/docs/api/designer.preprocessing.util.vecs_are_fullsphere.html @@ -0,0 +1,240 @@ + + + + + + + + + + + vecs_are_fullsphere — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

vecs_are_fullsphere

+
+
+designer.preprocessing.util.vecs_are_fullsphere(bvecs)
+

Determines if input vectors are full or half-sphere

+
+
bvecsndarray

Matrix of size [n_vectors x 3]

+
+
+

True if full-sphere, False if half

+

Adapted from Chris Rorden’s nii_preprocess as seen here: +https://github.com/neurolabusc/nii_preprocess/blob/dd1c84f23f8828923dd5fc493a22156b7006a3d4/nii_preprocess.m#L1786-L1824 +and reproduced from the original designer pipeline here: +https://github.com/m-ama/PyDesigner/blob/7a39ec4cb9679f1c3e9ead68baa8f8c111b0618a/designer/designer.py#L347-L368

+
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.pydesigner.html b/docs/api/designer.pydesigner.html new file mode 100644 index 00000000..1eb8c39d --- /dev/null +++ b/docs/api/designer.pydesigner.html @@ -0,0 +1,207 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +

Runs the PyDesigner pipeline

+
+
+designer.pydesigner.main()
+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.system.html b/docs/api/designer.system.html new file mode 100644 index 00000000..3f1ade38 --- /dev/null +++ b/docs/api/designer.system.html @@ -0,0 +1,209 @@ + + + + + + + + + + + designer.system package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

designer.system package

+
+

Submodules

+
+
+
+
+ + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/designer.system.systemtools.html b/docs/api/designer.system.systemtools.html new file mode 100644 index 00000000..5dd719a4 --- /dev/null +++ b/docs/api/designer.system.systemtools.html @@ -0,0 +1,236 @@ + + + + + + + + + + + <no title> — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+
+designer.system.systemtools.isAMD()
+

Inquires whether CPU is manufactured by AMD

+

(none)

+
+
ans: bool

True if AMD; False otherwise

+
+
+
+ +
+
+designer.system.systemtools.isIntel()
+

Inquires whether CPU is manufactured by Intel

+

(none)

+
+
ans: bool

True if Intel; False otherwise

+
+
+
+ +
+
+designer.system.systemtools.setenv(envlist)
+

Sets system variables while a Python for the execution of a Python +script

+
+
envlist: string list

List containing environment variables to set. Each entry in +the list is a [(ENV_VARIABLE, ENV_VAL)]

+
+
+

(none) sets system variable

+
+ + + +
+ +
+
+ + +
+ +
+

+ © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/docker/docker_configuration.html b/docs/docker/docker_configuration.html new file mode 100644 index 00000000..9c35d601 --- /dev/null +++ b/docs/docker/docker_configuration.html @@ -0,0 +1,378 @@ + + + + + + + + + + + Docker Configuration — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Docker Configuration

+

Docker can be configured in a wide-varietry of ways based on hardware +resources available. Parameters such as CPU cores, RAM and storage can +be assigned to Docker for running NeuroDock.

+

For validations purposes, the NeuroDock image was tested to work as +intended on the following three systems:

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Part

Machine A

Machine B

Machine C

Build

Apple iMac Pro

Custom

Custom

OS

Mac OS X Mojave

Ubuntu 18.04

Microsoft Windows 10 Pro

CPU

Intel Xeon W [8C/16T]

AMD Ryzen R9 2700X [8C/16T]

AMD Ryzen R9 2700X [8C/16T]

Memory

64 GB

16 GB

16 GB

Video

Raden Pro Vega 56 8 GB

Nvidia GTX 1080 8 GB

Nvidia GTX 1080 8 GB

+

We found identical results across the three operating systes on all +these configurations.

+
+

Docker Preferences

+

Based on Docker’s system requirements, we recommend assigning the +following sysem resources to Docker:

+ ++++ + + + + + + + + + + + + + + + + +

Parameter

Value

CPUs

8

Memory

16.00 GB

Disk image size

32.00 GB

+

By default, Docker assigns itself half the number of available +CPU cores and 2 GB of memory. Considering that the entire NeuroDock +image is ~14.5 GB, we recommend at least double in disk image size. +You may configure your Docker Engine to run on this configuration, or +input your own values based on your processing needs. The following +sections detail how to set these parameters.

+
+

Linux

+

CPU and memory access to Docker containers on Linux machines is +manipulated via CFGS scheduler flags at run time. These flags are:

+ ++++ + + + + + + + + + + + + + +

Flag

Description

--cpus=<value>

specify how many CPU cores to use

-m or --memory

specify the maximum amount of memory available to containers

+

For a more comprehensive list of manupulable system parameters for +for Linux, please visit the Runtime options with Memory, CPUs, and GPUs +page on Docker documentation.

+
+
+

Mac OS

+

Manipulating these three variables is very simple on Mac OS because +these parameters are located in the GUI.

+

1. On the Docker icon in the status bar, right-click on the Docker +icon, then Preferences.

+
    +
  1. Click on the Resources tab on the left

  2. +
+
+images/Docker_Mac_resources.png +

Docker Mac preferences GUI; click on resources

+
+

3. The Resourcs menu will show you the configuration, please +change them to desired valus. You may leave “Swap” at default.

+
+images/Docker_Mac_configs.png +

Docker Mac resources configuration

+
+
+
+

Windows

+

Similar to the Mac, the same sequence of steps apply for the Windows +platform.

+

1. Right-click on the Dpcker icon in the taskbar, then click on +Preferences.

+
    +
  1. Clock on the Resources tab on the left.

  2. +
+
+images/Docker_Win_configs.png +

Docker Windows preferences GUI; configure as desired

+
+

3. The Resourcs menu will show you the configuration, please +change them to desired valus. You may leave “Swap” at default.

+

Setting the correct configuration will force Docker to not exceed +these constraints. By splitting up CPU and memory loads, researchers +can process multiple DWIs simultaneously.

+
+
+
+

GPU Support

+

At this time, there is no CUDA or ROCm GPU support. These feature are +planned for a later release. Please use the non-Docker, native Linux +configuration to utilize GPU for eddy and EPI correction.

+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/docker/docker_install.html b/docs/docker/docker_install.html new file mode 100644 index 00000000..92b68194 --- /dev/null +++ b/docs/docker/docker_install.html @@ -0,0 +1,389 @@ + + + + + + + + + + + Docker Installation — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Docker Installation

+

Docker is relatively straightforward to install and run. +Windows and Mac users are able to install Docker like any other +GUI-based software package installtion. The installation is not +dependent on console arguments, like Linux.

+

Please efer to the instructions below for links and guide.

+
+

Linux

+

Users may refer to the Docker Engine installation guide located +here, for installation instructions on their Linux disribution. the +steps covered below are targeted for Debian-based or Ubuntu +distributions.

+
+

Uninstall Docker

+

1. Uninstall older version or any traces of existing Docker +installations

+
$ sudo apt-get remove docker docker-engine docker.io containerd runc
+
+
+

Don’t panic if apt-get returns an a warning about missing +packages. It’s good they are missing, since we’re trying to purge +existing installations of Docker

+
+
+

Install Docker Engine

+

Once all taces of existing Docker installation and dependencies have +been purged, you may proceed with the following steps to install the +Docker Engine - Community.

+
    +
  1. Update the debian package list with:

  2. +
+
$ sudo apt-get Update
+
+
+

2. Install basic packages that enable installation of Docker Engine +and its dependencies with:

+
$ sudo apt-get install \
+    apt-transport-https \
+    ca-certificates \
+    curl \
+    gnupg-agent \
+    software-properties-common
+
+
+

3. Add the Docker official GNU Privacy Guard (GPG) key to enable +encryption and decryption of communication with the Docker server:

+
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+
+
+

You may verify this key by following the full guide on official Docker +documentation, the link to which is located at the beginning of this +page.

+

4. Add the stable Docker Engine repository to your package list with +the command:

+
$ sudo add-apt-repository \
+    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
+    $(lsb_release -cs) \
+    stable"
+
+
+

Adding a repository to your Linux distribution allows the OS to pull +software packages from the developers’ servers. It directs the OS to +the location where these packages are stored.

+

Then, update your package manager repository with the command:

+
$ sudo apt-get update
+
+
+

This updates the list of softwares your OS can fetch from various +repositories.

+

5. Once your Debian-based system becomes aware of the Docker Engine, +you may install it simply via the command:

+
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
+
+
+
    +
  1. Verify your Docker Engine installation with the command:

  2. +
+
$ sudo docker run hello-world
+
+
+

If the following information prints in the console window, your Docker +Engine installation was sucessful.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
Hello from Docker!
+This message shows that your installation appears to be working correctly.
+
+To generate this message, Docker took the following steps:
+    1. The Docker client contacted the Docker daemon.
+    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
+       (amd64)
+    3. The Docker daemon created a new container from that image which runs the
+       executable that produces the output you are currently reading.
+    4. The Docker daemon streamed that output to the Docker client, which sent it
+       to your terminal.
+
+To try something more ambitious, you can run an Ubuntu container with:
+"$ docker run -it ubuntu bash"
+
+Share images, automate workflows, and more with a free Docker ID:
+ https://hub.docker.com/
+
+For more examples and ideas, visit:
+https://docs.docker.com/get-started/
+
+
+

You may now proceed with the fetching of NeuroDock Docker image.

+
+
+
+

Mac OS

+
    +
  1. Download Docker Docker Desktop for Mac.

  2. +
+

2. Double-click on the downloaded Docker.dmg to start the install +process. Follw all on-screen instrcutions and prompts.

+

3. Docker should start automatically, indicated by the whale icon in +the status bar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in Terminal:

+
$ docker version
+
+
+

Or you may run the hello-world container to verify the installation:

+
$ docker run hello-world
+
+
+

If you information text being printed into the PowerShell windows, +then Docker has been installed successfully.

+
+
+

Windows

+
    +
  1. Download Docker Desktop for Windows.

  2. +
+

2. Double-click the Docker for Windows Installer to run the +installer.

+

3. Docker should start automatically, indicated by the whale icon in +the taskbar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in PowerShell.

+
$ docker version
+
+
+

Or you may run the hello-world container to verify the installation:

+
$ docker run hello-world
+
+
+

If you information text being printed into the PowerShell windows, +then Docker has been installed successfully.

+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/docker/docker_neurodock.html b/docs/docker/docker_neurodock.html new file mode 100644 index 00000000..ae3bfd3c --- /dev/null +++ b/docs/docker/docker_neurodock.html @@ -0,0 +1,275 @@ + + + + + + + + + + + Install NeuroDock — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Install NeuroDock

+

Aftet successfully installing and configuring docker, you can install +the NeuroDock container in one of two ways:

+
    +
  1. Pulling pre-build image from Docker Hub with docker pull [image]

  2. +
  3. Building the image yourself with docker build [path to image]

  4. +
+

The first option is the recommended method because prebuilt images are +guaranteed to work and enhance repatibility even further. In additon, +they are numbered version-controlled for referencing. Your copy +of NeuroDock will be configured exactly the same other another +person’s.

+

The second option is intended for devopers who make frequent changes +to the PyDesigner source code and wish to test their changes in a +Docker environment. The Dockerfile script is designed to build a +Docker image using PyDesigner in the root directory of the repository.

+
+

Docker Hub

+

Pulling pre-built NeuroDock is incredibly straight forward. Run the +following command to pull NeuroDock.

+
$ docker pull docker pull dmri/neurodock:tagname
+
+
+

where tagname is the version you’d like to pull. To install +NeuroDock v0.2, you would run the command

+
$ docker pull dmri/neurodock:v0.2
+
+
+

And that’s it! All you have to do now is to wait for the NeuroDock +image to finish downloading.

+
+
+

Local Build

+
+
Disclaimer

It must be reiterated that this option is preserved for developoers; +regular users are encoruaged to stay away from this method because +there is no sematic versioning to referece.

+
+
+

1. Open up a command line interface and change directory to your +PyDesigner repository

+
$ cd [PyDesginer Repo Path]
+
+
+

2. To build a Docker image using your local PyDesigner copy, run the +command:

+
$ docker build -t [tagname] .
+
+
+

Here, tagname can be any name you wish to give this image. If +you wish to build an image called neurodock, run the command:

+
$ docker build -t neurodock .
+
+
+

This will build a Docker image called NeuroDock based on your local +Pyesigner repository.

+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/docker/docker_neurodock_run.html b/docs/docker/docker_neurodock_run.html new file mode 100644 index 00000000..27e2b3ef --- /dev/null +++ b/docs/docker/docker_neurodock_run.html @@ -0,0 +1,343 @@ + + + + + + + + + + + Run NeuroDock — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

Run NeuroDock

+

Congratulations, you’ve come this far. You’ve installed Docker and +NeuroDock, and are probably wondering how what else to do…

+

You’re done. Not even kidding! You can now start processing data +with PyDesigner and NeuroDock. It’s almost as if FSL, MRtrix3 and +PyDesigner commands are built natively into your OS - be it Linux, +Mac OS, or even Windows!

+
+

Intro to Docker Run

+

Use the following form of docker run command to call all +command made availble by NeuroDock:

+
$ docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
+
+
+

where,

+ ++++ + + + + + + + + + + + + + + + + + + + +

Flag

Definition

[OPTIONS]

docker options to use when running the container; common options are -it, -v, -d

IMAGE

image name to run; in this instance, this is dmri/neurodock

[COMMAND]

specify which NeuroDock commands to run; these can be FSL, MRtrix3 or PyDesigner commands

[ARG]

arguments for [COMMAND]

+

Users are encouraged to visit the Docker run reference documentation +for more information on controlling the :code:`docker run ` command.

+
+
+

Practical Run

+

The section above convered a generic way to use the docker run +command. For actual data analysis, we use the following options.

+

1. -it --rm to run docker in interative TTY mode. What this +implies is that your NeuroDock command will run like any other OS +commands such as ipconfig, watch, ls etc.

+
    +
  1. -v to mount the file system or folder to processing

  2. +
+
+

Bind Mount

+

The second flag. -v, makes visible the host’s local filesystem +to a Docker container, which otherwise runs in a completely isolated +system. By mounting a folder for NeuroDock, you are able to make it +process data in said folder. The general guideline is to mount one +subject folder at a time. It is advisable that users read through +Docker’s bind mounts to understand how Docker containers handle +storage.

+

The correct syntax for the -v flag is:

+
-v [HOST PATH TO MOUNT]:[v]
+
+
+

Suppose a subject folder bond_007 in need of processing is +structured the following way:

+
+
bond_007
+
+
├── nifti
+
│ ├── bond_dwi.bval
+
│ ├── bond_dwi.bvec
+
│ ├── bond_dwi.bval
+
│ ├── bond_dwi.json
+
│ ├── bond_topup.json
+
│ └── bond_topup.nii
+
+
└── processed (empty dir)
+
+

This subject needs to be processed PyDesigner read the input nifti +files in the nifti directory, and saves the outputs in the +processed directory. Since both nifti and +processed folders belong to a common parent directory, the +bond_007 directory can be mounted to give NeurDock access to +both child directories simultaneously.

+

Here, the directory bond_007 is the [HOST PATH TO MOUNT], +the directory that NeuroDock will not be able to see.

+

Next, we need to define where within the container this directory is +mounted, [TARGET AT WHICH TO MOUNT]. You may simply mount this +in the root NeuroDock directory at /data.

+

The flag to reflect this would then be:

+
-v /Users/sid/Desktop/bond_007:/data
+
+
+

This would make the contents of host directory bond_007 +available in the NeuroDock at \data. Say, for example, the +nifti file bond_dwi.nii, is located in the host system at +/Users/sid/Desktop/bond_007/nifti/bond_dwi.nii. If the above +mounting scheme is used, the NeuroDock container will see this file in +/data/nifti/bond_dwi.nii

+

This filesystem transformation is particularly important when writing +scripts for automatic or batch processing of subject directories using +the NeuroDock container.

+
+
+

Put it all together

+

Considering everything on this page, it becomes incredibly easy to +process a subject using the NeuoDock container. Sticking to +bond_007 example above, and combining everthing so far, one +could process Mr. Bond’s DWI with the command:

+
$ docker run -it --rm -v /Users/sid/Desktop/bond_007:/data \
+    dmri/neurodock pydesigner --standard \
+    --output /data/processed \
+    /data/nifti/bond_dwi.nii,/data/nifti/bond_topup.nii
+
+
+

This command runs the --standard PyDesigner pipeline on +the input files /Users/sid/Desktop/bond_007/nifti/bond_dwi.nii +and /Users/sid/Desktop/bond_007/nifti/bond_topup.nii, and +saves all outputs into the directory Users/sid/Desktop/bond_007/processed

+
+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/docker/images/Docker_Mac_configs.png b/docs/docker/images/Docker_Mac_configs.png new file mode 100644 index 00000000..b96eb22b Binary files /dev/null and b/docs/docker/images/Docker_Mac_configs.png differ diff --git a/docs/docker/images/Docker_Mac_resources.png b/docs/docker/images/Docker_Mac_resources.png new file mode 100644 index 00000000..eaf9c967 Binary files /dev/null and b/docs/docker/images/Docker_Mac_resources.png differ diff --git a/docs/docker/images/Docker_Win_configs.png b/docs/docker/images/Docker_Win_configs.png new file mode 100644 index 00000000..1b234bf0 Binary files /dev/null and b/docs/docker/images/Docker_Win_configs.png differ diff --git a/docs/docker/images/Docker_Win_resources.png b/docs/docker/images/Docker_Win_resources.png new file mode 100644 index 00000000..232d519f Binary files /dev/null and b/docs/docker/images/Docker_Win_resources.png differ diff --git a/docs/docker/images/MUSC_TAG_00447c.png b/docs/docker/images/MUSC_TAG_00447c.png new file mode 100644 index 00000000..ca7e1b9d Binary files /dev/null and b/docs/docker/images/MUSC_TAG_00447c.png differ diff --git a/docs/docker/images/NeuroDock_Logo.png b/docs/docker/images/NeuroDock_Logo.png new file mode 100644 index 00000000..4a2609b7 Binary files /dev/null and b/docs/docker/images/NeuroDock_Logo.png differ diff --git a/docs/docker/introduction.html b/docs/docker/introduction.html new file mode 100644 index 00000000..82e6a838 --- /dev/null +++ b/docs/docker/introduction.html @@ -0,0 +1,261 @@ + + + + + + + + + + + NeuroDock — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

NeuroDock

+

Docker is a contaner technology desgned to package an application and +all its needs, such as libraried and other dependencies, into one +package. We adapted PyDesigner and its dependencies for compatibility +with the Docker Engine to bring DTI/DKI analyses to every one.

+

We bring you, NeuroDock

+images/NeuroDock_Logo.png +images/MUSC_TAG_00447c.png +

NeuroDock is a Docker image containing the most cutting-edge tools +required for diffusion and kurtosis imaging. This container was +designer for complete dMRI processing pipelines to be platform +agnostic. NeuroDock was inspired by the lack of easily-accessible +tools across various platforms. NeuroDock is 100% compatible across +Windows, Linux, and Mac - while making available the full suite of +FSL, MRtrix3 and PyDesigner commands.

+
+

Why Docker

+

By packaging fixed versions of FSL, MRtrix3, and PyDesigner, we are +able to guarantee repeatbility and concistency across all platforms. +Regardless of whether researchers are running Linux, Windows, or Mac +OS, identical results can be replicated with Docker technology.

+

A side-effect to ensuring repeatiblity with Docker is that it becomes +host operating system (OS) agnostic. This allows users to run FSL, +MRtrix3, or PyDesigner commands at near-native speed, even on +Microsoft Windows.

+

Additionally, researchers can easily deploy Docker containers to HPCs +for rapid processing of large-cohort or longitudinal studies with +ease.

+
+
+

Docker vs Virtual Machines

+

Okay, so you may ask, “why not just load up a VM?”. You have a point. +While the two technologies appear to be behaving the same way, at +least on the surface level, their inner mechanisms are differ vastly.

+

Unlike a VM, rather than creating a whole virtual OS loaded with +dependencies and other applications, Docker allows applications to +share the same OS kernel, thereby providing a significant performance +uplift while saving up storage space. With the removal of an entire +guest OS in VMs, Docker containers save tons of computational +resources that can be diverted towards better performance.

+

Now that you know some differences, it is time to move on to preparing +the Docker image!

+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/doctrees/api/api.doctree b/docs/doctrees/api/api.doctree new file mode 100644 index 00000000..de30aca1 Binary files /dev/null and b/docs/doctrees/api/api.doctree differ diff --git a/docs/doctrees/api/designer.doctree b/docs/doctrees/api/designer.doctree new file mode 100644 index 00000000..789d5df9 Binary files /dev/null and b/docs/doctrees/api/designer.doctree differ diff --git a/docs/doctrees/api/designer.fitting.doctree b/docs/doctrees/api/designer.fitting.doctree new file mode 100644 index 00000000..939fd2cd Binary files /dev/null and b/docs/doctrees/api/designer.fitting.doctree differ diff --git a/docs/doctrees/api/designer.fitting.dwidirs.doctree b/docs/doctrees/api/designer.fitting.dwidirs.doctree new file mode 100644 index 00000000..a0b7eef0 Binary files /dev/null and b/docs/doctrees/api/designer.fitting.dwidirs.doctree differ diff --git a/docs/doctrees/api/designer.fitting.dwipy.doctree b/docs/doctrees/api/designer.fitting.dwipy.doctree new file mode 100644 index 00000000..8a0809e0 Binary files /dev/null and b/docs/doctrees/api/designer.fitting.dwipy.doctree differ diff --git a/docs/doctrees/api/designer.info.doctree b/docs/doctrees/api/designer.info.doctree new file mode 100644 index 00000000..da248aab Binary files /dev/null and b/docs/doctrees/api/designer.info.doctree differ diff --git a/docs/doctrees/api/designer.postprocessing.doctree b/docs/doctrees/api/designer.postprocessing.doctree new file mode 100644 index 00000000..9cdc615c Binary files /dev/null and b/docs/doctrees/api/designer.postprocessing.doctree differ diff --git a/docs/doctrees/api/designer.postprocessing.filters.doctree b/docs/doctrees/api/designer.postprocessing.filters.doctree new file mode 100644 index 00000000..6d241304 Binary files /dev/null and b/docs/doctrees/api/designer.postprocessing.filters.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.doctree b/docs/doctrees/api/designer.preprocessing.doctree new file mode 100644 index 00000000..b68fe0f0 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.mrinfoutil.doctree b/docs/doctrees/api/designer.preprocessing.mrinfoutil.doctree new file mode 100644 index 00000000..0b573094 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.mrinfoutil.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.mrpreproc.doctree b/docs/doctrees/api/designer.preprocessing.mrpreproc.doctree new file mode 100644 index 00000000..5cada04a Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.mrpreproc.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.preparation.doctree b/docs/doctrees/api/designer.preprocessing.preparation.doctree new file mode 100644 index 00000000..8423cd3f Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.preparation.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.rician.doctree b/docs/doctrees/api/designer.preprocessing.rician.doctree new file mode 100644 index 00000000..387edcde Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.rician.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.smoothing.doctree b/docs/doctrees/api/designer.preprocessing.smoothing.doctree new file mode 100644 index 00000000..da81d457 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.smoothing.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.snrplot.doctree b/docs/doctrees/api/designer.preprocessing.snrplot.doctree new file mode 100644 index 00000000..7d2982a9 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.snrplot.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.DWIFile.doctree b/docs/doctrees/api/designer.preprocessing.util.DWIFile.doctree new file mode 100644 index 00000000..3970aab0 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.DWIFile.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.DWIParser.doctree b/docs/doctrees/api/designer.preprocessing.util.DWIParser.doctree new file mode 100644 index 00000000..40b0e160 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.DWIParser.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.bvec_is_fullsphere.doctree b/docs/doctrees/api/designer.preprocessing.util.bvec_is_fullsphere.doctree new file mode 100644 index 00000000..3710a9fd Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.bvec_is_fullsphere.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.doctree b/docs/doctrees/api/designer.preprocessing.util.doctree new file mode 100644 index 00000000..0b118fa5 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.find_valid_ext.doctree b/docs/doctrees/api/designer.preprocessing.util.find_valid_ext.doctree new file mode 100644 index 00000000..9b9678ed Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.find_valid_ext.doctree differ diff --git a/docs/doctrees/api/designer.preprocessing.util.vecs_are_fullsphere.doctree b/docs/doctrees/api/designer.preprocessing.util.vecs_are_fullsphere.doctree new file mode 100644 index 00000000..0b1d5429 Binary files /dev/null and b/docs/doctrees/api/designer.preprocessing.util.vecs_are_fullsphere.doctree differ diff --git a/docs/doctrees/api/designer.pydesigner.doctree b/docs/doctrees/api/designer.pydesigner.doctree new file mode 100644 index 00000000..71487ff5 Binary files /dev/null and b/docs/doctrees/api/designer.pydesigner.doctree differ diff --git a/docs/doctrees/api/designer.system.doctree b/docs/doctrees/api/designer.system.doctree new file mode 100644 index 00000000..f8aa6d43 Binary files /dev/null and b/docs/doctrees/api/designer.system.doctree differ diff --git a/docs/doctrees/api/designer.system.systemtools.doctree b/docs/doctrees/api/designer.system.systemtools.doctree new file mode 100644 index 00000000..ec0ee218 Binary files /dev/null and b/docs/doctrees/api/designer.system.systemtools.doctree differ diff --git a/docs/doctrees/docker/docker_configuration.doctree b/docs/doctrees/docker/docker_configuration.doctree new file mode 100644 index 00000000..3fa84dc4 Binary files /dev/null and b/docs/doctrees/docker/docker_configuration.doctree differ diff --git a/docs/doctrees/docker/docker_install.doctree b/docs/doctrees/docker/docker_install.doctree new file mode 100644 index 00000000..a0b01256 Binary files /dev/null and b/docs/doctrees/docker/docker_install.doctree differ diff --git a/docs/doctrees/docker/docker_neurodock.doctree b/docs/doctrees/docker/docker_neurodock.doctree new file mode 100644 index 00000000..d1d2d92e Binary files /dev/null and b/docs/doctrees/docker/docker_neurodock.doctree differ diff --git a/docs/doctrees/docker/docker_neurodock_run.doctree b/docs/doctrees/docker/docker_neurodock_run.doctree new file mode 100644 index 00000000..13bac7c0 Binary files /dev/null and b/docs/doctrees/docker/docker_neurodock_run.doctree differ diff --git a/docs/doctrees/docker/introduction.doctree b/docs/doctrees/docker/introduction.doctree new file mode 100644 index 00000000..4f71f613 Binary files /dev/null and b/docs/doctrees/docker/introduction.doctree differ diff --git a/docs/doctrees/environment.pickle b/docs/doctrees/environment.pickle index 75e2fa1e..ae892c19 100644 Binary files a/docs/doctrees/environment.pickle and b/docs/doctrees/environment.pickle differ diff --git a/docs/doctrees/index.doctree b/docs/doctrees/index.doctree index 3795fddf..52b3c28c 100644 Binary files a/docs/doctrees/index.doctree and b/docs/doctrees/index.doctree differ diff --git a/docs/doctrees/installation/fsl.doctree b/docs/doctrees/installation/fsl.doctree index 3bbf0d2c..b0cb1412 100644 Binary files a/docs/doctrees/installation/fsl.doctree and b/docs/doctrees/installation/fsl.doctree differ diff --git a/docs/doctrees/installation/pydesigner.doctree b/docs/doctrees/installation/pydesigner.doctree index 0afefa56..6a856622 100644 Binary files a/docs/doctrees/installation/pydesigner.doctree and b/docs/doctrees/installation/pydesigner.doctree differ diff --git a/docs/doctrees/installation/python.doctree b/docs/doctrees/installation/python.doctree index b2e06a42..44cf383a 100644 Binary files a/docs/doctrees/installation/python.doctree and b/docs/doctrees/installation/python.doctree differ diff --git a/docs/doctrees/modules/designer.doctree b/docs/doctrees/modules/designer.doctree new file mode 100644 index 00000000..a383f345 Binary files /dev/null and b/docs/doctrees/modules/designer.doctree differ diff --git a/docs/doctrees/modules/designer.fitting.doctree b/docs/doctrees/modules/designer.fitting.doctree new file mode 100644 index 00000000..4f79eae1 Binary files /dev/null and b/docs/doctrees/modules/designer.fitting.doctree differ diff --git a/docs/doctrees/modules/designer.postprocessing.doctree b/docs/doctrees/modules/designer.postprocessing.doctree new file mode 100644 index 00000000..0d07d57e Binary files /dev/null and b/docs/doctrees/modules/designer.postprocessing.doctree differ diff --git a/docs/doctrees/modules/designer.preprocessing.doctree b/docs/doctrees/modules/designer.preprocessing.doctree new file mode 100644 index 00000000..e46e9af9 Binary files /dev/null and b/docs/doctrees/modules/designer.preprocessing.doctree differ diff --git a/docs/doctrees/modules/designer.system.doctree b/docs/doctrees/modules/designer.system.doctree new file mode 100644 index 00000000..6643c6f4 Binary files /dev/null and b/docs/doctrees/modules/designer.system.doctree differ diff --git a/docs/doctrees/modules/modules.doctree b/docs/doctrees/modules/modules.doctree new file mode 100644 index 00000000..9be52b3b Binary files /dev/null and b/docs/doctrees/modules/modules.doctree differ diff --git a/docs/doctrees/references/designer_commands/designer.doctree b/docs/doctrees/references/designer_commands/designer.doctree new file mode 100644 index 00000000..8fba73b1 Binary files /dev/null and b/docs/doctrees/references/designer_commands/designer.doctree differ diff --git a/docs/doctrees/references/designer_commands/designer.fitting.doctree b/docs/doctrees/references/designer_commands/designer.fitting.doctree new file mode 100644 index 00000000..c073b8dd Binary files /dev/null and b/docs/doctrees/references/designer_commands/designer.fitting.doctree differ diff --git a/docs/doctrees/references/designer_commands/designer.postprocessing.doctree b/docs/doctrees/references/designer_commands/designer.postprocessing.doctree new file mode 100644 index 00000000..d5d19d37 Binary files /dev/null and b/docs/doctrees/references/designer_commands/designer.postprocessing.doctree differ diff --git a/docs/doctrees/references/designer_commands/designer.preprocessing.doctree b/docs/doctrees/references/designer_commands/designer.preprocessing.doctree new file mode 100644 index 00000000..24ad33f8 Binary files /dev/null and b/docs/doctrees/references/designer_commands/designer.preprocessing.doctree differ diff --git a/docs/doctrees/references/designer_commands/designer.system.doctree b/docs/doctrees/references/designer_commands/designer.system.doctree new file mode 100644 index 00000000..570e8dcd Binary files /dev/null and b/docs/doctrees/references/designer_commands/designer.system.doctree differ diff --git a/docs/doctrees/references/designer_commands/modules.doctree b/docs/doctrees/references/designer_commands/modules.doctree new file mode 100644 index 00000000..ded7d4df Binary files /dev/null and b/docs/doctrees/references/designer_commands/modules.doctree differ diff --git a/docs/doctrees/references/ref_commands.doctree b/docs/doctrees/references/ref_commands.doctree new file mode 100644 index 00000000..3e0aaa89 Binary files /dev/null and b/docs/doctrees/references/ref_commands.doctree differ diff --git a/docs/doctrees/references/ref_commands_BAK.doctree b/docs/doctrees/references/ref_commands_BAK.doctree new file mode 100644 index 00000000..cdbeec2d Binary files /dev/null and b/docs/doctrees/references/ref_commands_BAK.doctree differ diff --git a/docs/genindex.html b/docs/genindex.html index cc9d6dd3..d01a323c 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -87,6 +87,14 @@
  • Python
  • PyDesigner
  • +

    NeuroDock (Docker)

    + @@ -152,8 +160,425 @@

    Index

    + A + | B + | C + | D + | E + | F + | G + | H + | I + | J + | K + | M + | N + | O + | P + | R + | S + | T + | U + | V + | W
    +

    A

    + + + +
    + +

    B

    + + + +
    + +

    C

    + + + +
    + +

    D

    + + + +
    + +

    E

    + + + +
    + +

    F

    + + + +
    + +

    G

    + + + +
    + +

    H

    + + + +
    + +

    I

    + + + +
    + +

    J

    + + +
    + +

    K

    + + +
    + +

    M

    + + + +
    + +

    N

    + + + +
    + +

    O

    + + +
    + +

    P

    + + + +
    + +

    R

    + + + +
    + +

    S

    + + + +
    + +

    T

    + + + +
    + +

    U

    + + +
    + +

    V

    + + + +
    + +

    W

    + + + +
    + @@ -166,7 +591,7 @@

    Index

    - © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + © Copyright 2020, MUSC Advanced MRI Analysis (MAMA)

    diff --git a/docs/index.html b/docs/index.html index d75381f5..65960994 100644 --- a/docs/index.html +++ b/docs/index.html @@ -87,6 +87,14 @@
  • Python
  • PyDesigner
  • +

    NeuroDock (Docker)

    + @@ -181,6 +189,21 @@

    Welcome to the official PyDesigner documentationIssues page of this project’s GitHub repository. Additionally, you may join the M-AMA Slack channel for live support.

    +
    +
    System Requirements

    Parallel processing in PyDesigner scales almost linearly with the +nummber of CPU cores present. The application is also memory-intensive +due to the number of parameter maps being computed.

    +

    Based on this evaluation, for processing a single DWI using +PyDesigner, we recommend the following minimum system specifications:

    +
      +
    • Ubuntu 18.04

    • +
    • Intel i7-9700 or AMD Ryzen 1800X [8 cores]

    • +
    • 16 GB RAM

    • +
    • 12 GB free storage

    • +
    • Nvidia CUDA-enabled GPU

    • +
    +
    +

    Installation

      @@ -191,6 +214,26 @@

      Welcome to the official PyDesigner documentationPyDesigner

    + +
    +
    + ++++ + + +
    diff --git a/docs/installation/fsl.html b/docs/installation/fsl.html index 55acf995..83431d9a 100644 --- a/docs/installation/fsl.html +++ b/docs/installation/fsl.html @@ -88,6 +88,14 @@
  • Python
  • PyDesigner
  • +

    NeuroDock (Docker)

    + @@ -160,7 +168,7 @@

    FSL

    To check your FSL version:

    -
    diff --git a/docs/installation/pydesigner.html b/docs/installation/pydesigner.html index 7ec8c3d8..43b12a35 100644 --- a/docs/installation/pydesigner.html +++ b/docs/installation/pydesigner.html @@ -35,6 +35,7 @@ + @@ -91,6 +92,14 @@ +

    NeuroDock (Docker)

    +
    @@ -163,7 +172,7 @@

    DownloadPyDesigner repository for the latest build, or download the build version of your choice from the Releases tab.

    To clone the PyDesigner repository, in terminal, run:

    -
    git clone https://github.com/m-ama/PyDesigner.git
    +
    $ git clone https://github.com/m-ama/PyDesigner.git
     
    @@ -172,7 +181,7 @@

    Install diff --git a/docs/installation/python.html b/docs/installation/python.html index 4f724dcd..09a42ad3 100644 --- a/docs/installation/python.html +++ b/docs/installation/python.html @@ -93,6 +93,14 @@
  • PyDesigner
  • +

    NeuroDock (Docker)

    + @@ -176,7 +184,7 @@

    Download and Insall

    Update Conda

    First, update conda with

    -
    conda update conda
    +
    $ conda update conda
     
    @@ -191,8 +199,8 @@

    Create new environment

    Next, execute the following two line to create a Python environment ready for PyD installation.

    -
    diff --git a/docs/modules/designer.fitting.html b/docs/modules/designer.fitting.html new file mode 100644 index 00000000..7e572e5d --- /dev/null +++ b/docs/modules/designer.fitting.html @@ -0,0 +1,831 @@ + + + + + + + + + + + designer.fitting package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.fitting package

    +
    +

    Submodules

    +
    +
    +

    designer.fitting.dwidirs module

    +
    +
    +

    designer.fitting.dwipy module

    +
    +
    +class designer.fitting.dwipy.DWI(imPath, nthreads=-1)
    +

    Bases: object

    +
    +
    +akccorrect(akc_out, window=3, connectivity='face')
    +

    Applies AKC outlier map to DT to replace outliers with a +moving median. +Run this only after tensor fitting and akc outlier detection +Classification: Method

    +

    dwi.akccorrect(akc_out), where dwi is the DWI class object

    +

    akc_out: 3D map containing outliers from DWI.akcoutliers +window: width of square matrix filter.

    +
    +

    default: 5 +type: int

    +
    +
    +
    connectivity: specifies what kind of connected-component

    connectivity to use for median determination +choices: ‘all’ (default) or ‘face’ +type: string

    +
    +
    +
    + +
    +
    +akcoutliers(iter=10)
    +

    Uses 100,000 direction in chunks of 10 to iteratively find +outliers. Returns a mask of locations where said violations +occur. Multiprocessing is disabled because this is a +memory-intensive task. +To be run only after tensor fitting. +Classification: Method

    +

    akc_out = dwi.akoutliers(), where dwi is the DWI class object

    +
    +
    iter: number of iterations to perform out of 10. Default: 10

    reduce this number if your computer does not have +sufficient RAM

    +
    +
    +
    +
    akc_out: 3D map containing outliers where AKC falls fails the

    inequality test -2 < AKC < 10

    +
    +
    +
    + +
    +
    +createConstraints(constraints=[0, 1, 0])
    +

    Generates constraint array for constrained minimization quadratic +programming

    +

    C = dwi.createConstraints([0, 1, 0])

    +

    constraints: [1 X 3] logical vector indicating which constraints +out of three to enable

    +
    +

    C1 is Dapp > 0 +C1 is Kapp > 0 +C3 is Kapp < 3/(b*Dapp)

    +
    +
    +
    C: array containing constraints to consider during

    minimization +C is shaped [number of constraints enforced * +number of directions, 22]

    +
    +
    +
    + +
    +
    +createTensorOrder(order=None)
    +
    +
    Creates tensor order array and indices

    Classification: Method

    +

    (cnt, ind) = dwi.createTensorOrder(order)

    +
    +
    order: 2 or 4 (int or None)

    Tensor order number, 2 for diffusion and 4 for kurtosis. +Default: None; auto-detect

    +
    +
    +

    cnt: vector (int) +ind: array (int)

    +

    The tensors for this pipeline are based on NYU’s designer layout as +depicted in the table below. This will soon be depreciated and +updated with MRTRIX3’s layout. +============================= +——D—— +1 | D11 +2 | D12 +3 | D13 +4 | D22 +5 | D23 +6 | D33 +——K——

    +
    +
    +

    1 | W1111 +2 | W1112 +3 | W1113 +4 | W1122 +5 | W1123 +6 | W1133 +7 | W1222 +8 | W1223 +9 | W1233 +10 | W1333 +11 | W2222 +12 | W2223 +13 | W2233 +14 | W2333 +15 | W3333

    +
    + +
    +
    +diffusionCoeff(dt, dir)
    +

    Computes apparent diffusion coefficient (ADC) +Classification: Method

    +

    adc = dwi.diffusionCoeff(dt, dir)

    +

    dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

    +

    adc: matrix containing apparent diffusion coefficient

    +
    + +
    +
    +dkiTensorParams(v1, dt)
    +

    Uses average directional statistics to approximate axial +kurtosis(AK) and radial kurtosis (RK) +Classification: Method

    +

    (rk, ak) = dwi.dkiTensorParams(v1, dt)

    +

    v1: first eigenvector +dt: diffusion tensor

    +

    rk: radial kurtosis +ak: axial kurtosis +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor

    +
    + +
    +
    +dtiTensorParams(nn)
    +

    Computes sorted DTI tensor eigenvalues and eigenvectors +Classification: Method

    +

    (values, vectors) = dwi.dtiTensorParams(DT)

    +

    DT: diffusion tensor

    +

    values: sorted eigenvalues +vectors: sorted eigenvectors

    +
    + +
    +
    +extractDKI()
    +

    Extract all DKI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

    +

    (mk, rk, ak, fe, trace) = dwi.extractDTI(), where dwi is the DWI +class object

    +

    (none)

    +

    mk: mean diffusivity +rk: radial diffusivity +ak: axial diffusivity +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor +trace: sum of first eigenvalues

    +
    + +
    +
    +extractDTI()
    +

    Extract all DTI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

    +

    (md, rd, ad, fa) = dwi.extractDTI(), where dwi is the DWI class +object

    +

    (none)

    +

    md: mean diffusivity +rd: radial diffusivity +ad: axial diffusivity +fa: fractional anisotropy +fe: first eigenvectors +trace: sum of first eigenvalues

    +
    + +
    +
    +extractWMTI()
    +

    Returns white matter tract integrity (WMTI) parameters. Warning: +this can only be run after fitting and DWI.extractDTI().

    +

    (none)

    +

    awf: axonal water fraction +eas_ad: extra-axonal space axial diffusivity +eas_rd: extra-axonal space radial diffusivity +eas_tort: extra-axonal space tortuosity +ias_ad: intra-axonal space axial diffusivity +ias_rd: intra-axonal space radial diffusivity +ias_tort: intra-axonal space tortuosity

    +
    + +
    +
    +fibonacciSphere(samples=1, randomize=True)
    +

    Returns evenly spaced points on a sphere +Classification: Method

    +

    dirs = dwi.fibonacciSphere(256, True)

    +
    +
    samples: Positive real integer

    number of points to compute from sphere

    +
    +
    randomize: True or False (bool)

    choose whether sampling is random or not

    +
    +
    +

    points: [3 x samples] array containing evenly spaced points +from a sphere

    +
    + +
    +
    +findViols(c=[0, 1, 0])
    +

    Returns a 3D violation map of voxels that violate constraints. +Classification: Method

    +

    map = findViols(img, [0 1 0]

    +

    img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

    +
    +

    c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

    +
    +
    +
    map: 3D array containing locations of voxels that incur directional

    violations. Voxels with values contain violaions and voxel +values represent proportion of directional violations.

    +
    +
    +
    + +
    +
    +findVoxelViol(adcVox, akcVox, maxB, c)
    +

    Returns the proportions of violations occurring at a voxel. +Classification: Method

    +

    map = findViols(voxel, [0 1 0]

    +

    img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

    +
    +

    c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

    +
    +

    n: Number ranging from 0 to 1 that indicates proportion of +violations occuring at voxel.

    +
    + +
    +
    +fit(constraints=None, reject=None)
    +

    Returns fitted diffusion or kurtosis tensor

    +

    dwi.fit() +dwi.fit(constraints=[0,1,0], reject=irlls_output)

    +
    +
    constraits: [1 x 3] vector (int)

    Specifies which constraints to use

    +
    +
    reject: 4D matrix containing information on voxels to exclude

    from DT estimation

    +
    +
    +

    self.dt: return diffusion tensor within DWI class

    +
    + +
    +
    +getBvals()
    +

    Returns a vector of b-values, requires no input arguments +Classification: Method

    +

    bvals = dwi.getBvals(), where dwi is the DWI class object

    +
    + +
    +
    +getBvecs()
    +

    Returns an array of gradient vectors, requires no input +parameters +Classification: Method

    +

    bvecs = dwi.getBvecs(), where dwi is the DWI class object

    +
    + +
    +
    +getndirs()
    +

    Returns the number of gradient directions acquired from scanner

    +

    n = dwi.getndirs(), where dwi is the DWI class object

    +

    Retun +n: integer quantifying number of directions

    +
    + +
    +
    +goodDirections(outliers)
    +

    Creates a 3D maps of good directions from IRLLS outlier map +For any given voxel, a violation is computed using logical or +operant for all b-values. Whether +an outlier occurs at b1000 or b1000 and b2000, that voxel is still +a violation unless none of the b-values have outliers.

    +

    map = dwi.goodDirections(outliers)

    +

    outliers: 4D maps of outliers from IRLLS

    +

    map: 3D maps of number of good directions

    +
    + +
    +
    +irlls(excludeb0=True, maxiter=25, convcrit=0.001, mode='DKI', leverage=0.85, bounds=3)
    +

    This functions performs outlier detection and robust parameter +estimation for diffusion MRI using the iterative reweigthed +linear least squares (IRLLS) approach. +Classification: Method

    +

    outliers = dwi.irlls()

    +
    +
    exludeb0: True (default) or False (bool)

    Exlude the b0 images when removing outliers?

    +
    +
    maxiter: Integer; default: 25

    Maximum number of iterations in the iterative +reweighting loop

    +
    +
    convcrit: Real positive double; default: 1e-3

    Fraction of L2-norm of estimated diffusion parameter +vector that the L2-norm of different vector should get +under un order to reach convergence in the iterative +reweighted loop

    +
    +
    mode: ‘DTI’ or ‘DKI’ (string); default: ‘DKI’

    Specifies whether to use DTi or DKI model

    +
    +
    leverage: Double ranging from 0 to 1; default: 0.85

    Measurements with a leverage above this threshold will +not be excluded in estimation of DT after +outlier detection

    +
    +
    Bounds: Integer; default: 3

    Set the threshold of the number of standard deviation +that are needed to exclude a measurement

    +
    +
    +
    +
    outliers: 4D image same size as input dwi marking voxels

    that are outliers

    +
    +
    +

    dt: IRLLS method of DT estimation

    +
    + +
    +
    +irllsviolmask(reject)
    +

    Computes 3D violation mask of outliers detected from IRLLS +method +Classification: Method

    +

    mask = dwi.irllsviolmask(outliers)

    +

    reject: 4D input outlier map from IRLLS

    +

    Returns +propviol: 3D mask where voxel value is the percentage of +directional violations

    +
    + +
    +
    +isdki()
    +

    Returns logical value to answer the mystical question whether +the input image is DKI

    +

    ans = dwi.isdki(), where dwi is the DWI class object

    +

    ans: True or False (bool)

    +
    + +
    +
    +kurtosisCoeff(dt, dir)
    +

    Computes apparent kurtosis coefficient (AKC) +Classification: Method

    +

    adc = dwi.kurtosisCoeff(dt, dir)

    +

    dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

    +

    adc: matrix containing apparent kurtosis coefficient

    +
    + +
    +
    +maxBval()
    +

    Returns the maximum b-value in a dataset to determine between +DTI and DKI, requires no input parameters +Classification: Method

    +

    a = dwi.maxBval(), where dwi is the DWI class object

    +
    + +
    +
    +multiplyMask(img)
    +

    Multiplies a 3D image by the brain mask

    +

    img: 3D image to be multiplied

    +

    multiplied image

    +
    + +
    +
    +parfindViols(c=[0, 0, 0])
    +
    + +
    +
    +radialSampling(dir, n)
    +

    Get the radial component of a metric from a set of directions +Classification: Method

    +

    grad = dwi.radiansampling(dir, number_of_dirs)

    +

    dir: [n x 3] input matrix +n: number of rows, n

    +

    dirs: Matrix containing radial components

    +
    + +
    +
    +tensorReorder(dwiType)
    +

    Reorders tensors in DT to those of MRTRIX in accordance to +the table below

    +

    MRTRIX3 Tensors DESIGNER Tensors +————— —————-

    +

    0 D0 1 1 1 1 +1 D1 2 2 1 2 +2 D2 3 3 1 3 +3 D3 1 2 2 2 +4 D4 1 3 2 3 +5 D5 2 3 3 3

    +

    6 K0 1 1 1 1 1 1 1 1 +7 K1 2 2 2 2 1 1 1 2 +8 K2 3 3 3 3 1 1 1 3 +9 K3 1 1 1 2 1 1 2 2 +10 K4 1 1 1 3 1 1 2 3 +11 K5 1 2 2 2 1 1 3 3 +12 K6 1 3 3 3 1 2 2 2 +13 K7 2 2 2 3 1 2 2 3 +14 K8 2 3 3 3 1 2 3 3 +15 K9 1 1 2 2 1 3 3 3 +16 K10 1 1 3 3 2 2 2 2 +17 K11 2 2 3 3 2 2 2 3 +18 K12 1 1 2 3 2 2 3 3 +19 K13 1 2 2 3 2 3 3 3 +20 K14 1 2 3 3 3 3 3 3

    +

    MRTRIX3 DESIGNER +——- ——–

    +
    +

    0 0 +1 3 +2 5 +3 1 +4 2 +5 4

    +

    6 6 +7 16 +8 20 +9 7 +10 8 +11 12 +12 15 +13 17 +14 19 +15 9 +16 11 +17 18 +18 10 +19 13 +20 14

    +
    +

    dt = dwi.tensorReorder()

    +
    +
    dwiType: ‘dti’ or ‘dki’ (string)

    Indicates whether image is DTI or DKI

    +
    +
    +

    DT: 4D image containing DT tensor +KT: 4D image containing KT tensor

    +
    + +
    +
    +tensorType()
    +

    Returns whether input image is DTI or DKI compatible, requires +no input parameters +Classification: Method

    +

    a = dwi.tensorType(), where dwi is the DWI class object

    +

    a: ‘dti’ or ‘dki’ (string)

    +
    + +
    +
    +wlls(shat, dwi, b, cons=None, warmup=None)
    +

    Estimates diffusion and kurtosis tenor at voxel with +unconstrained Moore-Penrose pseudoinverse or constrained +quadratic convex optimization. This is a helper function for +dwi.fit() so a multiprocessing parallel loop can be iterated over +voxels +Classification: Method

    +

    For Unconstrained Fitting: +In the absence of constraints, an exact formulation in the form +Cx = b is produced. This is further simplified to x_hat = C^+ * +b. One can use the Moore-Penrose method to compute the +pseudoinverse to approximate diffusion tensors.

    +

    For Constrained Fitting: +The equation |Cx -b|^2 expands to 0.5*x.T(C.T*A)*x -(C.T*b).T

    +
    +
    +
    ——- ——

    P q

    +
    +
    +
    +

    where A is denoted by multiplier matrix (w * b) +Multiplying by a positive constant (0.5) does not change the value +of optimum x*. Similarly, the constant offset b.T*b does not +affect x*, therefore we can leave these out.

    +
    +
    Minimize: || C*x -b ||_2^2

    subject to A*x <= b +No lower or upper bounds

    +
    +
    +

    dt = dwi.wlls(shat, dwi, b, constraints)

    +
    +
    shat: [ndir x 1] vector (float)

    S_hat, approximated signal intensity at voxel

    +
    +
    dwi: [ndir x 1] vector (float)

    diffusion weighted intensity values at voxel, for all +b-values

    +
    +
    b: [ndir x 1] vector (float)

    b-values vector

    +
    +
    cons: [(n * dir) x 22) vector (float)

    matrix containing inequality constraints for fitting

    +
    +
    +

    warmup: estimate dt vector (22, 0) at each voxel

    +

    dt: diffusion tensor

    +
    + +
    + +
    +
    +designer.fitting.dwipy.clipImage(img, range)
    +

    Clips input matrix within desired range. Min and max values are +inclusive of range

    +

    clippedImage = clipImage(image, [0 3]) +Clips input matrix in the range 0 to 3

    +

    img: input image matrix +range: [1 x 2] vector specifying range to clip

    +

    clippedImage: clipped image; same size as img

    +
    + +
    +
    +designer.fitting.dwipy.highprecisionexp(array, maxp=1e+32)
    +

    Prevents overflow warning with numpy.exp by assigning overflows +to a maxumum precision value +Classification: Function

    +

    a = highprecisionexp(array)

    +

    array: array or scalar of number to run np.exp on +maxp: maximum preicison to assign if overflow

    +
    +

    default: 1E32

    +
    +

    exponent or max-precision

    +
    + +
    +
    +designer.fitting.dwipy.vectorize(img, mask)
    +

    Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

    +

    vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

    +

    vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

    +
    + +
    +
    +designer.fitting.dwipy.writeNii(map, hdr, outDir, range=None)
    +

    Write clipped NifTi images +Classification: Function

    +

    writeNii(matrix, header, output_directory, [0, 2])

    +

    map: 3D matrix to write +header: NifTi header file containing NifTi properties +outDir: string

    +
    +

    Output file name

    +
    +

    range: Range to clip images, inclusive of values in range

    +

    None

    +
    + +
    +
    + + +
    + +
    + + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules/designer.html b/docs/modules/designer.html new file mode 100644 index 00000000..d0765bdb --- /dev/null +++ b/docs/modules/designer.html @@ -0,0 +1,289 @@ + + + + + + + + + + + designer package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules/designer.postprocessing.html b/docs/modules/designer.postprocessing.html new file mode 100644 index 00000000..bc181b9d --- /dev/null +++ b/docs/modules/designer.postprocessing.html @@ -0,0 +1,277 @@ + + + + + + + + + + + designer.postprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.postprocessing package

    +
    +

    Submodules

    +
    +
    +

    designer.postprocessing.filters module

    +

    This module contains filter(s) for postprocessing DTI/DKI maps

    +
    +
    +designer.postprocessing.filters.median(input, output, mask=None)
    +

    Applies median filtering to input nifti file

    +

    input: path to input nifti file +output: path to output nifti file +mask: path to brainmask nifti file

    +
    +

    default: None

    +
    +

    written to drive

    +
    + +
    +
    +designer.postprocessing.filters.readnii(input)
    +

    Reads nifti files and returns header and numpy data array

    +

    input: path to nifti fule

    +

    img: numpy array +hdr: image header

    +
    + +
    +
    +designer.postprocessing.filters.writenii(hdr, img, output)
    +

    Write nupy array to nifti file

    +

    hdr: image header +img: numpy array +output: path to save file as

    +
    + +
    +
    + + +
    + +
    + + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules/designer.preprocessing.html b/docs/modules/designer.preprocessing.html new file mode 100644 index 00000000..11370ec2 --- /dev/null +++ b/docs/modules/designer.preprocessing.html @@ -0,0 +1,1015 @@ + + + + + + + + + + + designer.preprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.preprocessing package

    +
    +

    Submodules

    +
    +
    +

    designer.preprocessing.mrinfoutil module

    +

    Utilities for extracting information on various input files using +MRtrix3’s mrinfo tool. All values are returned in basic Python data +types.

    +
    +
    +designer.preprocessing.mrinfoutil.commandhistory(path)
    +

    Returns a list of command history (manipulations or transformations) +performed on MRtrix file format .mif

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    List

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.datatype(path)
    +

    Returns the data type used for image storage

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Str, mrtrix3 datatypes

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.dwscheme(path)
    +

    Returns a list of diffusion weighting scheme

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    List

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.format(path)
    +

    Returns the file format of DWI at path

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    String indicating format

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.getconsole(path, flag)
    +

    Fetches the console output of mrinfo

    +
    +
    path: string

    path to input image or directory

    +
    +
    flag: string

    flag to pass onto mrinfo

    +
    +
    +

    String, information for flag

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.multiplier(path)
    +

    Returns the image intensity multiplier

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Float, image intensity multiplier

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.ndim(path)
    +

    Returns the number of image dimensions

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int, number of dimensions in image

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.offset(path)
    +

    Returns the image intensity offset

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Flaot, image intensity offset

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.pescheme(path)
    +

    Returns a list of phase encoding scheme. If len(pescheme) > 1, +the .mif DWI contains more than one directons

    +
    +
    path: string

    path to input image or directory

    +
    +
    +
    +
    nPE: int

    numer of PE directions

    +
    +
    PE: int or int list

    Phase encoding direction(s)

    +
    +
    +
    + +
    +
    +designer.preprocessing.mrinfoutil.size(path)
    +

    Returns the size of image along each axis

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, number of voxels in [X, Y, Z, B-value]

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.spacing(path)
    +

    Returns the voxel spacing along each image dimension

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, number of spacing between voxels [X, Y, Z, B-value]

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.strides(path)
    +

    Returns data strides

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, mrtrix3 strides

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.transform(path)
    +

    Returns the 4-by-4 voxel to image transformation matrix

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Tuple float list

    +
    + +
    +
    +

    designer.preprocessing.mrpreproc module

    +

    Utilities for running various MRtrix3’s DWI preprocessing tools

    +
    +
    +designer.preprocessing.mrpreproc.brainmask(input, output, thresh=0.25, nthreads=None, force=False, verbose=False)
    +

    Creates a brainmask using FSL’s Brain Extraction Tool (BET) and +MRtrix3’s file manipulation tools.

    +

    input (str): path to input .mif file +output (str): path to output .nii brainmask file +thresh (flt): BET threshold ranging from 0 to 1 (default: 0.25) +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.degibbs(input, output, nthreads=None, force=False, verbose=False)
    +

    Runs MRtrix3’s mrdegibbs command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.denoise(input, output, noisemap=True, extent='5, 5, 5', nthreads=None, force=True, verbose=False)
    +

    Runs MRtrix3’s dwidenoise command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +noisemap (bool): specify whether or not to save the noisemap as a

    +
    +

    nifti file (default: True)

    +
    +
    +
    extent (str): set the window size of the denoising filter.

    (default: 5,5,5)

    +
    +
    +

    nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.extractbzero(input, output, nthreads=None, force=False, verbose=False)
    +

    Extracts only bzero shells from an input mif file.

    +

    input (str): path to input .mif file +output (str): path to output .mif file +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.extractnonbzero(input, output, nthreads=None, force=False, verbose=False)
    +

    Extracts only non-bzero shells from an input mif file.

    +

    input (str): path to input .mif file +output (str): path to output .mif file

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.miftonii(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
    +

    Converts input .mif images to output .nii images

    +

    input (str): path to input .mif file +output (str): path to output .nii file +strides (str): specify the strides of the output data in memory

    +
    +

    (default: ‘1,2,3,4’)

    +
    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.niitomif(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
    +

    Converts input .nii images to output .nif images provided that +all BVEC, BVAL and JSON files are provided and named same as input .nii

    +

    input (str): path to input .nii file +output (str): path to output .mif file +strides (str): specify the strides of the output data in memory

    +
    +

    (default: ‘1,2,3,4’)

    +
    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.riciancorrect(input, output, noise=None)
    +

    Performs Rician correction on input .mif

    +

    input (str): path to input .mif file +output (str): path to output .mif file +noise (float): path to noise map from dwidenoise in .nii format

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.smooth(input, output, fwhm=1.25)
    +

    Performs Gaussian smoothing on input .mif image

    +

    input (str): path to input .mif file +output (str): path to output .mif file +fwhm (float): full-width half-maximum (FWHM) of smoothing to apply

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.topupboost(input, output, idx=None, nthreads=None, force=False, verbose=False)
    +

    Analyzes an input .mif’s PE direction to split into two different +phase encoding (PE) DWIs. B0s from opposing PE are then extracted +and concatenated with the DWI. This reduces the number of B0s used +in undistortion for a better and speedier estimation of the +distortion field.

    +

    input (str): path to input .mif file +output (str): path to output .mif file +idx (int): list of B0 indexes to use in topup (default: 0) +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.undistort(input, output, rpe='rpe_header', qc=None, nthreads=None, force=False, verbose=False)
    +

    Runs MRtrix3’s dwipreproc command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +rpe (str): reverse phase encoding of the dataset (default:

    +
    +

    rpe_header)

    +
    +
    +
    qc (bool): specify whether to generate eddy QC metric (

    default: True)

    +
    +
    +

    nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +

    designer.preprocessing.preparation module

    +

    Adds utilities for preparing the data for eddy and analysis

    +
    +
    +designer.preprocessing.preparation.fix_bval(bvalfile)
    +

    Converts all whitespace into newlines in the file

    +
    +
    bvalfile :obj: str

    The .bval to ensure is the correct format for mrtrix

    +
    +
    +

    None, overwrites bval

    +
    + +
    +
    +designer.preprocessing.preparation.make_se_epi(filetable)
    +

    Makes a single spin-echo epi from the topup and the dwi

    +
    +
    filetable :dict:

    The filetable that pydesigner.py uses to track files

    +
    +
    +

    None, writes file

    +
    + +
    +
    +designer.preprocessing.preparation.make_simple_mif(filetable)
    +

    Makes a single .mif from the HEAD dwi file

    +
    +
    filetable :dict:

    The filetable that pydesigner.py uses to track files

    +
    +
    +

    None, writes file

    +
    + +
    +
    +

    designer.preprocessing.rician module

    +
    +
    +designer.preprocessing.rician.rician_correct(dwi, noisemap)
    +

    Smooths a DWI dataset

    +
    +
    dwi(X x Y x Z x N) img_like object

    Image to be corrected, where N is the number of volumes in +the DWI acquisition.

    +
    +
    csfmask(X x Y x Z x N) img_like object

    The noise map from dwidenoise

    +
    +
    width:obj: float, optional

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +
    +
    corrected(X x Y x Z x N) array_like or img_like object

    The rician-corrected version of dwi

    +
    +
    +
    + +
    +
    +designer.preprocessing.rician.rician_img_correct(dwiname, noisemapname, outpath=None)
    +

    Performs Rician correction on a dataset with a noisemap

    +
    +
    dwiname:obj: string

    Filename of image to be corrected

    +
    +
    noisemapname :obj: string

    Filename of noisemap to use for correction

    +
    +
    outpath :obj: string

    Path to put resulting file

    +
    +
    +

    None; writes out file

    +

    rician_correct(dwi, noise) is wrapped by this function

    +
    + +
    +
    +

    designer.preprocessing.smoothing module

    +
    +
    +designer.preprocessing.smoothing.nansmooth(imgslice, fwhm)
    +

    Smooths an image slice while ignoring NaNs

    +
    +
    imgslice(X x Y) img_like or array_like object

    2D image to be smoothed

    +
    +
    fwhm:obj: float

    The full width half max to be used for smoothing

    +
    +
    +
    +
    smoothslice(X x Y) array_like object

    2D smoothed image

    +
    +
    +

    This is done because a masked dataset will contain NaNs. In typical +operations and filtering, the NaNs will propagate instead of being +ignored (which is the desired behavior). During runtime, divide by 0 +warnings are suppressed due to the high probability of its occuring. +The operation to avoid this is as follows:

    +
    + +
    +
    +designer.preprocessing.smoothing.smooth(dwi, csfmask=None, width=1.25)
    +

    Smooths a DWI dataset

    +
    +
    dwi(X x Y x Z x N) img_like object

    Image to be smoothed, where N is the number of volumes in +the DWI acquisition.

    +
    +
    csfmask(S) img_like object

    The mask of CSF that will be applied to each volume in DWI

    +
    +
    width:obj: float, optional

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +
    +
    smoothed(X x Y x Z x N) array_like or img_like object

    The smoothed version of dwi

    +
    +
    +

    This is done mainly to reduce the Gibbs ringing. It might be +recommended to only smooth the high SNR (or b-valued) data in order +not to alter the Rice distribution of the low SNR data. This is +important to maintain the high accuracy of WLLS. If a CSF mask is +given as an additional argument, CSF infiltration in microstructural +signal is avoided during smoothing.

    +
    + +
    +
    +designer.preprocessing.smoothing.smooth_image(dwiname, csfname=None, outname='dwism.nii', width=1.2)
    +

    Smooths a DWI dataset

    +
    +
    dwiname:obj: string

    Filename of image to be smoothed

    +
    +
    csfname:obj: string

    Filename of CSF mask

    +
    +
    outname:obj: string

    Filename to be written out

    +
    +
    width:obj: float

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +

    None; writes out file

    +

    smooth(dwi, csfmask=None, width=1.25) is wrapped by this function

    +
    + +
    +
    +

    designer.preprocessing.snrplot module

    +
    +
    +class designer.preprocessing.snrplot.makesnr(dwilist, noisepath=None, maskpath=None)
    +

    Bases: object

    +

    Class object that computes and prints SNR plots for any number of +input DWIs

    +
    +
    dwilist: string list

    list of 4D DWI (nifti-format) paths to evaluate and plot

    +
    +
    noisepath: string

    path to noise map from “dwidenoise”

    +
    +
    maskpath: string (optional)

    path to brain mask

    +
    +
    +

    __init__: constructs makesnr class +getuniquebval: creates a list of unique B-values for the purpose of

    +
    +

    SNR computation

    +
    +

    computesnr: performs SNR computation +histcount: bins SNR values +makeplot: creates and saves SNR plot from bin counts

    +
    +
    +computesnr()
    +

    Computes SNR of all DWIs in class object

    +

    (none)

    +

    snr_dwi: Numpy array of SNR across all DWI.

    +
    + +
    +
    +getuniquebval()
    +

    Creates a list of unique B-values for the purpose of SNR +computation. In the calculation of SNR, B0 signal can be averaged +becase they are not associated to any direction. This is not true +for non-B0 values however, because every 3D volume represents a +different direction. To compute SNR appropriately, differences in +gradients have to be accounted. This function creates a list of +B-values in the order they need to appear for the calculation of +SNR.

    +

    (none)

    +
    +
    b_list: Numpy vector containing list of B-vals to be used in

    SNR calculation

    +
    +
    +
    + +
    +
    +histcount(nbins=100)
    +

    Bins SNR into nbins and returns various counting properties

    +

    nbins: int +:return:

    +
    + +
    +
    +makeplot(path, smooth=True, smoothfactor=5)
    +

    Creates and saves SNR plot to a path as SNR.png

    +
    +
    path: string

    directory to save the plot in

    +
    +
    smooth: bool

    Specify whether to interpolate and smooth

    +
    +
    smoothfactor: int

    smoothing factor to apply

    +
    +
    +

    (none): saves plotted image into directory as SNR.png

    +
    + +
    + +
    +
    +designer.preprocessing.snrplot.vectorize(img, mask)
    +

    Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

    +

    vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

    +

    vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

    +
    + +
    +
    +

    designer.preprocessing.util module

    +

    Adds utilities for the command-line interface

    +
    +
    +class designer.preprocessing.util.DWIFile(name)
    +

    Bases: object

    +

    Diffusion data file object, used for handling paths and extensions.

    +

    Helps interface different extensions, group .bval/.bvec seamlessly to +the programmer. Offers interactive tools to try and locate a file if +it can’t be found. Likely a bit overkill, but reduces uberscript +coding.

    +
    +
    pathstring

    The path to the file

    +
    +
    namestring

    The base name of the file

    +
    +
    extarray

    The valid extensions for this grouping of dwi data

    +
    +
    acquisitionbool

    Indicates if a DWI acquisition or not, relevant for .bval/.bvec

    +
    +
    jsonstruct

    The contents of the .json metadata if available

    +
    +
    +
    +
    +getBVAL()
    +

    Returns the .bval filename for this DWIFile

    +
    +
    string

    The full path to the .bval

    +
    +
    +
    + +
    +
    +getBVEC()
    +

    Returns the .bvec filename for this DWIFile

    +
    +
    string

    The full path to the .bvec

    +
    +
    +
    + +
    +
    +getFull()
    +

    Get the path and name combined for thsi dwifile

    +
    +
    string

    The full path and filename with extension

    +
    +
    +
    + +
    +
    +getJSON()
    +

    Returns the .json filename for this DWIFile

    +
    +
    string

    The full path to the .json file

    +
    +
    +
    + +
    +
    +getName()
    +

    Get the name without the path for this dwifile

    +
    +
    string

    Name of the file without extensions

    +
    +
    +
    + +
    +
    +getPath()
    +

    Get the path without the name for this dwifile

    +
    +
    string

    The path to this file

    +
    +
    +
    + +
    +
    +hasJSON()
    +

    Checks if this object has a .json file

    +
    +

    True if has .json, False if not

    +
    +
    + +
    +
    +isAcquisition()
    +

    Check if this object is an acquisition

    +
    +
    bool

    True if acquisition, False if not

    +
    +
    +
    + +
    +
    +isPartialFourier()
    +

    Returns whether the volume is partial fourier encoded

    +
    +
    boolean

    Whether the encoding is partial fourier or not

    +
    +
    +
    + +
    +
    +print(json=False)
    +
    + +
    + +
    +
    +class designer.preprocessing.util.DWIParser(path)
    +

    Bases: object

    +

    Parses a list of DWIs and concatenates them into a single 4D NifTi +with appropriate BVEC, BVALS.

    +
    +
    DWIlistlist of strings

    Contains paths to all input series

    +
    +
    DWInlist: list of strings

    Contains path to file names without extension

    +
    +
    DWIext: list of strings

    Contains extension of input files

    +
    +
    BVALlist: list of strings

    Contains paths to all BVAL files

    +
    +
    BVEClist: list of strings

    Contains paths to all BVEC files

    +
    +
    JSONlist: list of strings

    Contains paths to all JSON files

    +
    +
    nDWI: int

    Number of DWIs entered

    +
    +
    +
    +
    +cat(path, ext='.nii', verbose=False, force=False, resume=False)
    +

    Concatenates all input series when nDWI > 1 into a 4D NifTi +along with a appropriate BVAL, BVEC and JSON files. +Concatenation of series via MRTRIX3 requires every NifTi file to +come with BVAL/BVEC to produce a .json with dw_scheme.

    +
    +
    path: string

    Directory where to store concatenated series

    +
    +
    ext: string

    Extenstion to save concatenated file in. Refer to MRTRIX3’s +mrconvert function for a list of possible extensions

    +
    +
    verbose: bool

    Displays MRTRIX3’s console output

    +
    +
    force: bool

    Forces file overwrite if they already exist

    +
    +
    +
    + +
    +
    +getPath()
    +

    Returns directory where first file in DWI list is stored

    +
    + +
    +
    +json2fslgrad(path)
    +

    Creates FSL .bvec and .bval for series missing that information. +Some datasets have their B0s separately that do not produce fsl +gradients upon conversion to NifTi. This function creates those +missing features for complete concatenation from .json file. Use +with caution if and only if you know your input series is a DWI.

    +
    +
    path: string

    Path to NifTi file

    +
    +
    +
    + +
    + +
    +
    +designer.preprocessing.util.bvec_is_fullsphere(bvec)
    +

    Determines if .bvec file is full or half-sphere

    +
    +
    bvecstring

    The filename of the bvec

    +
    +
    +

    True if full-sphere, False if half

    +
    + +
    +
    +designer.preprocessing.util.find_valid_ext(pathname)
    +

    Finds valid extensions for dwifile, helper function

    +
    +
    pathnamestring

    The name to try and find extensions for

    +
    +
    +
    +
    array

    Array of valid file extensions for the basename

    +
    +
    +
    + +
    +
    +designer.preprocessing.util.vecs_are_fullsphere(bvecs)
    +

    Determines if input vectors are full or half-sphere

    +
    +
    bvecsndarray

    Matrix of size [n_vectors x 3]

    +
    +
    +

    True if full-sphere, False if half

    +

    Adapted from Chris Rorden’s nii_preprocess as seen here: +https://github.com/neurolabusc/nii_preprocess/blob/dd1c84f23f8828923dd5fc493a22156b7006a3d4/nii_preprocess.m#L1786-L1824 +and reproduced from the original designer pipeline here: +https://github.com/m-ama/PyDesigner/blob/7a39ec4cb9679f1c3e9ead68baa8f8c111b0618a/designer/designer.py#L347-L368

    +
    + +
    +
    + + +
    + +
    + + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules/designer.system.html b/docs/modules/designer.system.html new file mode 100644 index 00000000..19f4649c --- /dev/null +++ b/docs/modules/designer.system.html @@ -0,0 +1,277 @@ + + + + + + + + + + + designer.system package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.system package

    +
    +

    Submodules

    +
    +
    +

    designer.system.systemtools module

    +
    +
    +designer.system.systemtools.isAMD()
    +

    Inquires whether CPU is manufactured by AMD

    +

    (none)

    +
    +
    ans: bool

    True if AMD; False otherwise

    +
    +
    +
    + +
    +
    +designer.system.systemtools.isIntel()
    +

    Inquires whether CPU is manufactured by Intel

    +

    (none)

    +
    +
    ans: bool

    True if Intel; False otherwise

    +
    +
    +
    + +
    +
    +designer.system.systemtools.setenv(envlist)
    +

    Sets system variables while a Python for the execution of a Python +script

    +
    +
    envlist: string list

    List containing environment variables to set. Each entry in +the list is a [(ENV_VARIABLE, ENV_VAL)]

    +
    +
    +

    (none) sets system variable

    +
    + +
    +
    + + +
    + +
    +
    + + + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules/modules.html b/docs/modules/modules.html new file mode 100644 index 00000000..29426bf3 --- /dev/null +++ b/docs/modules/modules.html @@ -0,0 +1,263 @@ + + + + + + + + + + + designer — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv index 955e1033..3624d072 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/py-modindex.html b/docs/py-modindex.html new file mode 100644 index 00000000..e5c49329 --- /dev/null +++ b/docs/py-modindex.html @@ -0,0 +1,303 @@ + + + + + + + + + + + Python Module Index — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + +
      + +
    • Docs »
    • + +
    • Python Module Index
    • + + +
    • + +
    • + +
    + + +
    +
    +
    +
    + + +

    Python Module Index

    + +
    + d +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
    + d
    + designer +
        + designer.fitting +
        + designer.fitting.dwidirs +
        + designer.fitting.dwipy +
        + designer.info +
        + designer.postprocessing +
        + designer.postprocessing.filters +
        + designer.preprocessing +
        + designer.preprocessing.mrinfoutil +
        + designer.preprocessing.mrpreproc +
        + designer.preprocessing.preparation +
        + designer.preprocessing.rician +
        + designer.preprocessing.smoothing +
        + designer.preprocessing.snrplot +
        + designer.preprocessing.util +
        + designer.pydesigner +
        + designer.system +
        + designer.system.systemtools +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, MUSC Advanced MRI Analysis (MAMA) + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/designer.fitting.html b/docs/references/designer_commands/designer.fitting.html new file mode 100644 index 00000000..720952ff --- /dev/null +++ b/docs/references/designer_commands/designer.fitting.html @@ -0,0 +1,800 @@ + + + + + + + + + + + designer.fitting package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.fitting package

    +
    +

    Submodules

    +
    +
    +

    designer.fitting.dwidirs module

    +
    +
    +

    designer.fitting.dwipy module

    +
    +
    +class designer.fitting.dwipy.DWI(imPath, nthreads=-1)
    +

    Bases: object

    +
    +
    +akccorrect(akc_out, window=3, connectivity='face')
    +

    Applies AKC outlier map to DT to replace outliers with a +moving median. +Run this only after tensor fitting and akc outlier detection +Classification: Method

    +

    dwi.akccorrect(akc_out), where dwi is the DWI class object

    +

    akc_out: 3D map containing outliers from DWI.akcoutliers +window: width of square matrix filter.

    +
    +

    default: 5 +type: int

    +
    +
    +
    connectivity: specifies what kind of connected-component

    connectivity to use for median determination +choices: ‘all’ (default) or ‘face’ +type: string

    +
    +
    +
    + +
    +
    +akcoutliers(iter=10)
    +

    Uses 100,000 direction in chunks of 10 to iteratively find +outliers. Returns a mask of locations where said violations +occur. Multiprocessing is disabled because this is a +memory-intensive task. +To be run only after tensor fitting. +Classification: Method

    +

    akc_out = dwi.akoutliers(), where dwi is the DWI class object

    +
    +
    iter: number of iterations to perform out of 10. Default: 10

    reduce this number if your computer does not have +sufficient RAM

    +
    +
    +
    +
    akc_out: 3D map containing outliers where AKC falls fails the

    inequality test -2 < AKC < 10

    +
    +
    +
    + +
    +
    +createConstraints(constraints=[0, 1, 0])
    +

    Generates constraint array for constrained minimization quadratic +programming

    +

    C = dwi.createConstraints([0, 1, 0])

    +

    constraints: [1 X 3] logical vector indicating which constraints +out of three to enable

    +
    +

    C1 is Dapp > 0 +C1 is Kapp > 0 +C3 is Kapp < 3/(b*Dapp)

    +
    +
    +
    C: array containing constraints to consider during

    minimization +C is shaped [number of constraints enforced * +number of directions, 22]

    +
    +
    +
    + +
    +
    +createTensorOrder(order=None)
    +
    +
    Creates tensor order array and indices

    Classification: Method

    +

    (cnt, ind) = dwi.createTensorOrder(order)

    +
    +
    order: 2 or 4 (int or None)

    Tensor order number, 2 for diffusion and 4 for kurtosis. +Default: None; auto-detect

    +
    +
    +

    cnt: vector (int) +ind: array (int)

    +

    The tensors for this pipeline are based on NYU’s designer layout as +depicted in the table below. This will soon be depreciated and +updated with MRTRIX3’s layout. +============================= +——D—— +1 | D11 +2 | D12 +3 | D13 +4 | D22 +5 | D23 +6 | D33 +——K——

    +
    +
    +

    1 | W1111 +2 | W1112 +3 | W1113 +4 | W1122 +5 | W1123 +6 | W1133 +7 | W1222 +8 | W1223 +9 | W1233 +10 | W1333 +11 | W2222 +12 | W2223 +13 | W2233 +14 | W2333 +15 | W3333

    +
    + +
    +
    +diffusionCoeff(dt, dir)
    +

    Computes apparent diffusion coefficient (ADC) +Classification: Method

    +

    adc = dwi.diffusionCoeff(dt, dir)

    +

    dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

    +

    adc: matrix containing apparent diffusion coefficient

    +
    + +
    +
    +dkiTensorParams(v1, dt)
    +

    Uses average directional statistics to approximate axial +kurtosis(AK) and radial kurtosis (RK) +Classification: Method

    +

    (rk, ak) = dwi.dkiTensorParams(v1, dt)

    +

    v1: first eigenvector +dt: diffusion tensor

    +

    rk: radial kurtosis +ak: axial kurtosis +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor

    +
    + +
    +
    +dtiTensorParams(nn)
    +

    Computes sorted DTI tensor eigenvalues and eigenvectors +Classification: Method

    +

    (values, vectors) = dwi.dtiTensorParams(DT)

    +

    DT: diffusion tensor

    +

    values: sorted eigenvalues +vectors: sorted eigenvectors

    +
    + +
    +
    +extractDKI()
    +

    Extract all DKI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

    +

    (mk, rk, ak, fe, trace) = dwi.extractDTI(), where dwi is the DWI +class object

    +

    (none)

    +

    mk: mean diffusivity +rk: radial diffusivity +ak: axial diffusivity +kfa: kurtosis fractional anisotropy +mkt: mean kurtosis tensor +trace: sum of first eigenvalues

    +
    + +
    +
    +extractDTI()
    +

    Extract all DTI parameters from DT tensor. Warning, this can +only be run after tensor fitting dwi.fit()

    +

    (md, rd, ad, fa) = dwi.extractDTI(), where dwi is the DWI class +object

    +

    (none)

    +

    md: mean diffusivity +rd: radial diffusivity +ad: axial diffusivity +fa: fractional anisotropy +fe: first eigenvectors +trace: sum of first eigenvalues

    +
    + +
    +
    +extractWMTI()
    +

    Returns white matter tract integrity (WMTI) parameters. Warning: +this can only be run after fitting and DWI.extractDTI().

    +

    (none)

    +

    awf: axonal water fraction +eas_ad: extra-axonal space axial diffusivity +eas_rd: extra-axonal space radial diffusivity +eas_tort: extra-axonal space tortuosity +ias_ad: intra-axonal space axial diffusivity +ias_rd: intra-axonal space radial diffusivity +ias_tort: intra-axonal space tortuosity

    +
    + +
    +
    +fibonacciSphere(samples=1, randomize=True)
    +

    Returns evenly spaced points on a sphere +Classification: Method

    +

    dirs = dwi.fibonacciSphere(256, True)

    +
    +
    samples: Positive real integer

    number of points to compute from sphere

    +
    +
    randomize: True or False (bool)

    choose whether sampling is random or not

    +
    +
    +

    points: [3 x samples] array containing evenly spaced points +from a sphere

    +
    + +
    +
    +findViols(c=[0, 1, 0])
    +

    Returns a 3D violation map of voxels that violate constraints. +Classification: Method

    +

    map = findViols(img, [0 1 0]

    +

    img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

    +
    +

    c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

    +
    +
    +
    map: 3D array containing locations of voxels that incur directional

    violations. Voxels with values contain violaions and voxel +values represent proportion of directional violations.

    +
    +
    +
    + +
    +
    +findVoxelViol(adcVox, akcVox, maxB, c)
    +

    Returns the proportions of violations occurring at a voxel. +Classification: Method

    +

    map = findViols(voxel, [0 1 0]

    +

    img: 3D metric array such as mk or fa +c: [3 x 1] vector that toggles which constraints to check

    +
    +

    c[0]: Check D < 0 constraint +c[1]: Check K < 0 constraint (default) +c[2]: Check K > 3/(b*D) constraint

    +
    +

    n: Number ranging from 0 to 1 that indicates proportion of +violations occuring at voxel.

    +
    + +
    +
    +fit(constraints=None, reject=None)
    +

    Returns fitted diffusion or kurtosis tensor

    +

    dwi.fit() +dwi.fit(constraints=[0,1,0], reject=irlls_output)

    +
    +
    constraits: [1 x 3] vector (int)

    Specifies which constraints to use

    +
    +
    reject: 4D matrix containing information on voxels to exclude

    from DT estimation

    +
    +
    +

    self.dt: return diffusion tensor within DWI class

    +
    + +
    +
    +getBvals()
    +

    Returns a vector of b-values, requires no input arguments +Classification: Method

    +

    bvals = dwi.getBvals(), where dwi is the DWI class object

    +
    + +
    +
    +getBvecs()
    +

    Returns an array of gradient vectors, requires no input +parameters +Classification: Method

    +

    bvecs = dwi.getBvecs(), where dwi is the DWI class object

    +
    + +
    +
    +getndirs()
    +

    Returns the number of gradient directions acquired from scanner

    +

    n = dwi.getndirs(), where dwi is the DWI class object

    +

    Retun +n: integer quantifying number of directions

    +
    + +
    +
    +goodDirections(outliers)
    +

    Creates a 3D maps of good directions from IRLLS outlier map +For any given voxel, a violation is computed using logical or +operant for all b-values. Whether +an outlier occurs at b1000 or b1000 and b2000, that voxel is still +a violation unless none of the b-values have outliers.

    +

    map = dwi.goodDirections(outliers)

    +

    outliers: 4D maps of outliers from IRLLS

    +

    map: 3D maps of number of good directions

    +
    + +
    +
    +irlls(excludeb0=True, maxiter=25, convcrit=0.001, mode='DKI', leverage=0.85, bounds=3)
    +

    This functions performs outlier detection and robust parameter +estimation for diffusion MRI using the iterative reweigthed +linear least squares (IRLLS) approach. +Classification: Method

    +

    outliers = dwi.irlls()

    +
    +
    exludeb0: True (default) or False (bool)

    Exlude the b0 images when removing outliers?

    +
    +
    maxiter: Integer; default: 25

    Maximum number of iterations in the iterative +reweighting loop

    +
    +
    convcrit: Real positive double; default: 1e-3

    Fraction of L2-norm of estimated diffusion parameter +vector that the L2-norm of different vector should get +under un order to reach convergence in the iterative +reweighted loop

    +
    +
    mode: ‘DTI’ or ‘DKI’ (string); default: ‘DKI’

    Specifies whether to use DTi or DKI model

    +
    +
    leverage: Double ranging from 0 to 1; default: 0.85

    Measurements with a leverage above this threshold will +not be excluded in estimation of DT after +outlier detection

    +
    +
    Bounds: Integer; default: 3

    Set the threshold of the number of standard deviation +that are needed to exclude a measurement

    +
    +
    +
    +
    outliers: 4D image same size as input dwi marking voxels

    that are outliers

    +
    +
    +

    dt: IRLLS method of DT estimation

    +
    + +
    +
    +irllsviolmask(reject)
    +

    Computes 3D violation mask of outliers detected from IRLLS +method +Classification: Method

    +

    mask = dwi.irllsviolmask(outliers)

    +

    reject: 4D input outlier map from IRLLS

    +

    Returns +propviol: 3D mask where voxel value is the percentage of +directional violations

    +
    + +
    +
    +isdki()
    +

    Returns logical value to answer the mystical question whether +the input image is DKI

    +

    ans = dwi.isdki(), where dwi is the DWI class object

    +

    ans: True or False (bool)

    +
    + +
    +
    +kurtosisCoeff(dt, dir)
    +

    Computes apparent kurtosis coefficient (AKC) +Classification: Method

    +

    adc = dwi.kurtosisCoeff(dt, dir)

    +

    dt: [21 x nvoxel] array containing diffusion tensor +dir: [n x 3] array containing gradient directions

    +

    adc: matrix containing apparent kurtosis coefficient

    +
    + +
    +
    +maxBval()
    +

    Returns the maximum b-value in a dataset to determine between +DTI and DKI, requires no input parameters +Classification: Method

    +

    a = dwi.maxBval(), where dwi is the DWI class object

    +
    + +
    +
    +multiplyMask(img)
    +

    Multiplies a 3D image by the brain mask

    +

    img: 3D image to be multiplied

    +

    multiplied image

    +
    + +
    +
    +parfindViols(c=[0, 0, 0])
    +
    + +
    +
    +radialSampling(dir, n)
    +

    Get the radial component of a metric from a set of directions +Classification: Method

    +

    grad = dwi.radiansampling(dir, number_of_dirs)

    +

    dir: [n x 3] input matrix +n: number of rows, n

    +

    dirs: Matrix containing radial components

    +
    + +
    +
    +tensorReorder(dwiType)
    +

    Reorders tensors in DT to those of MRTRIX in accordance to +the table below

    +

    MRTRIX3 Tensors DESIGNER Tensors +————— —————-

    +

    0 D0 1 1 1 1 +1 D1 2 2 1 2 +2 D2 3 3 1 3 +3 D3 1 2 2 2 +4 D4 1 3 2 3 +5 D5 2 3 3 3

    +

    6 K0 1 1 1 1 1 1 1 1 +7 K1 2 2 2 2 1 1 1 2 +8 K2 3 3 3 3 1 1 1 3 +9 K3 1 1 1 2 1 1 2 2 +10 K4 1 1 1 3 1 1 2 3 +11 K5 1 2 2 2 1 1 3 3 +12 K6 1 3 3 3 1 2 2 2 +13 K7 2 2 2 3 1 2 2 3 +14 K8 2 3 3 3 1 2 3 3 +15 K9 1 1 2 2 1 3 3 3 +16 K10 1 1 3 3 2 2 2 2 +17 K11 2 2 3 3 2 2 2 3 +18 K12 1 1 2 3 2 2 3 3 +19 K13 1 2 2 3 2 3 3 3 +20 K14 1 2 3 3 3 3 3 3

    +

    MRTRIX3 DESIGNER +——- ——–

    +
    +

    0 0 +1 3 +2 5 +3 1 +4 2 +5 4

    +

    6 6 +7 16 +8 20 +9 7 +10 8 +11 12 +12 15 +13 17 +14 19 +15 9 +16 11 +17 18 +18 10 +19 13 +20 14

    +
    +

    dt = dwi.tensorReorder()

    +
    +
    dwiType: ‘dti’ or ‘dki’ (string)

    Indicates whether image is DTI or DKI

    +
    +
    +

    DT: 4D image containing DT tensor +KT: 4D image containing KT tensor

    +
    + +
    +
    +tensorType()
    +

    Returns whether input image is DTI or DKI compatible, requires +no input parameters +Classification: Method

    +

    a = dwi.tensorType(), where dwi is the DWI class object

    +

    a: ‘dti’ or ‘dki’ (string)

    +
    + +
    +
    +wlls(shat, dwi, b, cons=None, warmup=None)
    +

    Estimates diffusion and kurtosis tenor at voxel with +unconstrained Moore-Penrose pseudoinverse or constrained +quadratic convex optimization. This is a helper function for +dwi.fit() so a multiprocessing parallel loop can be iterated over +voxels +Classification: Method

    +

    For Unconstrained Fitting: +In the absence of constraints, an exact formulation in the form +Cx = b is produced. This is further simplified to x_hat = C^+ * +b. One can use the Moore-Penrose method to compute the +pseudoinverse to approximate diffusion tensors.

    +

    For Constrained Fitting: +The equation |Cx -b|^2 expands to 0.5*x.T(C.T*A)*x -(C.T*b).T

    +
    +
    +
    ——- ——

    P q

    +
    +
    +
    +

    where A is denoted by multiplier matrix (w * b) +Multiplying by a positive constant (0.5) does not change the value +of optimum x*. Similarly, the constant offset b.T*b does not +affect x*, therefore we can leave these out.

    +
    +
    Minimize: || C*x -b ||_2^2

    subject to A*x <= b +No lower or upper bounds

    +
    +
    +

    dt = dwi.wlls(shat, dwi, b, constraints)

    +
    +
    shat: [ndir x 1] vector (float)

    S_hat, approximated signal intensity at voxel

    +
    +
    dwi: [ndir x 1] vector (float)

    diffusion weighted intensity values at voxel, for all +b-values

    +
    +
    b: [ndir x 1] vector (float)

    b-values vector

    +
    +
    cons: [(n * dir) x 22) vector (float)

    matrix containing inequality constraints for fitting

    +
    +
    +

    warmup: estimate dt vector (22, 0) at each voxel

    +

    dt: diffusion tensor

    +
    + +
    + +
    +
    +designer.fitting.dwipy.clipImage(img, range)
    +

    Clips input matrix within desired range. Min and max values are +inclusive of range

    +

    clippedImage = clipImage(image, [0 3]) +Clips input matrix in the range 0 to 3

    +

    img: input image matrix +range: [1 x 2] vector specifying range to clip

    +

    clippedImage: clipped image; same size as img

    +
    + +
    +
    +designer.fitting.dwipy.highprecisionexp(array, maxp=1e+32)
    +

    Prevents overflow warning with numpy.exp by assigning overflows +to a maxumum precision value +Classification: Function

    +

    a = highprecisionexp(array)

    +

    array: array or scalar of number to run np.exp on +maxp: maximum preicison to assign if overflow

    +
    +

    default: 1E32

    +
    +

    exponent or max-precision

    +
    + +
    +
    +designer.fitting.dwipy.vectorize(img, mask)
    +

    Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

    +

    vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

    +

    vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

    +
    + +
    +
    +designer.fitting.dwipy.writeNii(map, hdr, outDir, range=None)
    +

    Write clipped NifTi images +Classification: Function

    +

    writeNii(matrix, header, output_directory, [0, 2])

    +

    map: 3D matrix to write +header: NifTi header file containing NifTi properties +outDir: string

    +
    +

    Output file name

    +
    +

    range: Range to clip images, inclusive of values in range

    +

    None

    +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/designer.html b/docs/references/designer_commands/designer.html new file mode 100644 index 00000000..5bec947c --- /dev/null +++ b/docs/references/designer_commands/designer.html @@ -0,0 +1,260 @@ + + + + + + + + + + + designer package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/designer.postprocessing.html b/docs/references/designer_commands/designer.postprocessing.html new file mode 100644 index 00000000..af6855b0 --- /dev/null +++ b/docs/references/designer_commands/designer.postprocessing.html @@ -0,0 +1,246 @@ + + + + + + + + + + + designer.postprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.postprocessing package

    +
    +

    Submodules

    +
    +
    +

    designer.postprocessing.filters module

    +

    This module contains filter(s) for postprocessing DTI/DKI maps

    +
    +
    +designer.postprocessing.filters.median(input, output, mask=None)
    +

    Applies median filtering to input nifti file

    +

    input: path to input nifti file +output: path to output nifti file +mask: path to brainmask nifti file

    +
    +

    default: None

    +
    +

    written to drive

    +
    + +
    +
    +designer.postprocessing.filters.readnii(input)
    +

    Reads nifti files and returns header and numpy data array

    +

    input: path to nifti fule

    +

    img: numpy array +hdr: image header

    +
    + +
    +
    +designer.postprocessing.filters.writenii(hdr, img, output)
    +

    Write nupy array to nifti file

    +

    hdr: image header +img: numpy array +output: path to save file as

    +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/designer.preprocessing.html b/docs/references/designer_commands/designer.preprocessing.html new file mode 100644 index 00000000..161b0ec1 --- /dev/null +++ b/docs/references/designer_commands/designer.preprocessing.html @@ -0,0 +1,984 @@ + + + + + + + + + + + designer.preprocessing package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.preprocessing package

    +
    +

    Submodules

    +
    +
    +

    designer.preprocessing.mrinfoutil module

    +

    Utilities for extracting information on various input files using +MRtrix3’s mrinfo tool. All values are returned in basic Python data +types.

    +
    +
    +designer.preprocessing.mrinfoutil.commandhistory(path)
    +

    Returns a list of command history (manipulations or transformations) +performed on MRtrix file format .mif

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    List

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.datatype(path)
    +

    Returns the data type used for image storage

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Str, mrtrix3 datatypes

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.dwscheme(path)
    +

    Returns a list of diffusion weighting scheme

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    List

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.format(path)
    +

    Returns the file format of DWI at path

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    String indicating format

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.getconsole(path, flag)
    +

    Fetches the console output of mrinfo

    +
    +
    path: string

    path to input image or directory

    +
    +
    flag: string

    flag to pass onto mrinfo

    +
    +
    +

    String, information for flag

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.multiplier(path)
    +

    Returns the image intensity multiplier

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Float, image intensity multiplier

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.ndim(path)
    +

    Returns the number of image dimensions

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int, number of dimensions in image

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.offset(path)
    +

    Returns the image intensity offset

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Flaot, image intensity offset

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.pescheme(path)
    +

    Returns a list of phase encoding scheme. If len(pescheme) > 1, +the .mif DWI contains more than one directons

    +
    +
    path: string

    path to input image or directory

    +
    +
    +
    +
    nPE: int

    numer of PE directions

    +
    +
    PE: int or int list

    Phase encoding direction(s)

    +
    +
    +
    + +
    +
    +designer.preprocessing.mrinfoutil.size(path)
    +

    Returns the size of image along each axis

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, number of voxels in [X, Y, Z, B-value]

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.spacing(path)
    +

    Returns the voxel spacing along each image dimension

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, number of spacing between voxels [X, Y, Z, B-value]

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.strides(path)
    +

    Returns data strides

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Int tuple, mrtrix3 strides

    +
    + +
    +
    +designer.preprocessing.mrinfoutil.transform(path)
    +

    Returns the 4-by-4 voxel to image transformation matrix

    +
    +
    path: string

    path to input image or directory

    +
    +
    +

    Tuple float list

    +
    + +
    +
    +

    designer.preprocessing.mrpreproc module

    +

    Utilities for running various MRtrix3’s DWI preprocessing tools

    +
    +
    +designer.preprocessing.mrpreproc.brainmask(input, output, thresh=0.25, nthreads=None, force=False, verbose=False)
    +

    Creates a brainmask using FSL’s Brain Extraction Tool (BET) and +MRtrix3’s file manipulation tools.

    +

    input (str): path to input .mif file +output (str): path to output .nii brainmask file +thresh (flt): BET threshold ranging from 0 to 1 (default: 0.25) +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.degibbs(input, output, nthreads=None, force=False, verbose=False)
    +

    Runs MRtrix3’s mrdegibbs command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.denoise(input, output, noisemap=True, extent='5, 5, 5', nthreads=None, force=True, verbose=False)
    +

    Runs MRtrix3’s dwidenoise command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +noisemap (bool): specify whether or not to save the noisemap as a

    +
    +

    nifti file (default: True)

    +
    +
    +
    extent (str): set the window size of the denoising filter.

    (default: 5,5,5)

    +
    +
    +

    nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.extractbzero(input, output, nthreads=None, force=False, verbose=False)
    +

    Extracts only bzero shells from an input mif file.

    +

    input (str): path to input .mif file +output (str): path to output .mif file +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.extractnonbzero(input, output, nthreads=None, force=False, verbose=False)
    +

    Extracts only non-bzero shells from an input mif file.

    +

    input (str): path to input .mif file +output (str): path to output .mif file

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.miftonii(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
    +

    Converts input .mif images to output .nii images

    +

    input (str): path to input .mif file +output (str): path to output .nii file +strides (str): specify the strides of the output data in memory

    +
    +

    (default: ‘1,2,3,4’)

    +
    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.niitomif(input, output, strides='1, 2, 3, 4', nthreads=None, force=True, verbose=False)
    +

    Converts input .nii images to output .nif images provided that +all BVEC, BVAL and JSON files are provided and named same as input .nii

    +

    input (str): path to input .nii file +output (str): path to output .mif file +strides (str): specify the strides of the output data in memory

    +
    +

    (default: ‘1,2,3,4’)

    +
    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.riciancorrect(input, output, noise=None)
    +

    Performs Rician correction on input .mif

    +

    input (str): path to input .mif file +output (str): path to output .mif file +noise (float): path to noise map from dwidenoise in .nii format

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.smooth(input, output, fwhm=1.25)
    +

    Performs Gaussian smoothing on input .mif image

    +

    input (str): path to input .mif file +output (str): path to output .mif file +fwhm (float): full-width half-maximum (FWHM) of smoothing to apply

    +

    system call: (none)

    +
    + +
    +
    +designer.preprocessing.mrpreproc.topupboost(input, output, idx=None, nthreads=None, force=False, verbose=False)
    +

    Analyzes an input .mif’s PE direction to split into two different +phase encoding (PE) DWIs. B0s from opposing PE are then extracted +and concatenated with the DWI. This reduces the number of B0s used +in undistortion for a better and speedier estimation of the +distortion field.

    +

    input (str): path to input .mif file +output (str): path to output .mif file +idx (int): list of B0 indexes to use in topup (default: 0) +nthreads (int): number of workers to use +force (bool): force overwrite of existing files +verbose (bool): determine whether to display console output

    +

    (none) system call

    +
    + +
    +
    +designer.preprocessing.mrpreproc.undistort(input, output, rpe='rpe_header', qc=None, nthreads=None, force=False, verbose=False)
    +

    Runs MRtrix3’s dwipreproc command with optimal parameters for +PyDesigner.

    +

    input (str): path to input .mif file

    +

    output (str): path to output .mif file +rpe (str): reverse phase encoding of the dataset (default:

    +
    +

    rpe_header)

    +
    +
    +
    qc (bool): specify whether to generate eddy QC metric (

    default: True)

    +
    +
    +

    nthreads (int): number of threads in multi-threaded applications +force (bool): force overwrite of output files (default: False) +verbose (bool): display information messages (default: False)

    +

    system call: (none)

    +
    + +
    +
    +

    designer.preprocessing.preparation module

    +

    Adds utilities for preparing the data for eddy and analysis

    +
    +
    +designer.preprocessing.preparation.fix_bval(bvalfile)
    +

    Converts all whitespace into newlines in the file

    +
    +
    bvalfile :obj: str

    The .bval to ensure is the correct format for mrtrix

    +
    +
    +

    None, overwrites bval

    +
    + +
    +
    +designer.preprocessing.preparation.make_se_epi(filetable)
    +

    Makes a single spin-echo epi from the topup and the dwi

    +
    +
    filetable :dict:

    The filetable that pydesigner.py uses to track files

    +
    +
    +

    None, writes file

    +
    + +
    +
    +designer.preprocessing.preparation.make_simple_mif(filetable)
    +

    Makes a single .mif from the HEAD dwi file

    +
    +
    filetable :dict:

    The filetable that pydesigner.py uses to track files

    +
    +
    +

    None, writes file

    +
    + +
    +
    +

    designer.preprocessing.rician module

    +
    +
    +designer.preprocessing.rician.rician_correct(dwi, noisemap)
    +

    Smooths a DWI dataset

    +
    +
    dwi(X x Y x Z x N) img_like object

    Image to be corrected, where N is the number of volumes in +the DWI acquisition.

    +
    +
    csfmask(X x Y x Z x N) img_like object

    The noise map from dwidenoise

    +
    +
    width:obj: float, optional

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +
    +
    corrected(X x Y x Z x N) array_like or img_like object

    The rician-corrected version of dwi

    +
    +
    +
    + +
    +
    +designer.preprocessing.rician.rician_img_correct(dwiname, noisemapname, outpath=None)
    +

    Performs Rician correction on a dataset with a noisemap

    +
    +
    dwiname:obj: string

    Filename of image to be corrected

    +
    +
    noisemapname :obj: string

    Filename of noisemap to use for correction

    +
    +
    outpath :obj: string

    Path to put resulting file

    +
    +
    +

    None; writes out file

    +

    rician_correct(dwi, noise) is wrapped by this function

    +
    + +
    +
    +

    designer.preprocessing.smoothing module

    +
    +
    +designer.preprocessing.smoothing.nansmooth(imgslice, fwhm)
    +

    Smooths an image slice while ignoring NaNs

    +
    +
    imgslice(X x Y) img_like or array_like object

    2D image to be smoothed

    +
    +
    fwhm:obj: float

    The full width half max to be used for smoothing

    +
    +
    +
    +
    smoothslice(X x Y) array_like object

    2D smoothed image

    +
    +
    +

    This is done because a masked dataset will contain NaNs. In typical +operations and filtering, the NaNs will propagate instead of being +ignored (which is the desired behavior). During runtime, divide by 0 +warnings are suppressed due to the high probability of its occuring. +The operation to avoid this is as follows:

    +
    + +
    +
    +designer.preprocessing.smoothing.smooth(dwi, csfmask=None, width=1.25)
    +

    Smooths a DWI dataset

    +
    +
    dwi(X x Y x Z x N) img_like object

    Image to be smoothed, where N is the number of volumes in +the DWI acquisition.

    +
    +
    csfmask(S) img_like object

    The mask of CSF that will be applied to each volume in DWI

    +
    +
    width:obj: float, optional

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +
    +
    smoothed(X x Y x Z x N) array_like or img_like object

    The smoothed version of dwi

    +
    +
    +

    This is done mainly to reduce the Gibbs ringing. It might be +recommended to only smooth the high SNR (or b-valued) data in order +not to alter the Rice distribution of the low SNR data. This is +important to maintain the high accuracy of WLLS. If a CSF mask is +given as an additional argument, CSF infiltration in microstructural +signal is avoided during smoothing.

    +
    + +
    +
    +designer.preprocessing.smoothing.smooth_image(dwiname, csfname=None, outname='dwism.nii', width=1.2)
    +

    Smooths a DWI dataset

    +
    +
    dwiname:obj: string

    Filename of image to be smoothed

    +
    +
    csfname:obj: string

    Filename of CSF mask

    +
    +
    outname:obj: string

    Filename to be written out

    +
    +
    width:obj: float

    The full width half max in voxels to be smoothed. Default: 1.25

    +
    +
    +

    None; writes out file

    +

    smooth(dwi, csfmask=None, width=1.25) is wrapped by this function

    +
    + +
    +
    +

    designer.preprocessing.snrplot module

    +
    +
    +class designer.preprocessing.snrplot.makesnr(dwilist, noisepath=None, maskpath=None)
    +

    Bases: object

    +

    Class object that computes and prints SNR plots for any number of +input DWIs

    +
    +
    dwilist: string list

    list of 4D DWI (nifti-format) paths to evaluate and plot

    +
    +
    noisepath: string

    path to noise map from “dwidenoise”

    +
    +
    maskpath: string (optional)

    path to brain mask

    +
    +
    +

    __init__: constructs makesnr class +getuniquebval: creates a list of unique B-values for the purpose of

    +
    +

    SNR computation

    +
    +

    computesnr: performs SNR computation +histcount: bins SNR values +makeplot: creates and saves SNR plot from bin counts

    +
    +
    +computesnr()
    +

    Computes SNR of all DWIs in class object

    +

    (none)

    +

    snr_dwi: Numpy array of SNR across all DWI.

    +
    + +
    +
    +getuniquebval()
    +

    Creates a list of unique B-values for the purpose of SNR +computation. In the calculation of SNR, B0 signal can be averaged +becase they are not associated to any direction. This is not true +for non-B0 values however, because every 3D volume represents a +different direction. To compute SNR appropriately, differences in +gradients have to be accounted. This function creates a list of +B-values in the order they need to appear for the calculation of +SNR.

    +

    (none)

    +
    +
    b_list: Numpy vector containing list of B-vals to be used in

    SNR calculation

    +
    +
    +
    + +
    +
    +histcount(nbins=100)
    +

    Bins SNR into nbins and returns various counting properties

    +

    nbins: int +:return:

    +
    + +
    +
    +makeplot(path, smooth=True, smoothfactor=5)
    +

    Creates and saves SNR plot to a path as SNR.png

    +
    +
    path: string

    directory to save the plot in

    +
    +
    smooth: bool

    Specify whether to interpolate and smooth

    +
    +
    smoothfactor: int

    smoothing factor to apply

    +
    +
    +

    (none): saves plotted image into directory as SNR.png

    +
    + +
    + +
    +
    +designer.preprocessing.snrplot.vectorize(img, mask)
    +

    Returns vectorized image based on brain mask, requires no input +parameters +If the input is 1D or 2D, unpatch it to 3D or 4D using a mask +If the input is 3D or 4D, vectorize it using a mask +Classification: Method

    +

    vec = dwi.vectorize(img) if there’s no mask +vec = dwi.vectorize(img, mask) if there’s a mask

    +

    vec: N X number_of_voxels vector or array, where N is the number of DWI +volumes

    +
    + +
    +
    +

    designer.preprocessing.util module

    +

    Adds utilities for the command-line interface

    +
    +
    +class designer.preprocessing.util.DWIFile(name)
    +

    Bases: object

    +

    Diffusion data file object, used for handling paths and extensions.

    +

    Helps interface different extensions, group .bval/.bvec seamlessly to +the programmer. Offers interactive tools to try and locate a file if +it can’t be found. Likely a bit overkill, but reduces uberscript +coding.

    +
    +
    pathstring

    The path to the file

    +
    +
    namestring

    The base name of the file

    +
    +
    extarray

    The valid extensions for this grouping of dwi data

    +
    +
    acquisitionbool

    Indicates if a DWI acquisition or not, relevant for .bval/.bvec

    +
    +
    jsonstruct

    The contents of the .json metadata if available

    +
    +
    +
    +
    +getBVAL()
    +

    Returns the .bval filename for this DWIFile

    +
    +
    string

    The full path to the .bval

    +
    +
    +
    + +
    +
    +getBVEC()
    +

    Returns the .bvec filename for this DWIFile

    +
    +
    string

    The full path to the .bvec

    +
    +
    +
    + +
    +
    +getFull()
    +

    Get the path and name combined for thsi dwifile

    +
    +
    string

    The full path and filename with extension

    +
    +
    +
    + +
    +
    +getJSON()
    +

    Returns the .json filename for this DWIFile

    +
    +
    string

    The full path to the .json file

    +
    +
    +
    + +
    +
    +getName()
    +

    Get the name without the path for this dwifile

    +
    +
    string

    Name of the file without extensions

    +
    +
    +
    + +
    +
    +getPath()
    +

    Get the path without the name for this dwifile

    +
    +
    string

    The path to this file

    +
    +
    +
    + +
    +
    +hasJSON()
    +

    Checks if this object has a .json file

    +
    +

    True if has .json, False if not

    +
    +
    + +
    +
    +isAcquisition()
    +

    Check if this object is an acquisition

    +
    +
    bool

    True if acquisition, False if not

    +
    +
    +
    + +
    +
    +isPartialFourier()
    +

    Returns whether the volume is partial fourier encoded

    +
    +
    boolean

    Whether the encoding is partial fourier or not

    +
    +
    +
    + +
    +
    +print(json=False)
    +
    + +
    + +
    +
    +class designer.preprocessing.util.DWIParser(path)
    +

    Bases: object

    +

    Parses a list of DWIs and concatenates them into a single 4D NifTi +with appropriate BVEC, BVALS.

    +
    +
    DWIlistlist of strings

    Contains paths to all input series

    +
    +
    DWInlist: list of strings

    Contains path to file names without extension

    +
    +
    DWIext: list of strings

    Contains extension of input files

    +
    +
    BVALlist: list of strings

    Contains paths to all BVAL files

    +
    +
    BVEClist: list of strings

    Contains paths to all BVEC files

    +
    +
    JSONlist: list of strings

    Contains paths to all JSON files

    +
    +
    nDWI: int

    Number of DWIs entered

    +
    +
    +
    +
    +cat(path, ext='.nii', verbose=False, force=False, resume=False)
    +

    Concatenates all input series when nDWI > 1 into a 4D NifTi +along with a appropriate BVAL, BVEC and JSON files. +Concatenation of series via MRTRIX3 requires every NifTi file to +come with BVAL/BVEC to produce a .json with dw_scheme.

    +
    +
    path: string

    Directory where to store concatenated series

    +
    +
    ext: string

    Extenstion to save concatenated file in. Refer to MRTRIX3’s +mrconvert function for a list of possible extensions

    +
    +
    verbose: bool

    Displays MRTRIX3’s console output

    +
    +
    force: bool

    Forces file overwrite if they already exist

    +
    +
    +
    + +
    +
    +getPath()
    +

    Returns directory where first file in DWI list is stored

    +
    + +
    +
    +json2fslgrad(path)
    +

    Creates FSL .bvec and .bval for series missing that information. +Some datasets have their B0s separately that do not produce fsl +gradients upon conversion to NifTi. This function creates those +missing features for complete concatenation from .json file. Use +with caution if and only if you know your input series is a DWI.

    +
    +
    path: string

    Path to NifTi file

    +
    +
    +
    + +
    + +
    +
    +designer.preprocessing.util.bvec_is_fullsphere(bvec)
    +

    Determines if .bvec file is full or half-sphere

    +
    +
    bvecstring

    The filename of the bvec

    +
    +
    +

    True if full-sphere, False if half

    +
    + +
    +
    +designer.preprocessing.util.find_valid_ext(pathname)
    +

    Finds valid extensions for dwifile, helper function

    +
    +
    pathnamestring

    The name to try and find extensions for

    +
    +
    +
    +
    array

    Array of valid file extensions for the basename

    +
    +
    +
    + +
    +
    +designer.preprocessing.util.vecs_are_fullsphere(bvecs)
    +

    Determines if input vectors are full or half-sphere

    +
    +
    bvecsndarray

    Matrix of size [n_vectors x 3]

    +
    +
    +

    True if full-sphere, False if half

    +

    Adapted from Chris Rorden’s nii_preprocess as seen here: +https://github.com/neurolabusc/nii_preprocess/blob/dd1c84f23f8828923dd5fc493a22156b7006a3d4/nii_preprocess.m#L1786-L1824 +and reproduced from the original designer pipeline here: +https://github.com/m-ama/PyDesigner/blob/7a39ec4cb9679f1c3e9ead68baa8f8c111b0618a/designer/designer.py#L347-L368

    +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/designer.system.html b/docs/references/designer_commands/designer.system.html new file mode 100644 index 00000000..e2e6b35f --- /dev/null +++ b/docs/references/designer_commands/designer.system.html @@ -0,0 +1,249 @@ + + + + + + + + + + + designer.system package — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer.system package

    +
    +

    Submodules

    +
    +
    +

    designer.system.systemtools module

    +
    +
    +designer.system.systemtools.isAMD()
    +

    Inquires whether CPU is manufactured by AMD

    +

    (none)

    +
    +
    ans: bool

    True if AMD; False otherwise

    +
    +
    +
    + +
    +
    +designer.system.systemtools.isIntel()
    +

    Inquires whether CPU is manufactured by Intel

    +

    (none)

    +
    +
    ans: bool

    True if Intel; False otherwise

    +
    +
    +
    + +
    +
    +designer.system.systemtools.setenv(envlist)
    +

    Sets system variables while a Python for the execution of a Python +script

    +
    +
    envlist: string list

    List containing environment variables to set. Each entry in +the list is a [(ENV_VARIABLE, ENV_VAL)]

    +
    +
    +

    (none) sets system variable

    +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/designer_commands/modules.html b/docs/references/designer_commands/modules.html new file mode 100644 index 00000000..f948aeb4 --- /dev/null +++ b/docs/references/designer_commands/modules.html @@ -0,0 +1,249 @@ + + + + + + + + + + + designer — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/ref_commands.html b/docs/references/ref_commands.html new file mode 100644 index 00000000..1e931e93 --- /dev/null +++ b/docs/references/ref_commands.html @@ -0,0 +1,220 @@ + + + + + + + + + + + designer — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    designer

    +
    +
    +
    + + +
    + +
    +
    + + + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/references/ref_commands_BAK.html b/docs/references/ref_commands_BAK.html new file mode 100644 index 00000000..84660a2d --- /dev/null +++ b/docs/references/ref_commands_BAK.html @@ -0,0 +1,212 @@ + + + + + + + + + + + List of PyDesigner Commands — PyDesigner v0.2 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    List of PyDesigner Commands

    +
    +

    Preprocessing

    +

    These functions are reponsible for PyDesigner’s preprocessing.

    +
    +
    + + +
    + +
    +
    + + +
    + +
    +

    + © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + +

    +
    + Built with Sphinx using a theme provided by Read the Docs. + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/search.html b/docs/search.html index 72f48604..a9fb41c1 100644 --- a/docs/search.html +++ b/docs/search.html @@ -87,6 +87,14 @@
  • Python
  • PyDesigner
  • +

    NeuroDock (Docker)

    + @@ -172,7 +180,7 @@

    - © Copyright 2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith + © Copyright 2020, MUSC Advanced MRI Analysis (MAMA)

    diff --git a/docs/searchindex.js b/docs/searchindex.js index d39cc289..b68798ec 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index","installation/fsl","installation/mrtrix3","installation/pydesigner","installation/python","installation/requirements"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.index":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","installation/fsl.rst","installation/mrtrix3.rst","installation/pydesigner.rst","installation/python.rst","installation/requirements.rst"],objects:{},objnames:{},objtypes:{},terms:{"0_rc3":5,"default":4,"return":1,"switch":4,"while":4,For:4,One:0,The:4,Uses:0,With:0,abl:5,about:4,abov:[1,5],accur:0,acquisit:3,addition:0,adopt:4,agnost:0,aim:2,algorithm:0,all:[0,1,3,4,5],allow:4,alreadi:4,ama:[0,3],anaconda:4,analysi:2,ani:[3,4],anoth:2,assum:4,autom:3,automat:3,avail:5,base:[0,4,5],been:1,between:[0,4],boost:0,bring:0,build:3,built:4,call:[3,4],can:[3,4],chang:3,channel:0,check:1,choic:[3,4],choos:4,cli:3,click:3,clone:3,code:3,collect:1,com:3,commad:3,command:4,compat:0,complic:0,configur:[3,5],confin:0,confirm:2,control:0,creation:4,cross:0,current:5,cut:0,data:[0,1,2],decompress:3,definit:4,deisgn:3,depend:[0,3,4,5],design:0,desir:3,dicom:0,differ:4,directori:3,distribut:4,dki:0,dmri:[0,3,4],docker:[0,5],done:1,download:[1,2],dti:0,dwi:[1,2],easi:0,easili:4,edg:0,either:4,enocurag:4,enourag:4,environ:3,evalu:0,everi:0,execut:[3,4],extract:[0,5],fast:0,featur:0,feedback:0,file:0,first:4,fit:5,flexibl:0,flirt:1,fmri:1,folder:3,follow:[3,4,5],footprint:0,format:0,from:[0,3],fsl:[0,5],git:3,github:[0,3],graph:0,guid:[1,4],has:1,have:4,help:2,here:2,highli:[0,4],homepag:2,host:4,http:3,imag:[0,5],index:0,indic:[1,2],inform:4,input:0,inspir:0,instal:[0,1,4,5],integr:0,interdepend:5,isol:4,issu:0,join:0,just:[0,4],keep:4,latest:[0,3],least:1,like:4,line:4,link:3,linux:0,literatur:0,live:0,longer:0,love:0,mac:0,machin:4,mai:[0,3,4,5],main:3,make:0,manag:4,map:5,meet:1,method:3,metric:0,microsoft:5,mif:0,miniconda:4,minim:0,modul:[0,5],more:4,most:3,mri:[0,1],mrinfo:2,mrtrix3:[0,5],multipl:4,name:4,nativ:5,need:[3,4],neurodock:5,next:4,nii:0,notabl:0,note:3,nyu:0,onc:4,onli:5,open:3,oper:0,other:1,outlier:0,output:2,packag:[0,3,4],page:[0,1,2,4],paramet:0,pass:0,perform:[3,5],pip:[0,3,4],pipelin:0,platform:[0,5],pleas:5,post:[0,3],pre:[0,3],prefer:4,preprocess:[0,4],proce:[4,5],process:[0,1,3],project:[0,4],pyd:[1,3,4,5],pydesign:[1,4],pypi:4,python:[0,3,5],qualiti:0,readi:4,recent:3,recommend:[1,4,5],refer:4,releas:3,replac:4,repositori:[0,3],requir:[0,1,4],research:0,root:3,run:[3,4,5],scientist:0,script:[0,3],search:0,second:4,see:4,separ:4,set:4,setup:3,shot:0,simpli:3,simultan:4,singl:4,skip:4,slack:0,small:0,snr:0,softwar:[0,1,2],some:2,sourc:3,specif:[0,4],speed:5,stabl:3,step:5,still:5,success:[1,2],suit:2,suppli:4,support:0,sure:4,system:[0,5],tab:3,techniqu:0,tensor:5,termin:3,test:[1,3,4],them:4,thi:[0,3,4],three:5,through:0,tool:[1,4],two:4,type:0,unix:5,unzip:3,use:[0,4],used:1,user:[0,4],using:[0,4],valid:2,valu:1,version:[1,2,3,4],via:0,virtual:4,visit:1,voxel:0,well:4,when:3,window:0,work:0,you:[0,3,4,5],your:[1,3,4],zip:3},titles:["Welcome to the official PyDesigner documentation","FSL","MRtrix3 Installation","PyDesigner","Python","PyDesigner Requirements"],titleterms:{"new":4,conda:4,creat:4,document:0,download:[3,4],environ:4,fsl:1,indic:0,insal:4,instal:[2,3],linux:5,mac:5,mrtrix3:2,offici:0,pydesign:[0,3,5],python:4,requir:5,tabl:0,updat:4,user:5,welcom:0,window:5}}) \ No newline at end of file +Search.setIndex({docnames:["api/api","api/designer","api/designer.fitting","api/designer.fitting.dwidirs","api/designer.fitting.dwipy","api/designer.info","api/designer.postprocessing","api/designer.postprocessing.filters","api/designer.preprocessing","api/designer.preprocessing.mrinfoutil","api/designer.preprocessing.mrpreproc","api/designer.preprocessing.preparation","api/designer.preprocessing.rician","api/designer.preprocessing.smoothing","api/designer.preprocessing.snrplot","api/designer.preprocessing.util","api/designer.pydesigner","api/designer.system","api/designer.system.systemtools","docker/docker_configuration","docker/docker_install","docker/docker_neurodock","docker/docker_neurodock_run","docker/introduction","index","installation/fsl","installation/mrtrix3","installation/pydesigner","installation/python","installation/requirements"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.index":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["api/api.rst","api/designer.rst","api/designer.fitting.rst","api/designer.fitting.dwidirs.rst","api/designer.fitting.dwipy.rst","api/designer.info.rst","api/designer.postprocessing.rst","api/designer.postprocessing.filters.rst","api/designer.preprocessing.rst","api/designer.preprocessing.mrinfoutil.rst","api/designer.preprocessing.mrpreproc.rst","api/designer.preprocessing.preparation.rst","api/designer.preprocessing.rician.rst","api/designer.preprocessing.smoothing.rst","api/designer.preprocessing.snrplot.rst","api/designer.preprocessing.util.rst","api/designer.pydesigner.rst","api/designer.system.rst","api/designer.system.systemtools.rst","docker/docker_configuration.rst","docker/docker_install.rst","docker/docker_neurodock.rst","docker/docker_neurodock_run.rst","docker/introduction.rst","index.rst","installation/fsl.rst","installation/mrtrix3.rst","installation/pydesigner.rst","installation/python.rst","installation/requirements.rst"],objects:{"":{designer:[1,0,0,"-"]},"designer.fitting":{dwidirs:[3,0,0,"-"],dwipy:[4,0,0,"-"]},"designer.fitting.dwipy":{DWI:[4,1,1,""],clipImage:[4,3,1,""],highprecisionexp:[4,3,1,""],vectorize:[4,3,1,""],writeNii:[4,3,1,""]},"designer.fitting.dwipy.DWI":{akccorrect:[4,2,1,""],akcoutliers:[4,2,1,""],createConstraints:[4,2,1,""],createTensorOrder:[4,2,1,""],diffusionCoeff:[4,2,1,""],dkiTensorParams:[4,2,1,""],dtiTensorParams:[4,2,1,""],extractDKI:[4,2,1,""],extractDTI:[4,2,1,""],extractWMTI:[4,2,1,""],fibonacciSphere:[4,2,1,""],findViols:[4,2,1,""],findVoxelViol:[4,2,1,""],fit:[4,2,1,""],getBvals:[4,2,1,""],getBvecs:[4,2,1,""],getndirs:[4,2,1,""],goodDirections:[4,2,1,""],irlls:[4,2,1,""],irllsviolmask:[4,2,1,""],isdki:[4,2,1,""],kurtosisCoeff:[4,2,1,""],maxBval:[4,2,1,""],multiplyMask:[4,2,1,""],parfindViols:[4,2,1,""],radialSampling:[4,2,1,""],tensorReorder:[4,2,1,""],tensorType:[4,2,1,""],wlls:[4,2,1,""]},"designer.postprocessing":{filters:[7,0,0,"-"]},"designer.postprocessing.filters":{median:[7,3,1,""],readnii:[7,3,1,""],writenii:[7,3,1,""]},"designer.preprocessing":{mrinfoutil:[9,0,0,"-"],mrpreproc:[10,0,0,"-"],preparation:[11,0,0,"-"],rician:[12,0,0,"-"],smoothing:[13,0,0,"-"],snrplot:[14,0,0,"-"],util:[15,0,0,"-"]},"designer.preprocessing.mrinfoutil":{commandhistory:[9,3,1,""],datatype:[9,3,1,""],dwscheme:[9,3,1,""],format:[9,3,1,""],getconsole:[9,3,1,""],multiplier:[9,3,1,""],ndim:[9,3,1,""],offset:[9,3,1,""],pescheme:[9,3,1,""],size:[9,3,1,""],spacing:[9,3,1,""],strides:[9,3,1,""],transform:[9,3,1,""]},"designer.preprocessing.mrpreproc":{brainmask:[10,3,1,""],degibbs:[10,3,1,""],denoise:[10,3,1,""],extractbzero:[10,3,1,""],extractnonbzero:[10,3,1,""],miftonii:[10,3,1,""],niitomif:[10,3,1,""],riciancorrect:[10,3,1,""],smooth:[10,3,1,""],topupboost:[10,3,1,""],undistort:[10,3,1,""]},"designer.preprocessing.preparation":{fix_bval:[11,3,1,""],make_se_epi:[11,3,1,""],make_simple_mif:[11,3,1,""]},"designer.preprocessing.rician":{rician_correct:[12,3,1,""],rician_img_correct:[12,3,1,""]},"designer.preprocessing.smoothing":{nansmooth:[13,3,1,""],smooth:[13,3,1,""],smooth_image:[13,3,1,""]},"designer.preprocessing.snrplot":{makesnr:[14,1,1,""],vectorize:[14,3,1,""]},"designer.preprocessing.snrplot.makesnr":{computesnr:[14,2,1,""],getuniquebval:[14,2,1,""],histcount:[14,2,1,""],makeplot:[14,2,1,""]},"designer.preprocessing.util":{DWIFile:[15,1,1,""],DWIParser:[15,1,1,""],bvec_is_fullsphere:[15,3,1,""],find_valid_ext:[15,3,1,""],vecs_are_fullsphere:[15,3,1,""]},"designer.preprocessing.util.DWIFile":{getBVAL:[15,2,1,""],getBVEC:[15,2,1,""],getFull:[15,2,1,""],getJSON:[15,2,1,""],getName:[15,2,1,""],getPath:[15,2,1,""],hasJSON:[15,2,1,""],isAcquisition:[15,2,1,""],isPartialFourier:[15,2,1,""],print:[15,2,1,""]},"designer.preprocessing.util.DWIParser":{cat:[15,2,1,""],getPath:[15,2,1,""],json2fslgrad:[15,2,1,""]},"designer.pydesigner":{main:[16,3,1,""]},"designer.system":{systemtools:[18,0,0,"-"]},"designer.system.systemtools":{isAMD:[18,3,1,""],isIntel:[18,3,1,""],setenv:[18,3,1,""]},designer:{fitting:[2,0,0,"-"],info:[5,0,0,"-"],postprocessing:[6,0,0,"-"],preprocessing:[8,0,0,"-"],pydesigner:[16,0,0,"-"],system:[17,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function"},terms:{"0_rc3":29,"16t":19,"1800x":24,"1e32":4,"2700x":19,"7a39ec4cb9679f1c3e9ead68baa8f8c111b0618a":15,"boolean":15,"class":[0,4,14,15],"default":[4,7,10,12,13,19,28],"float":[4,9,10,12,13],"function":[0,4,12,13,14,15],"import":[13,22],"int":[4,9,10,14,15],"new":20,"return":[4,7,9,14,15,20,25],"switch":28,"true":[4,10,14,15,18],"try":[15,20],"while":[13,18,23,28],Adding:20,And:21,B0s:[10,15],For:[4,19,20,22,28],Not:22,One:[4,24],The:[4,11,12,13,15,19,20,21,22,24,28],Then:20,These:19,Use:[15,22],Uses:[4,24],VMs:23,With:[23,24],__init__:14,abl:[20,22,23,29],about:[20,28],abov:[4,22,25,29],absenc:4,access:[19,22,23],accord:4,account:14,accur:24,accuraci:13,acquir:4,acquisit:[12,13,15,27],across:[14,19,23],actual:22,adapt:[15,23],adc:4,adcvox:4,add:[11,15,20],addit:13,addition:[23,24],additon:21,adopt:28,advis:22,affect:4,after:4,aftet:21,agent:20,agnost:[23,24],aim:26,akc:4,akc_out:4,akccorrect:4,akcoutli:4,akcvox:4,akoutli:4,algorithm:24,all:[4,9,10,11,14,15,19,20,21,23,24,25,27,28,29],allow:[20,23,28],almost:[22,24],along:[9,15],alreadi:[15,28],also:24,alter:13,altern:20,ama:[15,24,27],ambiti:20,amd64:20,amd:[18,19,24],amount:19,anaconda:28,analys:23,analysi:[11,22,26],analyz:10,ani:[4,14,20,21,22,27,28],anisotropi:4,anoth:[21,26],ans:[4,18],answer:4,appar:4,appear:[14,20,23],appl:19,appli:[4,7,10,13,14,19],applic:[10,23,24],approach:4,appropri:[14,15],approxim:4,apt:20,arch:20,arg:22,argument:[4,13,20,22],arrai:[4,7,14,15],array_lik:[12,13],ask:23,assign:[4,19],associ:14,assum:28,auto:4,autom:[20,27],automat:[20,22,27],avail:[15,19,22,23,29],availbl:22,averag:[4,14],avoid:13,awai:21,awar:20,awf:4,axi:9,axial:4,axon:4,b1000:4,b2000:4,b_list:14,bar:[19,20],base:[4,14,15,19,20,21,24,28,29],basenam:15,bash:20,basic:[9,20],batch:22,becas:14,becaus:[4,13,14,19,21],becom:[20,22,23],been:[20,25],begin:20,behav:23,behavior:13,being:[13,20,24],belong:22,below:[4,20],bet:10,better:[10,23],between:[4,9,24,28],bin:14,bit:15,blob:15,bond:22,bond_007:22,bond_dwi:22,bond_topup:22,bool:[4,10,14,15,18],boost:24,both:22,bound:4,brain:[4,10,14],brainmask:[7,10],bring:[23,24],build:[19,27],built:[21,22,28],bval:[4,10,11,15,22],bvalfil:11,bvallist:15,bvec:[4,10,15,22],bvec_is_fullspher:15,bveclist:15,bzero:10,calcul:14,call:[10,21,22,27,28],can:[4,14,15,19,20,21,22,23,27,28],cat:15,caution:15,certif:20,cfg:19,chang:[4,19,21,27],channel:24,check:[4,15,25],child:22,choic:[4,27,28],choos:[4,28],chri:15,chunk:4,classif:[4,14],cli:[20,27],click:[19,20,27],client:20,clip:4,clipimag:4,clippedimag:4,clock:19,clone:27,cnt:4,code:[15,21,22,27],coeffici:4,cohort:23,collect:25,com:[15,20,27],combin:[15,22],come:[15,22],commad:27,command:[9,10,15,20,21,22,23,28],commandhistori:9,common:[20,22],commun:20,compat:[4,23,24],complet:[15,22,23],complic:24,compon:4,comprehens:19,comput:[4,14,23,24],computesnr:14,con:4,concaten:[10,15],concist:23,configur:[21,24,27,29],confin:24,confirm:26,congratul:22,connect:4,consid:[4,19,22],consol:[9,10,15,20],constant:4,constrain:4,constraint:[4,19],constrait:4,construct:14,contact:20,contain:[4,7,9,13,14,15,18,19,20,21,22,23],containerd:20,contan:23,content:[15,22],control:[21,22,24],convcrit:4,conver:22,converg:4,convers:15,convert:[10,11],convex:4,copi:21,core:[19,24],correct:[10,11,12,19,22],correctli:20,could:22,count:14,cover:20,cpu:[18,19,24],creat:[4,10,14,15,20,23],createconstraint:4,createtensorord:4,creation:28,cross:24,csf:13,csfmask:[12,13],csfname:13,cuda:[19,24],curl:20,current:[20,29],custom:19,cut:[23,24],d11:4,d12:4,d13:4,d22:4,d23:4,d33:4,daemon:20,dapp:4,data:[7,9,10,11,13,15,22,24,25,26],dataset:[4,10,12,13,15],datatyp:9,dd1c84f23f8828923dd5fc493a22156b7006a3d4:15,deb:20,debian:20,decompress:27,decrypt:20,defin:22,definit:[22,28],degibb:10,deisgn:27,denois:10,denot:4,depend:[20,23,24,27,28,29],depict:4,deploi:23,depreci:4,descript:19,desgn:23,design:[4,7,9,10,11,12,13,14,15,16,18,21,23,24],desir:[4,13,19,27],desktop:[20,22],detail:19,detect:4,determin:[4,10,15],develop:20,developo:21,deviat:4,devop:21,dicom:24,dict:11,differ:[4,10,14,15,23,28],diffus:[4,9,15,23],diffusioncoeff:4,dimens:9,dir:[4,22],direct:[4,9,10,14,20],directon:9,directori:[9,14,15,21,22,27],disabl:4,disclaim:21,disk:19,displai:[10,15],disribut:20,distort:10,distribut:[13,20,28],divert:23,divid:13,dki:[4,7,23,24],dkitensorparam:4,dmg:20,dmri:[21,22,23,24,27,28],doc:20,docker:[24,29],dockerfil:21,document:[19,20,22],doe:4,don:20,done:[13,22,25],doubl:[4,19,20],download:[20,21,25,26],dpcker:19,drive:7,dti:[4,7,23,24],dtitensorparam:4,due:[13,24],dure:[4,13],dw_scheme:15,dwi:[4,9,10,11,12,13,14,15,19,22,24,25,26],dwidenois:[10,12,14],dwiext:15,dwifil:15,dwilist:[14,15],dwinam:[12,13],dwinlist:15,dwipars:15,dwipi:4,dwipreproc:10,dwism:13,dwityp:4,dwscheme:9,each:[4,9,13,18],eas:23,eas_ad:4,eas_rd:4,eas_tort:4,easi:[22,24],easili:[23,28],echo:11,eddi:[10,11,19],edg:[23,24],efer:20,effect:23,eigenvalu:4,eigenvector:4,either:28,els:22,empti:22,enabl:[4,20,24],encod:[9,10,15],encoruag:21,encourag:22,encrypt:20,enforc:4,engin:[19,23],enhanc:21,enocurag:28,enourag:28,ensur:[11,23],enter:15,entir:[19,23],entri:18,env_val:18,env_vari:18,environ:[18,21,27],envlist:18,epi:[11,19],equat:4,estim:[4,10],etc:22,evalu:[14,24],even:[21,22,23],evenli:4,everi:[14,15,23,24],everth:22,everyth:22,exact:4,exactli:21,exampl:[20,22],exce:19,exclud:4,excludeb0:4,execut:[18,20,27,28],exist:[10,15,20],exlud:4,exludeb0:4,exp:4,expand:4,expon:4,ext:15,extens:15,extenst:15,extent:10,extra:4,extract:[4,9,10,24,29],extractbzero:10,extractdki:4,extractdti:4,extractnonbzero:10,extractwmti:4,face:4,factor:14,fail:4,fall:4,fals:[4,10,15,18],far:22,fast:24,featur:[15,19,24],feedback:24,fetch:[9,20],fibonaccispher:4,field:10,file:[4,7,9,10,11,12,13,15,22,24],filenam:[12,13,15],filesystem:22,filet:11,filter:[4,7,10,13],find:[4,15],find_valid_ext:15,findviol:4,findvoxelviol:4,finish:21,first:[4,15,21,28],fit:[4,29],fix:23,fix_bval:11,flag:[9,19,22],flaot:9,flexibl:24,flirt:25,flt:10,fmri:25,folder:[22,27],follow:[13,19,20,21,22,24,27,28,29],follw:20,footprint:24,forc:[10,15,19],form:[4,22],format:[9,10,11,14,24],formul:4,forward:21,found:[15,19],fourier:15,fraction:4,free:[20,24],frequent:21,from:[4,10,11,12,14,15,20,21,24,27],fsl:[10,15,22,23,24,29],fssl:20,fule:7,full:[10,12,13,15,20,23],further:[4,21],fwhm:[10,13],gaussian:10,gener:[4,10,20,22],get:[4,15,20],getbval:[4,15],getbvec:[4,15],getconsol:9,getful:15,getjson:15,getnam:15,getndir:4,getpath:15,getuniquebv:14,gibb:13,git:27,github:[15,24,27],give:[21,22],given:[4,13],gnu:20,gnupg:20,good:[4,20],gooddirect:4,gpg:20,gpu:24,grad:4,gradient:[4,14,15],graph:24,group:15,gtx:19,guarante:[21,23],guard:20,guest:23,gui:[19,20],guid:[20,25,28],guidelin:22,half:[10,12,13,15,19],handl:[15,22],hardwar:19,has:[15,20,25],hasjson:15,have:[4,14,15,20,21,23,28],hdr:[4,7],head:11,header:[4,7],hello:20,help:[15,26],helper:[4,15],here:[15,20,21,22,26],high:13,highli:[24,28],highprecisionexp:4,histcount:14,histori:9,homepag:26,host:[22,23,28],how:[19,22],howev:14,hpc:23,http:[15,20,27],hub:20,ias_ad:4,ias_rd:4,ias_tort:4,icon:[19,20],idea:20,ident:[19,23],idx:10,ignor:13,imac:19,imag:[4,7,9,10,12,13,14,19,20,21,22,23,24,29],img:[4,7,14],img_lik:[12,13],imgslic:13,impath:4,impli:22,inclus:4,incred:[21,22],incur:4,ind:4,index:[10,24],indic:[4,9,15,20,25,26],inequ:4,infiltr:13,inform:[0,4,9,10,15,20,22,28],inner:23,input:[4,7,9,10,14,15,19,22,24],inquir:18,inspir:[23,24],instal:[22,24,25,28,29],installt:20,instanc:22,instead:13,instrcut:20,instruct:20,integ:4,integr:[4,24],intel:[18,19,24],intend:[19,21],intens:[4,9,24],inter:22,interact:15,interdepend:29,interfac:[15,21],interpol:14,intra:4,ipconfig:22,irll:4,irlls_output:4,irllsviolmask:4,isacquisit:15,isamd:18,isdki:4,isintel:18,isol:[22,28],ispartialfouri:15,issu:24,iter:4,its:[13,20,23],itself:19,join:24,json2fslgrad:15,json:[10,15,22],jsonlist:15,just:[23,24,28],k10:4,k11:4,k12:4,k13:4,k14:4,kapp:4,keep:28,kei:20,kernel:23,kfa:4,kid:22,kind:4,know:[15,23],kurtosi:[4,23],kurtosiscoeff:4,l1786:15,l1824:15,l347:15,l368:15,lack:23,larg:23,later:19,latest:[24,27],layout:4,least:[4,19,23,25],leav:[4,19],left:19,len:9,level:23,leverag:4,librari:23,like:[15,20,21,22,28],line:[15,21,28],linear:4,linearli:24,link:[20,27],linux:[22,23,24],list:[9,10,14,15,18,19,20],literatur:24,live:24,load:[19,23],local:22,locat:[4,15,19,20,22],logic:4,longer:24,longitudin:23,loop:4,love:24,low:13,lower:4,lsb_releas:20,mac:[22,23,24],machin:[19,28],made:22,mai:[19,20,22,23,24,27,28,29],main:[16,27],mainli:13,maintain:13,make:[11,21,22,23,24],make_se_epi:11,make_simple_mif:11,makeplot:14,makesnr:14,manag:[20,28],mani:19,manipul:[9,10,19],manufactur:18,manupul:19,map:[4,7,10,12,14,24,29],mark:4,mask:[4,7,13,14],maskpath:14,matrix:[4,9,15],matter:4,max:[4,12,13],maxb:4,maxbval:4,maximum:[4,10,19],maxit:4,maxp:4,maxumum:4,mean:4,measur:4,mechan:23,median:[4,7],meet:25,memori:[4,10,19,24],menu:19,messag:[10,20],metadata:15,method:[0,4,14,21,27],metric:[4,10,24],microsoft:[19,23,29],microstructur:13,mif:[9,10,11,24],miftonii:10,might:13,min:4,miniconda:28,minim:[4,24],minimum:24,miss:[15,20],mkt:4,mode:[4,22],model:4,modul:[7,24,29],mojav:19,moor:4,more:[9,19,20,22,28],most:[23,27],move:[4,23],mrconvert:15,mrdegibb:10,mri:[4,24,25],mrinfo:[9,26],mrinfoutil:9,mrpreproc:10,mrtrix3:[4,9,10,15,22,23,24,29],mrtrix:[4,9,11],multi:10,multipl:[19,28],multipli:[4,9],multiplymask:4,multiprocess:4,must:21,mystic:4,n_vector:15,name:[4,10,15,21,22,28],nan:13,nansmooth:13,nativ:[19,22,23,29],nbin:14,ndarrai:15,ndim:9,ndir:4,ndwi:15,need:[4,14,19,22,23,27,28],neuodock:22,neurdock:22,neurodock:[19,20,24,29],neurolabusc:15,newlin:11,next:[22,28],nif:10,nifti:[4,7,10,14,15,22],nii:[10,13,15,22,24],nii_preprocess:15,niitomif:10,nois:[10,12,14],noisemap:[10,12],noisemapnam:12,noisepath:14,non:[10,14,19],none:[4,7,10,11,12,13,14,18],norm:4,notabl:24,note:27,now:[20,21,22,23],npe:9,nthread:[4,10],number:[4,9,10,12,13,14,15,19,21,24],number_of_dir:4,number_of_voxel:[4,14],numer:9,nummber:24,numpi:[4,7,14],nupi:7,nvidia:[19,24],nvoxel:4,nyu:[4,24],obj:[11,12,13],object:[4,12,13,14,15],occur:[4,13],offer:15,offici:20,offset:[4,9],okai:23,older:20,onc:[20,28],one:[9,21,22,23],onli:[4,10,13,15,29],onto:9,open:[21,27],oper:[4,13,19,23,24],oppos:10,optim:[4,10],optimum:4,option:[12,13,14,19,21,22],order:[4,13,14],origin:15,other:[20,21,22,23,25],otherwis:[18,22],out:[4,12,13],outdir:4,outlier:[4,24],outnam:13,outpath:12,output:[4,7,9,10,15,20,22,26],output_directori:4,over:4,overflow:4,overkil:15,overwrit:[10,11,15],own:19,packag:[20,23,24,27,28],page:[19,20,22,24,25,26,28],panic:20,parallel:[4,24],paramet:[4,10,14,19,24],parent:22,parfindviol:4,pars:[15,20],part:19,partial:15,particularli:22,pass:[9,24],path:[7,9,10,12,14,15,21,22],pathnam:15,penros:4,percentag:4,perform:[4,9,10,12,14,23,27,29],person:21,peschem:9,phase:[9,10],pip:[24,27,28],pipelin:[4,15,16,22,23,24],plan:19,platform:[19,23,24,29],pleas:[19,20,29],plot:14,png:14,point:[4,23],posit:4,possibl:15,post:[24,27],postprocess:7,powershel:20,pre:[21,24,27],prebuilt:21,precis:4,prefer:28,preicison:4,prepar:[11,23],preprocess:[9,10,11,12,13,14,15,24,28],present:24,preserv:21,prevent:4,print:[14,15,20],privaci:20,pro:19,probabl:[13,22],proce:[20,28,29],process:[19,20,22,23,24,25,27],produc:[4,15,20],program:4,programm:15,project:[24,28],prompt:20,propag:13,properti:[4,14,20],proport:4,propviol:4,provid:[10,23],pseudoinvers:4,pull:[20,21],purg:20,purpos:[14,19],put:12,pyd:[25,27,28,29],pydesgin:21,pydesign:[10,11,15,16,21,22,23,25,28],pyesign:21,pypi:28,python:[9,18,24,27,29],quadrat:4,qualiti:24,quantifi:4,question:4,raden:19,radial:4,radialsampl:4,radiansampl:4,ram:[4,19,24],random:4,rang:[4,10],rapid:23,rather:23,reach:4,read:[7,20,22],readi:28,readnii:7,real:4,recent:27,recommend:[13,19,21,24,25,28,29],reduc:[4,10,13,15],refer:[15,20,22,28],referec:21,referenc:21,reflect:22,regardless:23,regular:21,reiter:21,reject:4,rel:20,releas:[19,27],relev:15,remov:[4,20,23],reorder:4,repat:21,repeatbl:23,repeatibl:23,replac:[4,28],replic:23,repo:21,repositori:[20,21,24,27],repres:[4,14],reproduc:15,requir:[4,14,15,19,23,24,25,28],research:[19,23,24],resourc:[19,23],result:[12,19,23],resum:15,retun:4,revers:10,reweight:4,reweigth:4,rice:13,rician:[10,12],rician_correct:12,rician_img_correct:12,riciancorrect:10,right:19,ring:13,robust:4,rocm:19,root:[21,22,27],rorden:15,row:4,rpe:10,rpe_head:10,run:[4,10,16,19,20,21,23,24,27,28,29],runc:20,runtim:[13,19],ryzen:[19,24],s_hat:4,sai:22,said:[4,22],same:[4,10,19,21,23],sampl:4,save:[7,10,14,15,22,23],scalar:4,scale:24,scanner:4,schedul:19,scheme:[9,22],scientist:24,screen:20,script:[18,21,22,24,27],seamlessli:15,search:24,second:[21,22,28],section:[19,22],see:[22,28],seen:15,self:4,semat:21,sent:20,separ:[15,28],sequenc:19,seri:15,server:20,set:[4,10,18,19,28],setenv:18,setup:27,shape:4,share:[20,23],shat:4,shell:10,shot:24,should:[4,20],show:[19,20],sid:22,side:23,signal:[4,13,14],signific:23,similar:19,similarli:4,simpl:19,simpli:[20,22,27],simplifi:4,simultan:[19,22,28],sinc:[20,22],singl:[11,15,24,28],size:[4,9,10,15,19],skip:28,slack:24,slice:13,small:24,smooth:[10,12,13,14],smooth_imag:13,smoothfactor:14,smoothslic:13,snr:[13,14,24],snr_dwi:14,snrplot:14,softwar:[20,24,25,26],some:[15,23,26],someth:20,soon:4,sort:4,sourc:[21,27],space:[4,9,23],specif:[0,24,28],specifi:[4,10,14,19,22],speed:[23,29],speedier:10,sphere:[4,15],spin:11,split:[10,19],squar:4,stabl:[20,27],stai:21,standard:[4,22],start:[20,22],statist:4,statu:[19,20],step:[19,20,29],stick:22,still:[4,29],storag:[9,19,22,23,24],store:[15,20],str:[9,10,11],straight:21,straightforward:20,stream:20,stride:[9,10],string:[4,9,12,13,14,15,18],struct:15,structur:22,studi:23,subject:[4,22],success:[25,26],successfulli:[20,21],sucess:20,sudo:20,suffici:4,suit:[23,26],sum:4,suppli:28,support:24,suppos:22,suppress:13,sure:28,surfac:23,swap:19,syntax:22,sysem:19,syst:19,system:[10,18,19,20,22,23,24,29],systemtool:18,tab:[19,27],tabl:4,tace:20,tagnam:21,target:[20,22],task:4,taskbar:[19,20],techniqu:24,technolog:23,tenor:4,tensor:[4,29],tensorreord:4,tensortyp:4,termin:[20,27],test:[4,19,21,25,27,28],text:20,than:[9,23],thei:[14,15,20,21],them:[15,19,28],therebi:23,therefor:4,thi:[4,7,10,12,13,14,15,19,20,21,22,23,24,27,28],those:[4,15],thread:10,three:[4,19,29],thresh:10,threshold:[4,10],through:[22,24],thsi:15,time:[19,22,23],toggl:4,ton:23,took:20,tool:[9,10,15,23,25,28],topup:[10,11],topupboost:10,tortuos:4,toward:23,trace:[4,20],track:11,tract:4,transform:[9,22],transport:20,tty:22,tupl:9,two:[10,21,23,28],type:[4,9,24],typic:13,uberscript:15,ubuntu:[19,20,24],unconstrain:4,under:4,understand:22,undistort:10,uniqu:14,unix:29,unless:4,unlik:23,unpatch:[4,14],unzip:27,updat:[4,20],uplift:23,upon:15,upper:4,use:[4,10,12,19,22,24,28],used:[9,10,13,14,15,22,25],user:[20,21,22,23,24,28],uses:11,using:[4,9,10,14,21,22,24,28],util:[9,10,11,15,19],val:14,valid:[15,19,26],valu:[4,9,13,14,19,25],variabl:[18,19],varietri:19,variou:[9,10,14,20,23],vastli:23,vec:[4,14],vecs_are_fullspher:15,vector:[4,14,15],vega:19,verbos:[10,15],verfii:20,veri:19,verifi:20,version:[12,13,20,21,23,25,26,27,28],via:[15,19,20,24],video:19,violaion:4,violat:4,virtual:28,visibl:22,visit:[19,20,22,25],volum:[4,12,13,14,15],voxel:[4,9,12,13,24],w1111:4,w1112:4,w1113:4,w1122:4,w1123:4,w1133:4,w1222:4,w1223:4,w1233:4,w1333:4,w2222:4,w2223:4,w2233:4,w2333:4,w3333:4,wai:[19,21,22,23],wait:21,warmup:4,warn:[4,13,20],watch:22,water:4,weight:[4,9],well:28,whale:20,what:[4,22],when:[4,15,22,27],where:[4,12,13,14,15,20,21,22],whether:[4,10,14,15,18,20,23],which:[4,13,20,22],white:4,whitespac:11,who:21,whole:23,wide:19,width:[4,10,12,13],window:[4,10,22,23,24],wish:21,within:[4,22],without:15,wll:[4,13],wmti:4,wonder:22,work:[19,20,21,24],worker:10,workflow:20,world:20,would:[21,22],wrap:[12,13],write:[4,7,11,12,13,22],writenii:[4,7],written:[7,13],x_hat:4,xeon:19,you:[15,19,20,21,22,23,24,27,28,29],your:[4,15,19,20,21,22,25,27,28],yourself:21,zip:27},titles:["API Documentation","<no title>","designer.fitting package","<no title>","<no title>","<no title>","designer.postprocessing package","<no title>","designer.preprocessing package","<no title>","<no title>","<no title>","<no title>","<no title>","<no title>","<no title>","<no title>","designer.system package","<no title>","Docker Configuration","Docker Installation","Install NeuroDock","Run NeuroDock","NeuroDock","Welcome to the official PyDesigner documentation","FSL","MRtrix3 Installation","PyDesigner","Python","PyDesigner Requirements"],titleterms:{"new":28,all:22,api:0,bind:22,build:21,conda:28,configur:19,creat:28,design:[2,6,8,17],docker:[19,20,21,22,23],document:[0,24],download:[27,28],engin:20,environ:28,fit:2,fsl:25,gpu:19,hub:21,indic:24,insal:28,instal:[20,21,26,27],intro:22,linux:[19,20,29],local:21,mac:[19,20,29],machin:23,mount:22,mrtrix3:26,neurodock:[21,22,23],offici:24,packag:[2,6,8,17],postprocess:6,practic:22,prefer:19,preprocess:8,put:22,pydesign:[24,27,29],python:28,requir:29,run:22,submodul:[2,6,8,17],support:19,system:17,tabl:24,togeth:22,uninstal:20,updat:28,user:29,virtual:23,welcom:24,why:23,window:[19,20,29]}}) \ No newline at end of file diff --git a/docsrc/api/api.rst b/docsrc/api/api.rst new file mode 100644 index 00000000..05209b0d --- /dev/null +++ b/docsrc/api/api.rst @@ -0,0 +1,9 @@ +API Documentation +================= + +Information on specific functions, classes, and methods. + +.. toctree:: + :glob: + + api/* \ No newline at end of file diff --git a/docsrc/api/designer.fitting.dwidirs.rst b/docsrc/api/designer.fitting.dwidirs.rst new file mode 100644 index 00000000..1a35bc8f --- /dev/null +++ b/docsrc/api/designer.fitting.dwidirs.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.fitting.dwidirs + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.fitting.dwipy.rst b/docsrc/api/designer.fitting.dwipy.rst new file mode 100644 index 00000000..51292f94 --- /dev/null +++ b/docsrc/api/designer.fitting.dwipy.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.fitting.dwipy + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.fitting.rst b/docsrc/api/designer.fitting.rst new file mode 100644 index 00000000..a211e69e --- /dev/null +++ b/docsrc/api/designer.fitting.rst @@ -0,0 +1,15 @@ +designer.fitting package +======================== + +.. automodule:: designer.fitting + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.fitting.dwidirs + designer.fitting.dwipy diff --git a/docsrc/api/designer.info.rst b/docsrc/api/designer.info.rst new file mode 100644 index 00000000..0640ec2a --- /dev/null +++ b/docsrc/api/designer.info.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.info + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.postprocessing.filters.rst b/docsrc/api/designer.postprocessing.filters.rst new file mode 100644 index 00000000..bf3d4802 --- /dev/null +++ b/docsrc/api/designer.postprocessing.filters.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.postprocessing.filters + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.postprocessing.rst b/docsrc/api/designer.postprocessing.rst new file mode 100644 index 00000000..2b9f0fef --- /dev/null +++ b/docsrc/api/designer.postprocessing.rst @@ -0,0 +1,14 @@ +designer.postprocessing package +=============================== + +.. automodule:: designer.postprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.postprocessing.filters diff --git a/docsrc/api/designer.preprocessing.mrinfoutil.rst b/docsrc/api/designer.preprocessing.mrinfoutil.rst new file mode 100644 index 00000000..60dbcd09 --- /dev/null +++ b/docsrc/api/designer.preprocessing.mrinfoutil.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.mrinfoutil + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.mrpreproc.rst b/docsrc/api/designer.preprocessing.mrpreproc.rst new file mode 100644 index 00000000..86987655 --- /dev/null +++ b/docsrc/api/designer.preprocessing.mrpreproc.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.mrpreproc + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.preparation.rst b/docsrc/api/designer.preprocessing.preparation.rst new file mode 100644 index 00000000..751b1266 --- /dev/null +++ b/docsrc/api/designer.preprocessing.preparation.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.preparation + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.rician.rst b/docsrc/api/designer.preprocessing.rician.rst new file mode 100644 index 00000000..5d23d6f8 --- /dev/null +++ b/docsrc/api/designer.preprocessing.rician.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.rician + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.rst b/docsrc/api/designer.preprocessing.rst new file mode 100644 index 00000000..c4382851 --- /dev/null +++ b/docsrc/api/designer.preprocessing.rst @@ -0,0 +1,20 @@ +designer.preprocessing package +============================== + +.. automodule:: designer.preprocessing + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.preprocessing.mrinfoutil + designer.preprocessing.mrpreproc + designer.preprocessing.preparation + designer.preprocessing.rician + designer.preprocessing.smoothing + designer.preprocessing.snrplot + designer.preprocessing.util diff --git a/docsrc/api/designer.preprocessing.smoothing.rst b/docsrc/api/designer.preprocessing.smoothing.rst new file mode 100644 index 00000000..4efdecc9 --- /dev/null +++ b/docsrc/api/designer.preprocessing.smoothing.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.smoothing + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.snrplot.rst b/docsrc/api/designer.preprocessing.snrplot.rst new file mode 100644 index 00000000..1a8df83a --- /dev/null +++ b/docsrc/api/designer.preprocessing.snrplot.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.snrplot + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.preprocessing.util.rst b/docsrc/api/designer.preprocessing.util.rst new file mode 100644 index 00000000..6ab0aa26 --- /dev/null +++ b/docsrc/api/designer.preprocessing.util.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.preprocessing.util + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.pydesigner.rst b/docsrc/api/designer.pydesigner.rst new file mode 100644 index 00000000..d3b44351 --- /dev/null +++ b/docsrc/api/designer.pydesigner.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.pydesigner + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.rst b/docsrc/api/designer.rst new file mode 100644 index 00000000..556a3df7 --- /dev/null +++ b/docsrc/api/designer.rst @@ -0,0 +1,4 @@ +.. automodule:: designer + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/api/designer.system.rst b/docsrc/api/designer.system.rst new file mode 100644 index 00000000..5da5b3da --- /dev/null +++ b/docsrc/api/designer.system.rst @@ -0,0 +1,14 @@ +designer.system package +======================= + +.. automodule:: designer.system + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + designer.system.systemtools diff --git a/docsrc/api/designer.system.systemtools.rst b/docsrc/api/designer.system.systemtools.rst new file mode 100644 index 00000000..937d9f6c --- /dev/null +++ b/docsrc/api/designer.system.systemtools.rst @@ -0,0 +1,4 @@ +.. automodule:: designer.system.systemtools + :members: + :undoc-members: + :show-inheritance: diff --git a/docsrc/conf.py b/docsrc/conf.py index 35005919..813a13af 100644 --- a/docsrc/conf.py +++ b/docsrc/conf.py @@ -21,7 +21,7 @@ # -- Project information ----------------------------------------------------- project = 'PyDesigner' -copyright = '2020, Siddhartha Dhiman, Joshua Teves, Kayti Keith' +copyright = '2020, MUSC Advanced MRI Analysis (MAMA)' author = 'Siddhartha Dhiman, Joshua Teves, Kayti Keith' # The full version, including alpha/beta/rc tags @@ -36,6 +36,7 @@ extensions = [ 'sphinx.ext.githubpages', 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', 'sphinx_rtd_theme' ] @@ -45,7 +46,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ['../docs', 'api/yourpackage.rst'] # -- Options for HTML output ------------------------------------------------- diff --git a/docsrc/docker/docker_configuration.rst b/docsrc/docker/docker_configuration.rst new file mode 100644 index 00000000..142c74a4 --- /dev/null +++ b/docsrc/docker/docker_configuration.rst @@ -0,0 +1,117 @@ +Docker Configuration +==================== + +Docker can be configured in a wide-varietry of ways based on hardware +resources available. Parameters such as CPU cores, RAM and storage can +be assigned to Docker for running NeuroDock. + +For validations purposes, the NeuroDock image was tested to work as +intended on the following three systems: + +.. csv-table:: + :header: "Part", "Machine A", "Machine B", "Machine C" + + "Build", "Apple iMac Pro", "Custom", "Custom" + "OS", "Mac OS X Mojave", "Ubuntu 18.04", "Microsoft Windows 10 Pro" + "CPU", "Intel Xeon W [8C/16T]", "AMD Ryzen R9 2700X [8C/16T]", "AMD Ryzen R9 2700X [8C/16T]" + "Memory", 64 GB, 16 GB, 16 GB + "Video", Raden Pro Vega 56 8 GB, Nvidia GTX 1080 8 GB, Nvidia GTX 1080 8 GB + +We found identical results across the three operating systes on all +these configurations. + +Docker Preferences +------------------ + +Based on Docker's system requirements, we recommend assigning the +following sysem resources to Docker: + +.. csv-table:: + :header: "Parameter", "Value" + + "CPUs", 8 + "Memory", 16.00 GB + "Disk image size", 32.00 GB + +By default, Docker assigns itself half the number of available +CPU cores and 2 GB of memory. Considering that the entire NeuroDock +image is ~14.5 GB, we recommend at least double in disk image size. +You may configure your Docker Engine to run on this configuration, or +input your own values based on your processing needs. The following +sections detail how to set these parameters. + +Linux +~~~~~ + +CPU and memory access to Docker containers on Linux machines is +manipulated via CFGS scheduler flags at run time. These flags are: + +.. csv-table:: + :header: "Flag", "Description" + + :code:`--cpus=`, specify how many CPU cores to use + :code:`-m` or :code:`--memory`, specify the maximum amount of memory available to containers + +For a more comprehensive list of manupulable system parameters for +for Linux, please visit the `Runtime options with Memory, CPUs, and GPUs`_ +page on Docker documentation. + +.. _Runtime options with Memory, CPUs, and GPUs: https://docs.docker.com/config/containers/resource_constraints/ + +Mac OS +~~~~~~ + +Manipulating these three variables is very simple on Mac OS because +these parameters are located in the GUI. + +1. On the Docker icon in the status bar, right-click on the Docker +icon, then **Preferences**. + +2. Click on the **Resources** tab on the left + +.. figure:: /images/Docker_Mac_resources.png + :scale: 75 % + :align: center + + Docker Mac preferences GUI; click on resources + +3. The **Resourcs** menu will show you the configuration, please +change them to desired valus. You may leave "Swap" at default. + +.. figure:: /images/Docker_Mac_configs.png + :scale: 75 % + :align: center + + Docker Mac resources configuration + + +Windows +~~~~~~~ + +Similar to the Mac, the same sequence of steps apply for the Windows +platform. + +1. Right-click on the Dpcker icon in the taskbar, then click on +**Preferences**. + +2. Clock on the **Resources** tab on the left. + +.. figure:: /images/Docker_Win_configs.png + :scale: 75 % + :align: center + + Docker Windows preferences GUI; configure as desired + +3. The **Resourcs** menu will show you the configuration, please +change them to desired valus. You may leave "Swap" at default. + +Setting the correct configuration will force Docker to not exceed +these constraints. By splitting up CPU and memory loads, researchers +can process multiple DWIs simultaneously. + +GPU Support +----------- + +At this time, there is no CUDA or ROCm GPU support. These feature are +planned for a later release. Please use the non-Docker, native Linux +configuration to utilize GPU for eddy and EPI correction. diff --git a/docsrc/docker/docker_install.rst b/docsrc/docker/docker_install.rst new file mode 100644 index 00000000..cbf858c4 --- /dev/null +++ b/docsrc/docker/docker_install.rst @@ -0,0 +1,191 @@ +Docker Installation +=================== + +Docker is relatively straightforward to install and run. +Windows and Mac users are able to install Docker like any other +GUI-based software package installtion. The installation is not +dependent on console arguments, like Linux. + +Please efer to the instructions below for links and guide. + +Linux +----- + +Users may refer to the Docker Engine installation guide located +`here`_, for installation instructions on their Linux disribution. the +steps covered below are targeted for Debian-based or Ubuntu +distributions. + +.. _here: https://docs.docker.com/install/linux/docker-ce/ubuntu/ + +Uninstall Docker +~~~~~~~~~~~~~~~~ + +1. Uninstall older version or any traces of existing Docker +installations + +.. code-block:: console + + $ sudo apt-get remove docker docker-engine docker.io containerd runc + +Don't panic if :code:`apt-get` returns an a warning about missing +packages. It's good they are missing, since we're trying to purge +existing installations of Docker + +Install Docker Engine +~~~~~~~~~~~~~~~~~~~~~ + +Once all taces of existing Docker installation and dependencies have +been purged, you may proceed with the following steps to install the +Docker Engine - Community. + +1. Update the debian package list with: + +.. code-block:: console + + $ sudo apt-get Update + +2. Install basic packages that enable installation of Docker Engine +and its dependencies with: + +.. code-block:: console + + $ sudo apt-get install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common + +3. Add the Docker official GNU Privacy Guard (GPG) key to enable +encryption and decryption of communication with the Docker server: + +.. code-block:: console + + $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + + +You may verify this key by following the full guide on official Docker +documentation, the link to which is located at the beginning of this +page. + +4. Add the stable Docker Engine repository to your package list with +the command: + +.. code-block:: console + + $ sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" + +Adding a repository to your Linux distribution allows the OS to pull +software packages from the developers' servers. It directs the OS to +the location where these packages are stored. + +Then, update your package manager repository with the command: + +.. code-block:: console + + $ sudo apt-get update + +This updates the list of softwares your OS can fetch from various +repositories. + +5. Once your Debian-based system becomes aware of the Docker Engine, +you may install it simply via the command: + +.. code-block:: console + + $ sudo apt-get install docker-ce docker-ce-cli containerd.io + +6. Verify your Docker Engine installation with the command: + +.. code-block:: console + + $ sudo docker run hello-world + +If the following information prints in the console window, your Docker +Engine installation was sucessful. + +.. code-block:: console + :linenos: + + Hello from Docker! + This message shows that your installation appears to be working correctly. + + To generate this message, Docker took the following steps: + 1. The Docker client contacted the Docker daemon. + 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. + (amd64) + 3. The Docker daemon created a new container from that image which runs the + executable that produces the output you are currently reading. + 4. The Docker daemon streamed that output to the Docker client, which sent it + to your terminal. + + To try something more ambitious, you can run an Ubuntu container with: + "$ docker run -it ubuntu bash" + + Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + + For more examples and ideas, visit: + https://docs.docker.com/get-started/ + +You may now proceed with the fetching of NeuroDock Docker image. + + +Mac OS +------ + +1. Download Docker `Docker Desktop for Mac`_. + +.. _Docker Desktop for Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/ + +2. Double-click on the downloaded `Docker.dmg` to start the install +process. Follw all on-screen instrcutions and prompts. + +3. Docker should start automatically, indicated by the whale icon in +the status bar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in Terminal: + +.. code-block:: console + + $ docker version + +Or you may run the `hello-world` container to verify the installation: + +.. code-block:: + + $ docker run hello-world + +If you information text being printed into the PowerShell windows, +then Docker has been installed successfully. + + +Windows +------- + +1. Download `Docker Desktop for Windows`_. + +.. _Docker Desktop for Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows/ + +2. Double-click the `Docker for Windows Installer` to run the +installer. + +3. Docker should start automatically, indicated by the whale icon in +the taskbar. Alternatively, you may verfiy whether Docker is running +by parsing the following command in PowerShell. + +.. code-block:: console + + $ docker version + +Or you may run the `hello-world` container to verify the installation: + +.. code-block:: + + $ docker run hello-world + +If you information text being printed into the PowerShell windows, +then Docker has been installed successfully. \ No newline at end of file diff --git a/docsrc/docker/docker_neurodock.rst b/docsrc/docker/docker_neurodock.rst new file mode 100644 index 00000000..20e6e5b9 --- /dev/null +++ b/docsrc/docker/docker_neurodock.rst @@ -0,0 +1,71 @@ +Install NeuroDock +================= + +Aftet successfully installing and configuring docker, you can install +the NeuroDock container in one of two ways: + +1. Pulling pre-build image from Docker Hub with :code:`docker pull [image]` +2. Building the image yourself with :code:`docker build [path to image]` + +The first option is the recommended method because prebuilt images are +guaranteed to work and enhance repatibility even further. In additon, +they are numbered version-controlled for referencing. Your copy +of NeuroDock will be configured exactly the same other another +person's. + +The second option is intended for devopers who make frequent changes +to the PyDesigner source code and wish to test their changes in a +Docker environment. The Dockerfile script is designed to build a +Docker image using PyDesigner in the root directory of the repository. + +Docker Hub +---------- + +Pulling pre-built NeuroDock is incredibly straight forward. Run the +following command to pull NeuroDock. + +.. code-block:: console + + $ docker pull docker pull dmri/neurodock:tagname + +where :code:`tagname` is the version you'd like to pull. To install +NeuroDock v0.2, you would run the command + +.. code-block:: console + + $ docker pull dmri/neurodock:v0.2 + +And that's it! All you have to do now is to wait for the NeuroDock +image to finish downloading. + +Local Build +----------- + +**Disclaimer** + It must be reiterated that this option is preserved for developoers; + regular users are encoruaged to stay away from this method because + there is no sematic versioning to referece. + +1. Open up a command line interface and change directory to your +PyDesigner repository + +.. code-block:: console + + $ cd [PyDesginer Repo Path] + +2. To build a Docker image using your local PyDesigner copy, run the +command: + +.. code-block:: console + + $ docker build -t [tagname] . + +Here, :code:`tagname` can be any name you wish to give this image. If +you wish to build an image called neurodock, run the command: + +.. code-block:: console + + $ docker build -t neurodock . + +This will build a Docker image called NeuroDock based on your local +Pyesigner repository. diff --git a/docsrc/docker/docker_neurodock_run.rst b/docsrc/docker/docker_neurodock_run.rst new file mode 100644 index 00000000..02aad165 --- /dev/null +++ b/docsrc/docker/docker_neurodock_run.rst @@ -0,0 +1,133 @@ +Run NeuroDock +============= + +Congratulations, you've come this far. You've installed Docker and +NeuroDock, and are probably wondering how what else to do... + +**You're done. Not even kidding!** You can now start processing data +with PyDesigner and NeuroDock. It's almost as if FSL, MRtrix3 and +PyDesigner commands are built natively into your OS - be it Linux, +Mac OS, or even Windows! + +Intro to Docker Run +------------------- + +Use the following form of :code:`docker run` command to call all +command made availble by NeuroDock: + +.. code-block:: console + + $ docker run [OPTIONS] IMAGE [COMMAND] [ARG...] + +where, + +.. csv-table:: + :header: "Flag", "Definition" + + :code:`[OPTIONS]`, "docker options to use when running the container; common options are :code:`-it`, :code:`-v`, :code:`-d`" + :code:`IMAGE`, "image name to run; in this instance, this is :code:`dmri/neurodock`" + :code:`[COMMAND]`, "specify which NeuroDock commands to run; these can be FSL, MRtrix3 or PyDesigner commands" + :code:`[ARG]`, "arguments for :code:`[COMMAND]`" + + +Users are encouraged to visit the `Docker run reference`_ documentation +for more information on controlling the :code:`docker run ` command. + +.. _Docker run reference: https://docs.docker.com/engine/reference/run/ + +Practical Run +------------- + +The section above convered a generic way to use the :code:`docker run` +command. For actual data analysis, we use the following options. + +1. :code:`-it --rm` to run docker in interative TTY mode. What this +implies is that your NeuroDock command will run like any other OS +commands such as :code:`ipconfig`, :code:`watch`, :code:`ls` etc. + +2. :code:`-v` to mount the file system or folder to processing + +Bind Mount +~~~~~~~~~~ + +The second flag. :code:`-v`, makes visible the host's local filesystem +to a Docker container, which otherwise runs in a completely isolated +system. By mounting a folder for NeuroDock, you are able to make it +process data in said folder. The general guideline is to mount one +subject folder at a time. It is advisable that users read through +`Docker's bind mounts`_ to understand how Docker containers handle +storage. + +.. _Docker's bind mounts: https://docs.docker.com/storage/bind-mounts/ + +The correct syntax for the :code:`-v` flag is: + +.. code-block:: console + + -v [HOST PATH TO MOUNT]:[v] + +Suppose a subject folder :code:`bond_007` in need of processing is +structured the following way: + +| bond_007 +| │ +| ├── nifti +| │ ├── bond_dwi.bval +| │ ├── bond_dwi.bvec +| │ ├── bond_dwi.bval +| │ ├── bond_dwi.json +| │ ├── bond_topup.json +| │ └── bond_topup.nii +| │ +| └── processed (empty dir) + +This subject needs to be processed PyDesigner read the input nifti +files in the :code:`nifti` directory, and saves the outputs in the +:code:`processed` directory. Since both :code:`nifti` and +:code:`processed` folders belong to a common parent directory, the +:code:`bond_007` directory can be mounted to give NeurDock access to +both child directories simultaneously. + +Here, the directory :code:`bond_007` is the :code:`[HOST PATH TO MOUNT]`, +the directory that NeuroDock will not be able to see. + +Next, we need to define where within the container this directory is +mounted, :code:`[TARGET AT WHICH TO MOUNT]`. You may simply mount this +in the root NeuroDock directory at :code:`/data`. + +The flag to reflect this would then be: + +.. code-block:: console + + -v /Users/sid/Desktop/bond_007:/data + +This would make the contents of host directory :code:`bond_007` +available in the NeuroDock at :code:`\data`. Say, for example, the +nifti file :code:`bond_dwi.nii`, is located in the host system at +:code:`/Users/sid/Desktop/bond_007/nifti/bond_dwi.nii`. If the above +mounting scheme is used, the NeuroDock container will see this file in +:code:`/data/nifti/bond_dwi.nii` + +This filesystem transformation is particularly important when writing +scripts for automatic or batch processing of subject directories using +the NeuroDock container. + +Put it all together +~~~~~~~~~~~~~~~~~~~ + +Considering everything on this page, it becomes incredibly easy to +process a subject using the NeuoDock container. Sticking to +:code:`bond_007` example above, and combining everthing so far, one +could process Mr. Bond's DWI with the command: + +.. code-block:: console + + $ docker run -it --rm -v /Users/sid/Desktop/bond_007:/data \ + dmri/neurodock pydesigner --standard \ + --output /data/processed \ + /data/nifti/bond_dwi.nii,/data/nifti/bond_topup.nii + +This command runs the :code:`--standard` PyDesigner pipeline on +the input files :code:`/Users/sid/Desktop/bond_007/nifti/bond_dwi.nii` +and :code:`/Users/sid/Desktop/bond_007/nifti/bond_topup.nii`, and +saves all outputs into the directory :code:`Users/sid/Desktop/bond_007/processed` diff --git a/docsrc/docker/introduction.rst b/docsrc/docker/introduction.rst new file mode 100644 index 00000000..fb7cb7da --- /dev/null +++ b/docsrc/docker/introduction.rst @@ -0,0 +1,64 @@ +NeuroDock +===================== + +Docker is a contaner technology desgned to package an application and +all its needs, such as libraried and other dependencies, into one +package. We adapted PyDesigner and its dependencies for compatibility +with the Docker Engine to bring DTI/DKI analyses to every one. + +We bring you, `NeuroDock`_ + +.. _NeuroDock: https://hub.docker.com/r/dmri/neurodock + +.. image:: /images/NeuroDock_Logo.png + :align: center + :width: 256pt + +.. image:: /images/MUSC_TAG_00447c.png + :align: center + :width: 128pt + +NeuroDock is a Docker image containing the most cutting-edge tools +required for diffusion and kurtosis imaging. This container was +designer for complete dMRI processing pipelines to be platform +agnostic. NeuroDock was inspired by the lack of easily-accessible +tools across various platforms. NeuroDock is 100% compatible across +Windows, Linux, and Mac - while making available the full suite of +FSL, MRtrix3 and PyDesigner commands. + + +Why Docker +---------- + +By packaging fixed versions of FSL, MRtrix3, and PyDesigner, we are +able to guarantee repeatbility and concistency across all platforms. +Regardless of whether researchers are running Linux, Windows, or Mac +OS, identical results can be replicated with Docker technology. + +A side-effect to ensuring repeatiblity with Docker is that it becomes +host operating system (OS) agnostic. This allows users to run FSL, +MRtrix3, or PyDesigner commands at near-native speed, even on +Microsoft Windows. + +Additionally, researchers can easily deploy Docker containers to HPCs +for rapid processing of large-cohort or longitudinal studies with +ease. + +Docker vs Virtual Machines +-------------------------- +Okay, so you may ask, "why not just load up a VM?". You have a point. +While the two technologies appear to be behaving the same way, at +least on the surface level, their inner mechanisms are differ vastly. + +Unlike a VM, rather than creating a whole virtual OS loaded with +dependencies and other applications, Docker allows applications to +share the same OS kernel, thereby providing a significant performance +uplift while saving up storage space. With the removal of an entire +guest OS in VMs, Docker containers save tons of computational +resources that can be diverted towards better performance. + +Now that you know some differences, it is time to move on to preparing +the Docker image! + + + diff --git a/docsrc/index.rst b/docsrc/index.rst index e599586e..7613eb7b 100644 --- a/docsrc/index.rst +++ b/docsrc/index.rst @@ -61,6 +61,20 @@ Slack channel`_ for live support. .. _Issues: https://github.com/m-ama/PyDesigner/issues .. _M-AMA Slack channel: https://join.slack.com/t/m-ama/shared_invite/enQtOTUyOTU0MTQ1OTQxLTQwOGZlMzI4YmY2YTUxOWY2NmYxMjgwM2E4ODdkNmU3MGYyMjFiMThlYTIwOGQyNzEzMTAzYTZmMmMyM2NjNTc +**System Requirements** + Parallel processing in PyDesigner scales almost linearly with the + nummber of CPU cores present. The application is also memory-intensive + due to the number of parameter maps being computed. + + Based on this evaluation, for processing a single DWI using + PyDesigner, we recommend the following minimum system specifications: + + - Ubuntu 18.04 + - Intel i7-9700 or AMD Ryzen 1800X [8 cores] + - 16 GB RAM + - 12 GB free storage + - Nvidia CUDA-enabled GPU + .. toctree:: :maxdepth: 1 :caption: Installation @@ -71,7 +85,26 @@ Slack channel`_ for live support. installation/python installation/pydesigner +.. toctree:: + :maxdepth: 1 + :caption: NeuroDock (Docker) + + docker/introduction + docker/docker_install + docker/docker_configuration + docker/docker_neurodock + docker/docker_neurodock_run + +.. toctree:: + :maxdepth: 4 + :caption: List of Functions + + modules/modules + +.. autosummary:: + :toctree: modules + Indices and tables ================== diff --git a/docsrc/installation/fsl.rst b/docsrc/installation/fsl.rst index 587bd96b..758adf7e 100644 --- a/docsrc/installation/fsl.rst +++ b/docsrc/installation/fsl.rst @@ -15,7 +15,7 @@ To check your FSL version: .. code-block:: console - flirt -version + $ flirt -version A return value of at least :code:`FLIRT version 6.0` indicates successful installation of FSL, and that meets the PyD requirement. diff --git a/docsrc/installation/pydesigner.rst b/docsrc/installation/pydesigner.rst index 92e1be43..95e3765a 100644 --- a/docsrc/installation/pydesigner.rst +++ b/docsrc/installation/pydesigner.rst @@ -16,7 +16,7 @@ To clone the PyDesigner repository, in terminal, run: .. code-block:: console - git clone https://github.com/m-ama/PyDesigner.git + $ git clone https://github.com/m-ama/PyDesigner.git Install ------- @@ -26,7 +26,7 @@ followed by .. code-block:: console - pip install . + $ pip install . This will execute the :code:`setup.py` script in root directory to automatically configure your Python environment for PyDesigner. When diff --git a/docsrc/installation/python.rst b/docsrc/installation/python.rst index e4a27320..5b6b2d35 100644 --- a/docsrc/installation/python.rst +++ b/docsrc/installation/python.rst @@ -27,7 +27,7 @@ First, update conda with .. code-block:: console - conda update conda + $ conda update conda Create new environment ---------------------- @@ -44,10 +44,10 @@ in this guide with any name of your choice. Next, execute the following two line to create a Python environment ready for PyD installation. -.. code-block:: python +.. code-block:: console - conda create -n dmri python=3.7 - conda install -n dmri pip + $ conda create -n dmri python=3.7 + $ conda install -n dmri pip The first line create an environment with Python v3.7, while the second line installs the PyPi package manager.