odlgroup / odl

Operator Discretization Library https://odlgroup.github.io/odl/
Mozilla Public License 2.0
363 stars 105 forks source link

Analytic brain phantom that is realistic #1517

Open ozanoktem opened 5 years ago

ozanoktem commented 5 years ago

Michel Unser's group at EPFL has developed a brain phantom that is realistic yet analytic, see this link for the paper. The work is mainly motivated by MRI, but the phantom should be useable also for other imaging modalities. It serves as a good compromise between simplistic Sheep-Logan type of phantoms that are given analytically and phantoms obtained from reconstruction using high quality data, which are realistic but lack analytic expression.

We should consider adding the analytic brain phantom to the ODL phantom library. This relates to issue #143 which is closed.

adler-j commented 5 years ago

I agree this looks like a reasonable phantom to have. Do you know if it is fully analytic or would we need to store data somewhere?

grlee77 commented 5 years ago

If I recall correctly that phantom is fully analytic, but the computation of it is fairly involved an likely not trivial to port from Matlab to Python. At least, I considered it at one point a while back, but determined I did not have the time to dedicate to it. I also don't recall what the license terms are (if specified).

adler-j commented 5 years ago

I also tried porting the whole FORBILD library of phantoms a while back but that too turned out to be a major hassle.

http://www.imp.uni-erlangen.de/phantoms/

kohr-h commented 5 years ago

A slightly hacky but feasible way would be to store the provided SVG file (only ~231 lines, 36 kB) and rasterize it using e.g. pycairo. In the provided Matlab code the features are also given as Bezier curves, so the SVG should be 100 % equivalent.

adler-j commented 5 years ago

Regarding the SVG approach, I think it is reasonable (36 kB is OK) and rasterizing allows us to do any resolution. With that said, it seems remarkably hard to do in a platform independent way, see e.g. my old stack overflow question which is still not answered: https://stackoverflow.com/questions/45038714/convert-svg-to-numpy-array

The problem is basically that pycairo is actually quite badly supported and is basically linux only unless users want to compile it by themselves on windows (and you really don't).

kohr-h commented 5 years ago

The problem is basically that pycairo is actually quite badly supported and is basically linux only unless users want to compile it by themselves on windows (and you really don't).

There are conda packages though (Linux, OSX and Windows).

adler-j commented 5 years ago

There are conda packages though (Linux, OSX and Windows).

Yes, but it depend on cairo which does not have a conda package, see e.g.

https://pycairo.readthedocs.io/en/latest/getting_started.html

Unless something has changed lately.

kohr-h commented 5 years ago

It does, see here. The oldest Windows version is 1 year and 9 months old.

adler-j commented 5 years ago

So fixed 4 months after my SO question then :D Ok then cairo should work just fine.