dkazanc / TomoPhantom

Software to generate 2D/3D/4D analytical phantoms and their Radon transforms (parallel beam) for image processing
https://dkazanc.github.io/TomoPhantom/
Apache License 2.0
116 stars 53 forks source link

location of Phantom library files #35

Closed paskino closed 6 years ago

paskino commented 6 years ago

For Python they can be located as

import tomophantom
import os
path = os.path.dirname(tomophantom.__file__)

Demos should be updated

dkazanc commented 6 years ago

path = os.path.dirname(tomophantom.__file__) doesn't work. Complains that tomophantom not found.

paskino commented 6 years ago

I installed the conda package and it worked. Did you import tomophantom?

When reporting an error can you post the exact error output?

dkazanc commented 6 years ago

sorry, what path = os.path.dirname(tomophantom.__file__) actually means, how I can give a path to Phantom2DLibrary.dat with it for instance? path = os.path.dirname(tomophantom.__file__) worked but I don't know what to do with it? thx

paskino commented 6 years ago

the Phantom2DLibrary.dat resides in os.path.dirname(tomophantom.__file__) so it'd be sufficient to point it as

import tomophantom
import os
path = os.path.dirname(tomophantom.__file__)
library2D = os.path.join(path, "Phantom2DLibrary.dat")
dkazanc commented 6 years ago

thanks, I see! However I do not have any of *dat files in path (so python can't find them). I do have only supp, TomoP2D.so, TomoP3D.so. Do you have them copied?