Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
DKI project: PR#1 Simulations to test DKI #582
I add some functions on dipy.sims.voxel module for DKI simulations (multi_tensor_dki, compute_Wijkl, single_diffkurt_tensors, dki_design_matrix). This PR was discussed to be the first milestone of the DKI project. To see how to use the functions please give a look to the added script on doc/examples/simulations_dki.py. Basically, the objective of the new functions is to produce ground truth DT and KT tensors to test diffusion fits (you can simulate tensors for any single voxel crossing fiber configuration ;) ). DW signals are also simulated from the computed tensors using the DKI model. Future steps on the DKI project can use these simulations to check if the DKI implementation is correct. DKI simulations modules are also relevant for DKI fit comparison studies.
Implementation was done according to PEP 8 standards and the nomenclature is consistent to previous dipy functions. However, I notice that the order of DT elements is different from previous dipy modules (as dipy.reconst.dti.py), I decided to keep this order since I notice that they are consistent to the in progress DKI implementations. Perhaps is better to transform all new functions to dipy assumed format - Dxx Dxy Dyy Dxz Dyz Dzz. What do you thing? Please let me know if you need help doing this on the submitted changes after its revision.
…d future bugs, note that the added for inside the function has index i as well (dipy/sims/voxel.py)
…e in the write format. Before this, code was repeated in each type of simulations, thus now the codes are much more easy to read. This helper function will be tested on test modules
… simulations are in the right format (dipy.sims.test.test_voxel.py). Starting dki simulation tests
…of the use of function multi_tensor_dki (DOC); 2) insure that dt and kt are arrays in function single_diffkurt_tensors (BW)
…w total DT and MD can given as input, this can be usefull for applications that need to use compute_Wijkl many times (e.g. if simulations need to be repeated several times)
…o something more meanfull. Functions compute_Wijkl and single_diffkurt_tensor are know namedkurtosis_element and DKI_signal. Variables Dc and mD are named D_comps standingfor Diffusion tensors for individual COMPartmentS. Added documentation for check_directions.
…anges at dipy.sims.voxel. Adding test for testing kurtosis_elements optional inputs. Remove test_dki which is useless
…is update reduces computing time and clarifies DKI requirements). Added also a figure directive
…al simulations (dipy/sims/voxel.py). A change on all_tensor_evecs outputon the master branch caused an bug on line 385 of voxel.py. Matrices are now multiplied in the right order
I just add the example comparing DKI simulations with a simulation using only DTI components. I also add a small paragraph explaining the differences. Please let me know if everything is clear.
I fix the function all_tensor_evecs to return the eigenvectors in column-wise and made the necessary changes on the parts of voxel.py that were calling this function.