Tools for exporting DSIStudio-compatible outputs. Adapted from mattcieslak/dmri_convert/mrtrix_to_dsistudio.py to suit PyDesigner’s needs.
- designer.tractography.dsistudio.convertLPS(input, output)¶
Converts a nifti file to LPS for compatibility with DSIStudio
- Parameters
input (str) – Path to input nifti file; must possess .nii extension
output (str) – Path to output nifti file; must possess .nii extension
- Return type
None, writes out file
- designer.tractography.dsistudio.get_dsi_studio_ODF_geometry(odf_key)¶
Reads DSIStudio’s ODF geometry in odfs.mat
- Parameters
odf_keys (str) – DSIStudio’s direction set to load
- Returns
odf_vertices (array_like(dtype=int)) – ODF vertices
odf_faces (array_like(dtype=double)) – ODF faces
- designer.tractography.dsistudio.makefib(input, output, map=None, mask=None, n_fibers=5, scale=1, other_maps=None)¶
Converts a NifTi
.nii
file containing sh coefficients to a DSI Studio fib fileThis function uses
sh2amp
to get amplitude values for each direction in DSI Studio’sodf8
direction set. These values are masked and loaded into the “odfN” matrices in the fib file.- Parameters
input (str) – Path to input nifti file containing SH coefficients
output (str) – Path to output fib file; must end with .fib
map (str) – Path to dMRI map to control stopping criteria; usually an FA map. This map is stored under variable fa_n (n = 1, 2,…, n ) in .fib file. This maps is visualized by qa in DSI Studio. The peak amplitude response is used if no map is provided
mask (str, optional) – Path to nifti file containing brain mask
n_fibers (int, optional) – The maximum number ODF maxima to extract per voxel (Default: 3)
scale (float; optional) – Affects overall size of odfs in .fib file. This only affects visualization. (Default: 1)
other_maps (list of str; optional) – List containing paths to other metrics maps to include into the .fib file for computing metrics values along tracks. The maps could be AD, AK, MK, AWF, etc. as long as they are the same size as SH coefficient file.
- Return type
None, writes out file