ANTsPy icon indicating copy to clipboard operation
ANTsPy copied to clipboard

Tractogram linear and non-linear warp

Open pietroastolfi opened this issue 5 years ago • 2 comments

The warping/deformation of tractograms make an important role in many cases, and even though libraries such as Dipy and Nibabel are developing fast, up to know there isn't any realiable pythonic way to perform such deformation. Indeed, Dipy proposes this tutorial, but it does not work in many cases and it is not well documented. Furthermore, I found that the warp computation using antsPy is way more fast than using dipy implementation.

My proposal is to integrate the Dipy/Nibabel tractogram IO api with antspy coregistration. A valid reference for such integration could be Greene et al, 2017: https://github.com/clintg6/DSN.

looking at the code of DSN, I found three main TODO:

  1. Implement the command antsApplyTransformToPoints for which I havent’t find the corresponding antsPy function.
  2. Implement stable functions to convert points and affines from Nibabel convetion to ITK convention and viceversa.
  3. Save the final points in a space which coincide to the target space given by the reference NIFTI image.

pietroastolfi avatar May 25 '20 15:05 pietroastolfi

thanks for breaking it down in terms of primary steps:

  1. help( ants.apply_transforms_to_points ) be sure to get the fwd / inverses correct by setting which to invert properly + passing the right transforms

  2. I don't know much about nibabel convention but if it's a RAS vs LPS issue you just multiply x, y by -1, -1

  3. this should be taken care of by step 1 and stored in a pandas csv with columns x,y,z,t as needed

does this help?

stnava avatar May 25 '20 16:05 stnava

I would also recommend building some very easy / simple examples and tests to move this forward - we can review via pull request.

stnava avatar May 25 '20 16:05 stnava