ahendriksen / tomosipo

A library for painless 3D tomographic reconstruction
https://aahendriksen.gitlab.io/tomosipo/index.html
GNU General Public License v3.0
83 stars 16 forks source link

Astra version not available #5

Closed bluepotatoes closed 3 years ago

bluepotatoes commented 3 years ago

Hello!

Thank you for creating this tool. It seems that it might really help me with projections along arbitrary directions.

I'm afraid that the available astra versions have changed, and it's making it difficult for me to install tomosipo.

I ran setup.py and installed the module, but came across an error with importing direct_FPBP3D from astra.experimental.

Python 3.7.9 | packaged by conda-forge | (default, Dec  9 2020, 20:36:16) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tomosipo
Traceback (most recent call last):
  File "C:\Users\USERNAME\Miniconda3\envs\tomoastra\lib\site-packages\tomosipo-0.2.0-py3.7.egg\tomosipo\__init__.py", line 48, in <module>
    __import_astra_functionality()
  File "C:\Users\USERNAME\Miniconda3\envs\tomoastra\lib\site-packages\tomosipo-0.2.0-py3.7.egg\tomosipo\__init__.py", line 46, in __import_astra_functionality
    from astra.experimental import direct_FPBP3D
ImportError: cannot import name 'direct_FPBP3D' from 'astra.experimental' (C:\Users\mjc5455\Miniconda3\envs\tomoastra\lib\site-packages\astra\experimental.cp37-win_amd64.pyd)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\mjc5455\Miniconda3\envs\tomoastra\lib\site-packages\tomosipo-0.2.0-py3.7.egg\tomosipo\__init__.py", line 58, in <module>
    "Cannot find all required astra.experimental methods. \n"
ImportError: Cannot find all required astra.experimental methods.
Please make sure you have at least ASTRA version 1.9.9-dev4 installed.
You can install the latest ASTRA development version using:
> conda install astra-toolbox -c astra-toolbox/label/dev
$ conda search -c astra-toolbox/label/dev astra-toolbox

astra-toolbox               1.9.0dev     np114py37_6  astra-toolbox/label/dev
astra-toolbox               1.9.0dev     np115py27_6  astra-toolbox/label/dev
astra-toolbox               1.9.0dev     np115py35_6  astra-toolbox/label/dev
astra-toolbox               1.9.0dev     np115py36_6  astra-toolbox/label/dev
astra-toolbox               1.9.0dev     np115py37_6  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np111py37_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np114py36_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np114py37_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np115py35_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np115py36_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np115py37_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np116py36_0  astra-toolbox/label/dev
astra-toolbox            1.9.0.dev11     np116py37_0  astra-toolbox/label/dev

Do you have any tips / hackery I could do to get it working? Would appreciate any input.

Cheers,

bluepotatoes

ahendriksen commented 3 years ago

Hi,

Thanks for the kind words. This package requires some of the latest features from the astra-toolbox. The windows releases of astra generally lag a bit behind the linux releases.

If you want to use tomosipo purely for creating and displaying geometries (and not for actually computing tomographic projections/reconstructions), then you could remove the check for direct_FPBP3D here. Otherwise, you might be dependent on a fresh Windows release of the ASTRA-toolbox, which may take some time due to Covid (The Windows build computer may not be accessible at this time).

I have asked the developers of ASTRA to weigh in.

Best,

Allard

bluepotatoes commented 3 years ago

Thanks! Don't think that I'll need FPBP so I went ahead and removed the check. Thanks for the help!

ahendriksen commented 3 years ago

As of yesterday, new development versions of the ASTRA-toolbox for Windows have been uploaded to anaconda!