Posted in 2020
An example workflow for voxel-wise encoding models using a BIDS app
- 31 July 2020
This shows how to (for a BIDS compliant dataset) extract features, save them in BIDS format, and run a BIDS app for voxel-wise encoding models. We are going to use this dataset.
Non-consecutive header level increase; H1 to H4 [myst.header]
Adding contours of a surface region to a statistical map in Nilearn
- 23 January 2020
I often use Nilearn’s surface plotting to show a statistical map on the cortex - and wish that I could add the outlines of a region on top of the statistical map. This is harder than it seems at the first thought, since matplotlib’s mesh plotting allows us to only edit the whole color of a mesh-face, hence we need to find all faces that correspond to the outside edge of a region.
But here’s code that’s working for me.
Probability density fitting of a Mixture of Gaussians via autograd
- 17 January 2020
Recently I’ve had to fit a Mixture of Gaussians to a target density instead of individual samples drawn from this density. Googling revealed that at least one other person faced this particular problem too, but there was no code readily available.
To be clear, the problem is the following: given a mixture of Gaussian probability density that is evaluated at $N$ points, we want to recover parameters of these Gaussians (i.e. mean $\mu_{i}$, standard deviation $\sigma_{i}$, and a set of mixture weights $\pi_{i}$ that are constrained to be [0, 1] and sum to 1).