# dipy_fit_mapmri

## Synopsis

Workflow for fitting the MAPMRI model (with optional Laplacian regularization). Generates rtop, lapnorm, msd, qiv, rtap, rtpp, non-gaussian (ng), parallel ng, perpendicular ng saved in a nifti format in input files provided by data_files and saves the nifti files to an output directory specified by out_dir.

In order for the MAPMRI workflow to work in the way intended either the Laplacian or positivity or both must be set to True.

## Usage

    dipy_fit_mapmri [OPTIONS] data_files bvals_files bvecs_files small_delta big_delta

## Input Parameters

- `data_files`

  Path to the input volume.

- `bvals_files`

  Path to the bval files.

- `bvecs_files`

  Path to the bvec files.

- `small_delta`

  Small delta value used in generation of gradient table of provided bval and bvec.

- `big_delta`

  Big delta value used in generation of gradient table of provided bval and bvec.

## General Options

- `--b0_threshold`

  Threshold used to find b0 volumes. (default: 50.0)

- `--laplacian`

  Regularize using the Laplacian of the MAP-MRI basis. (default: True)

- `--positivity`

  Constrain the propagator to be positive. (default: True)

- `--bval_threshold`

  Sets the b-value threshold to be used in the scale factor estimation. In order for the estimated non-Gaussianity to have meaning this value should set to a lower value (b<2000 s/mm^2) such that the scale factors are estimated on signal points that reasonably represent the spins at Gaussian diffusion. (default: 2000)

- `--save_metrics`

  List of metrics to save. Possible values: rtop, laplacian_signal, msd, qiv, rtap, rtpp, ng, perng, parng (default: ())

- `--laplacian_weighting`

  Weighting value used in fitting the MAPMRI model in the Laplacian and both model types. (default: 0.05)

- `--radial_order`

  Even value used to set the order of the basis. (default: 6)

- `--sphere_name`

  Sphere name on which to reconstruct the fODFs. (default: None)

- `--relative_peak_threshold`

  Only return peaks greater than `relative_peak_threshold * m` where m is the largest peak. (default: 0.5)

- `--min_separation_angle`

  The minimum distance between directions. If two peaks are too close only the larger of the two is returned. (default: 25)

- `--npeaks`

  Maximum number of peaks found. (default: 5)

- `--normalize_peaks`

  If true, all peak values are calculated relative to max(odf). (default: False)

- `--extract_pam_values`

  Save or not to save pam volumes as single nifti files. (default: False)

## Output Options

- `--out_dir`

  Output directory. (default: current directory)

- `--out_rtop`

  Name of the rtop to be saved. (default: rtop.nii.gz)

- `--out_lapnorm`

  Name of the norm of Laplacian signal to be saved. (default: lapnorm.nii.gz)

- `--out_msd`

  Name of the msd to be saved. (default: msd.nii.gz)

- `--out_qiv`

  Name of the qiv to be saved. (default: qiv.nii.gz)

- `--out_rtap`

  Name of the rtap to be saved. (default: rtap.nii.gz)

- `--out_rtpp`

  Name of the rtpp to be saved. (default: rtpp.nii.gz)

- `--out_ng`

  Name of the Non-Gaussianity to be saved. (default: ng.nii.gz)

- `--out_perng`

  Name of the Non-Gaussianity perpendicular to be saved. (default: perng.nii.gz)

- `--out_parng`

  Name of the Non-Gaussianity parallel to be saved. (default: parng.nii.gz)

- `--out_pam`

  Name of the peaks volume to be saved. (default: mapmri_peaks.pam5)

- `--out_peaks_dir`

  Name of the peaks directions volume to be saved. (default: mapmri_peaks_dirs.nii.gz)

- `--out_peaks_values`

  Name of the peaks values volume to be saved. (default: mapmri_peaks_values.nii.gz)

- `--out_peaks_indices`

  Name of the peaks indices volume to be saved. (default: mapmri_peaks_indices.nii.gz)

## References

Garyfallidis, E., M. Brett, B. Amirbekian, A. Rokem, S. Van Der Walt, M. Descoteaux, and I. Nimmo-Smith. Dipy, a library for the analysis of diffusion MRI data. Frontiers in Neuroinformatics, 1-18, 2014.