davlars / ad-skull-reconstruction

Repository for reconstruction of simulated skull CT data for AD project
2 stars 5 forks source link

Crash due to pickled geometries #36

Open aringh opened 7 years ago

aringh commented 7 years ago

The following code

import odl
import adutils

# Discretization
reco_space = adutils.get_discretization(use_2D=True)

# Forward operator (in the form of a broadcast operator)
A = adutils.get_ray_trafo(reco_space, use_2D=True)

gives this error

Loading geometry
Traceback (most recent call last):

  File "<ipython-input-1-e4354a8993cf>", line 8, in <module>
    A = adutils.get_ray_trafo(reco_space, use_2D=True)

  File "/home/aringh/git/ad-skull-reconstruction/adutils.py", line 86, in get_ray_trafo
    geom = pickle.load(f, encoding='latin1')

ImportError: No module named 'odl.tomo.geometry.fanbeam'

I guess somethings has changed in odl, but I do not know exactly what and when.

This is related to the discussion in #35, and the workaround there works for this as well.

davlars commented 7 years ago

Yeah, it all seems to spur from #35 like you said. @adler-j: any news on that side?

aringh commented 7 years ago

I think it is a separate issue, that occurred more recently... but if the error in #35 is fixed by creating new geometries and pickling them, this should be solved as well :-) On the other hand, doing that might not be optimal before odlgroup/odl#1028 is solved, since future changes in odl might case similar problems to come back.

But, odlgroup/odl#1028 is getting more and more pressing... right now we have figure-of-metris in odl, which one would like to use in the reconstructions. However, checking out the commit suggested in #35 means that this code does not exists yet in odl. It is easily copied and can thus be used, but if things like that pile up it starts becoming harder to handle.

davlars commented 7 years ago

I totally understand that we would like to get going on the FOMs, and copying the FOM-stuff over (using the work-around in #35) is really not optimal.

Considering this, is the best option to re-create the geometries (yet again), or is any progress on odlgroup/odl#1028 feasbile in the near future?

davlars commented 7 years ago

With the FOM-work in mind, and considering the old geometries were quite dated, I've gone with the (stupid) solution of re-creating the geometries. The issue's still there (pickled geometries getting outdated) but hopefully that gets current work issue going.

To access the new geometries, either

  1. Re-run the adutils.load_data_from_nas(...), or...
  2. ...(faster) copy the *geometries*-files from /path/to/imagingnas/Reference/CT/GPUMCI simulations/120kV/ to your /path/to/ad-skull-reconstruction/data/Simulated/120kV/.

That should work with the current versions of all packages.

aringh commented 7 years ago

Thanks a lot @davlars ! :-)