Skip to content

MultiTensor simulator interface #1085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 2, 2015

Conversation

oesteban
Copy link
Contributor

An interface to simulate diffusion weighted images (DWIs) using the multi-tensor model included in dipy in a ball-and-stick -like fashion:

  • Up to 3 fibers are simulated with the multi-tensor model
  • Signal is simulated for 3 isotropic compartments (CSF, GM, WM).

Diffusivity of the isotropic compartments and the single-fiber tensor are taken from:

Alexander et al., Detection and modeling of non-Gaussian apparent diffusion coefficient profiles in human brain data, MRM 48(2):331-340, 2002, doi: 10.1002/mrm.10209

@oesteban
Copy link
Contributor Author

It'd be nice if @Garyfallidis or @arokem could give this PR a quick look before merging :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.19%) to 70.3% when pulling 6b00c67 on oesteban:enh/DipyMultiTensorSimulate into c1a5ea0 on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.17%) to 70.32% when pulling 6b00c67 on oesteban:enh/DipyMultiTensorSimulate into c1a5ea0 on nipy:master.

@mwaskom
Copy link
Member

mwaskom commented Apr 17, 2015

It seems strange that the main code here is going to live in nipype and not dipy?

@arokem
Copy link
Member

arokem commented Apr 17, 2015

Well - depending on what you mean by 'main', it is. That's the multi_tensor function, the add_noise function and all the functions being used in generate_gradients. The latter could arguably find a home in dipy.core.gradients, or in dipy.sims.

return outputs


def _compute_voxel(args):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know how this usually works in nipype, but it would be good to have clear documentation for what goes into args. There's lots of them!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use args to make the method 'pickleable' by multiprocessing

@oesteban
Copy link
Contributor Author

@arokem @mwaskom @Garyfallidis I think there are only a couple of features that may be more appropriate in a PR to dipy:

  • Processing full images: parallel processing of many pixels and the simple mask computation.
  • Simulation of isotropic compartments. This is actually doable already as @Garyfallidis pointed out.

If there's an insterest in dipy of having these two features, I'll be happy to contribute.

@arokem
Copy link
Member

arokem commented Apr 20, 2015

Those both sound interesting. I am curious to hear how much of a gain you got from simulating the isotropic component separately. As pointed out by @Garyfallidis, this is already doable, by passing a set of identical evals, but if there's a substantial gain by doing it separately, it might be worth doing. Concerning your second point, we're planning to have a hangout to discuss parallel processing in dipy, and we'd be happy to have your input on that, see link to scheduling on dipy/dipy#631

@oesteban
Copy link
Contributor Author

@arokem I'll see to participate in the parallel processing chat. However I'm far from an expert. I just know how to use multiprocessing to map a list to a function, and get the results. I don't have any numbers about the performance gain simulating compartments outside multi_tensor. With multi_tensor the b-vectors and the sticks are projected and scaled by the tensor. However, outside, it is just about matrix operations optimized by numpy.

@chrisfilo @satra: what do you think about merging this as is now, and updating this interface when the features under discussion are added into dipy?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.18%) to 70.26% when pulling f7c2ff9 on oesteban:enh/DipyMultiTensorSimulate into 328a8fd on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 70.23% when pulling fc3f27c on oesteban:enh/DipyMultiTensorSimulate into 328a8fd on nipy:master.

@oesteban
Copy link
Contributor Author

@arokem @Garyfallidis I finally integrated the simulation of isotropic compartments using multi_tensor. However, resulting MD in these regions is lower than that of single-fiber regions. FA doesn't look bad, though. What could I be doing wrongly?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.23%) to 70.21% when pulling ef0a9c6 on oesteban:enh/DipyMultiTensorSimulate into 328a8fd on nipy:master.

@satra
Copy link
Member

satra commented Jul 1, 2015

pinging to see where this is at.

@oesteban
Copy link
Contributor Author

oesteban commented Jul 2, 2015

I think that with the last merge with master, everything is ready from my side and all the questions were answered :)

satra added a commit that referenced this pull request Jul 2, 2015
@satra satra merged commit dbb6029 into nipy:master Jul 2, 2015
@oesteban oesteban deleted the enh/DipyMultiTensorSimulate branch July 2, 2015 15:09
oesteban added a commit to oesteban/nipype that referenced this pull request Aug 3, 2015
oesteban added a commit that referenced this pull request Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants