Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bundle alignment #333
With this PR I am initiating a series of PRs of many new and old algorithms for the registration of DWI data.
This PR concentrates only on bundle registration and analysis for which I will give an oral presentation at the upcoming ISMRM.
I think it is good idea to share this code now that it is still relatively small so that it is easier for you to review.
The best way to understand this code is by starting from the short tutorial called bundle_registration.py and then go to the internal functions.
Together with @omarocegueda who has implemented an upcoming PR about non linear registration for DWI we have designed a common API both for streamline and volume registration. The API is as follows:
First you define a similarity or dissimilarity metric (e.g. cross correlation, sum of squared distances etc.):
metric = Metric()
Then you create a Registration class (e.g. Streamline or Diffeomorphic Registration) which takes as input the metric and has a method called optimize.
reg = Registration(metric)
Method optimize takes as input the static(reference image or bundle) and the moving (target image or bundle) and it returns a Map() object (e.g. containing the affine or diffeomorphic transformation).
The Map object has a method called transform which applies the mapping to the given input.
moved = map.transform(moving)
We can talk about this further but, registration is a huge problem that might require a lot of work and be a huge portion of DiPy. Particularly most deformable registration problems are defined in the realm of differential geometry and that might require special care of this in the metrics and transforms. Also, methods are usually very sensitive to the optimiser strategy so an optimiser class is imperative.
I would suggest the following:
Apologies for the delay. A bit of feedback on this.
Demian visited our lab and we had some great discussion and feedback from him on the registration topic. We mainly discussed what me and Omar have already implemented and what he has available in his registration module. The decision was that Demian's registration has a different objective than ours. He wants to create a much more general package for registration and it seems that much more work and research is needed for that. For now we are only interested in registration for dMRI data.
At the same time Demian got a permanent position at INRIA and he doesn't know how much time he can find to deliver such an ambitious project i.e. a generic registration package. As we need registration in Dipy for group comparisons as soon as possible, we decided that his module should be an independent project for general registration problems and give him the time to improve upon.
Therefore, we will continue developing our registration methods in dipy with focusing on simple registration needed for diffusion MRI data. As Demian's registration package will get better and more tested then we are very happy to refactor our methods to his new package and use that instead.
Please start reviewing this PR asap. GGT!
And apologies for the ambush :-)
I thought that this would be good to have, considering how much emphasis we
On Sat, Apr 12, 2014 at 6:56 PM, Eleftherios Garyfallidis <
@matthew-brett I am having a weird problem with cPickles and Python3 in Travis. I thought that the six.moves package was enabling us to save and load correctly pickles in Python 2 and 3. But maybe not always?
Here is the error:
Traceback (most recent call last):
What I did here is that I created two lists of streamlines as cb_2.pkl (pickle file) and loading them in a test. I did the saving part in Python 2. The commands I used are:
fobj = open('cb_2.pkl', 'rb')
Does that work?
On Thu, Apr 17, 2014 at 4:41 PM, Eleftherios Garyfallidis <
Okay, thank you @matthew-brett for the tip but unfortunately it didn't work although I played with it for quite a bit. At the end I found a workaround using compressed numpy files. So, all good now.
@arokem I have increased the coverage of streamlinear to 97% in Travis and 100% in my machine. I think I am going to stop here. To cover everything at 100% I need to have full support of the functionality for L-BFGS-B and Powell's method for before Scipy 0.11 which is I think too much pain for no gain.
So, all good on my side. Let it roll!