odlgroup / odl

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

Bug in formatting of uniform_discr #171

Closed adler-j closed 8 years ago

adler-j commented 8 years ago

In issue #169 an example of an error message is given:

File "C:\Users\Sebastian\AppData\Roaming\Python\Python27\site-packages\odl\operator\operator.py", line 279, in adjoint
''.format(self))
odl.operator.operator.OpNotImplementedError: adjoint not implemented for operator DiscreteXrayTransform: uniform_discr([-1.0, -1.0], [1.0, 1.0], [50, 50]) -> DiscreteLp(
FunctionSpace(Rectangle([0.0, -1.5], [3.1415926535897931, 1.5])),
RegularGrid([0.0, -1.47], [3.1415926535897931, 1.47], [20, 50]),
Rn(1000, 'float32')
).

Here, the range of the operator is printed "in full", instead of using the abbreviated syntax.

adler-j commented 8 years ago

Seems to show up in #172 as well.

adler-j commented 8 years ago

It seems the issue has to do with as_midp being used or not.

kohr-h commented 8 years ago

This is an instance of issues #174 and #159. We (I) need to fix that.

adler-j commented 8 years ago

Is this done by the partitions?

kohr-h commented 8 years ago

If you go with the standard option nodes_on_bdry=False or True, you get the abbreviated printout, otherwise (using the option per axis differently) not. So yes, unless there is a bug, this is done.

adler-j commented 8 years ago

Lets merge master into conebeam and run the above example first, then close.

kohr-h commented 8 years ago

Alright. That's gonna be interesting :-)

adler-j commented 8 years ago

This now gives reasonable results of the form:

>>> T
RayTransform: uniform_discr([-20.0, -20.0, -20.0], [20.0, 20.0, 20.0], [100, 100, 100], dtype='float32') -> uniform_discr([0.0, -30.0, -30.0], [6.2831853071795862, 30.0, 30.0], [100, 100, 100], dtype='float32')
>>> T.adjoint
RayBackProjection: uniform_discr([0.0, -30.0, -30.0], [6.2831853071795862, 30.0, 30.0], [100, 100, 100], dtype='float32') -> uniform_discr([-20.0, -20.0, -20.0], [20.0, 20.0, 20.0], [100, 100, 100], dtype='float32')