GSoC Project Idea 7: Implementing automatic white matter parcellation in Nighres



Nighres is an open-source Python package for processing of high-resolution neuroimaging data (github, documentation, publication). It began as a Google summer of code project (development blog) with the aim of making the Java based advanced image processing algorithms of CBS High-Res Brain Processing Tools and IMCN available to to a wider community. Nighres provides user-friendly Python interfaces for these tools, documents them through concrete examples and facilitates integration with other popular Python-based Neuroimaging tools such as Nibabel, Nilearn and Nipype. Many new tools have been added in the recent release 1.1.0 and the community of users is growing.

A particular functionality that we would like to add to Nighres is a fully automated method to extract white matter tracts from diffusion MRI tensors, based on a Markov random field model and anatomical priors (publication). This method was originally implemented in Java. During this year’s Google summer of Code project we would like to achieve the following:

  • re-implement the method efficiently in Python
  • implement a Nighres interface for the algorithm
  • create documentation and an example workflow
  • potentially extend the method to more advance diffusion MRI models (so far it is optimized and tested for tensors)

Skills: The student should be proficient in Python and have a background in MR image processing, in particular diffusion weighted MRI. Familiarity with other Python-based Neuroimaging tools and experience would be advantageous.

Mentors: Julia M Huntenburg (Nighres core developer,, Champalimaud, Lisbon, Portugal. Pierre-Louis Bazin (Nighres core developer, creator of the white matter parcellation method, MPI CBS, Leipzig, Germany.



the project sounds great! I am very interested in it!

I am a medical student and currently working on my MD thesis at the department of Neuroradiology in Dresden.

Could you maybe provide me any further information on how the method should be applied ? I mean, how the automated white fiber extraction should work?




Hi Dima,
sorry for the late reply, somehow the notifications didn’t work.
First, thank you for you interest! The idea is in a first step to implement the Java algorithm described in this paper in Python and integrate it into Nighres. The algorithm segments the brain’s white matter into individual tracts, based on DTI images. Another step could then be to extend the method to work based e.g. microstructural diffusion metrics. @piloubazin is the expert on the algorithm itself – any additions Pilou?
I will supervise the integration of the algorithm in Nighres’ software framework. You can get a sense of what that involves here and here. We also would like the student to implement a usage example for the new application, similar to this.

Hope this helps, please let me know if you have further questions!


Julia did go over most of the project :smile:
A few more points: the algorithm is currently a piece of Java code. In Nighres, we have integrated many of those using JCC, which doesn’t require you to rewrite everything in python but rather carefully encapsulate what is already there. This algorithm had a few external dependencies that need trimming, so maybe a rewrite is a good option, we will evaluate that during the project. Second point, the method was built for tensors, but should be extendable to (and work better with) ODFs or a similar multi-direction model. That’s a bit more advanced work, but could be a lot of fun if you’re interested in playing with different diffusion models!


Hello @piloubazin, @juhuntenburg . I’m interested in working on this topic as a part of GSoC 2019. I’m currently pursuing a Master’s degree in Computer Science and have worked extensively on MR images and machine learning. In order to proceed working on this topic, I’ve started going through the paper mentioned above. Regarding the same, I would like to know whether there are any already preprocessed images available that I can use? If not then I would proceed with the preprocessing steps mentioned in the paper.


Hi @Ashraf_Haroon_Rashid, thanks for your interest! Before I answer your question – are you referring to the Nighres paper or the paper on the white matter segmentation?


@juhuntenburg I’m referring to the WM tract segmentation paper.


Ok, for that one I don’t think we have example data online. @piloubazin do you have any data you could share? Or could @Ashraf_Haroon_Rashid use other openly available data such as the HCP?


Hi there, a good test data set you could use is the Multi-modal MRI reproducibility resource:
It includes simple diffusion, and has been tested with the original algorithm.


Hi @piloubazin, @juhuntenburg.

Thanks for your inputs. I’ve downloaded the data and extracted the tensors by using FSL. I’ve also gone through the ‘white matter parcellation’ paper.

In particular, I’m unable to understand what equation (2) does in the paper. Is it trying to compute the probability of label ‘l’ at a voxel ‘x’ by smoothing the neighborhood of a delineated voxel ‘x’?

Also, there are some other queries regarding the I have and was wondering whether it would be possible to have a discussion with you so that I can start working on the proposal.