在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):markus-nilsson/md-dmri开源软件地址(OpenSource Url):https://github.com/markus-nilsson/md-dmri开源编程语言(OpenSource Language):MATLAB 99.9%开源软件介绍(OpenSource Introduction):Multidimensional diffusion MRIMultidimensional diffusion MRI (MD-dMRI) is a family of conceptually related methods relying on advanced gradient modulation schemes and data processing approaches to simultaneously quantify several microstructural and dynamical properties of tissue by separating their effects on the detected MRI signal into multiple acquisition and analysis dimensions. This GitHub repository mainly contains MATLAB software for analysis of MD-dMRI data, and also some auxiliary routines for setup of acquisition protocols, motion correction, and image visualization. Three families of methods are currently implemented within the framework of MD-dMRI:
The methods are described briefly here, in some more detail in two review articles,1,2 and more exhaustively in the original publications cited for each method. How to startRun setup_paths in the root folder to put files in the Matlab path. To analyze data, you can use the mdm_fit --data input/data.nii.gz ...
--mask tmp/mask.nii.gz ...
--method dtd_codivide ...
--out tmp/ ...
--xps input/data_xps.mat; The We assume that the data has already been preprocessed before this function is called. Preprocessing should include motion and eddy current correction and potentially smoothing. These steps are also supported by the framework (see below). Construction of the xps or the b-tensor input can be challenging. Some help is provided below. GUIThe function Motion and eddy current correctionConventional motion correction where all data is registered to a volume acquired with b = 0 s/mm2 is implemented in % Options
opt = mdm_opt();
% Connect to the data
s.nii_fn = fullfile(pwd, 'data.nii');
s.xps = mdm_xps_from_bval_bvec('data.bval', 'data.bvec');
% Determine output path
o_path = pwd;
% Write the elastix parameter file
p = elastix_p_affine(200);
p_fn = elastix_p_write(p, 'p.txt');
% Run an extrapolation-based registration
s_registered = mdm_s_mec(s, p_fn, o_path, opt); Now Construction of the xpsThe xps holds all relevant experimental information, i.e., how the experiment was performed. All variables are given in SI-units, and have predetermined names according to this specification. Please see functions Creating an xps based on a single nii file If a single nii file is the basis for the analysis, a single path is used to define its location s.xps = mdm_xps_from_gdir('gdir_filename.txt', b_delta); or s.xps = mdm_xps_from_bval_bvec('bval_filename.bval', 'bvec_filename.bvec', b_delta); depending on what format is used. Note that the files currently do not contain information about the shape of the b-tensor, thus Example: xps from single nii file This example code requires only that the user defines the filename of the nii to create and save the corresponding xps. Note that this assumes that the gdir.txt or .bval/.bvec files are in the same folder an have standardized names. % Define path to nii file
s.nii_ fn = 'path_to_nii.nii';
% We assume that the encoding is linear
b_delta = 1;
% Get path to corresponding gdir, and generate the xps
gdir_fn = mdm_fn_nii2gdir(s.nii_fn, b_delta);
s.xps = mdm_xps_from_gdir(gdir_fn, b_delta);
% Or, get path to corresponding bval/bvec, and generate the xps
[bval_fn, bvec_fn] = mdm_fn_nii2bvalbvec(s.nii_fn);
s.xps = mdm_xps_from_bval_bvec(bval_fn, bvec_fn, b_delta);
% Finally, save the xps.
xps_fn = mdm_xps_fn_from_nii_fn(s.nii_fn);
mdm_xps_save(s.xps, xps_fn) Creating an xps based on multiple nii files In some cases all the necessary data cannot be acquired in a single series, which results in multiple nii files that need to be combined during the analysis. For example, encoding with linear and spherical b-tensors is currently performed in two separate series, but we wish to analyze them simultaneously. In the case when the analysis relies on multiple nii files we first create partial a cell array of partial s structures, and then call Example: xps from multiple nii files This example uses alla the tools form the previous example. It assumes that full filenames are specified to all necessary nii files, and that corersponding gdir.txt or .bval/.bvec files with standardized names are in the same folder (see % Create a cell array of s structures.
s{1}.nii_fn = 'nii_filename_1.nii';
s{2}.nii_fn = 'nii_filename_2.nii';
s{3}.nii_fn = 'nii_filename_3.nii';
% Corresponding b-tensor shapes. In this case: spherical, linear, and planar.
b_deltas = [0 1 -.5];
% Define a name for the merged nii (output)
merged_nii_path = '...\output_directory\';
merged_nii_name = 'merged_nii_name.nii';
% Loop over nii files to create partial xps structures, and store them in the cell array.
for i = 1:numel(file_list)
gdir_fn = mdm_fn_nii2gdir(s{i}.nii_fn);
s{i}.xps = mdm_xps_from_gdir(gdir_fn, [], b_deltas(i));
end
% Merge the s structure, and save the merged nii along with its corresponding xps.mat file.
s_merged = mdm_s_merge(s, merged_nii_path, merged_nii_name);
Get acquainted with by xps structure by reading mdm/readme.txt.An extensive description of the code structure is found at http://markus-nilsson.github.io/md-dmri/. ReferenceMarkus Nilsson, Filip Szczepankiewicz, Björn Lampinen, André Ahlgren, João P. de Almeida Martins, Samo Lasic, Carl-Fredrik Westin, and Daniel Topgaard. An open-source framework for analysis of multidimensional diffusion MRI data implemented in MATLAB. Proc. Intl. Soc. Mag. Reson. Med. (26), Paris, France, 2018. http://archive.ismrm.org/2018/5355.html Method-specific references (to be continued)
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论