diff --git a/doc/source/getting_started/about_odl.rst b/doc/source/getting_started/about_odl.rst index db8df9a6486..70a2d174be6 100644 --- a/doc/source/getting_started/about_odl.rst +++ b/doc/source/getting_started/about_odl.rst @@ -166,7 +166,7 @@ If we now exchange ``matrix_op`` and ``data`` with a tomographic projector and l Further features ================ * A unified structure `Geometry` for representing tomographic acquisition geometries -* Interfaces to fast external libraries, e.g. `ASTRA`_ for X-ray tomography, `STIR`_ for emission tomography (preliminary), `pyFFTW`_ for fast Fourier transforms, ... +* Interfaces to fast external libraries, e.g. `ASTRA`_ for X-ray tomography, `pyFFTW`_ for fast Fourier transforms, ... * A growing number of "must-have" operators like `Gradient`, `FourierTransform`, `WaveletTransform` * Several solvers for variational inverse problems, ranging from simple `gradient methods ` to state-of-the-art non-smooth primal-dual splitting methods like `Douglas-Rachford ` * Standardized tests for the correctness of implementations of operators and spaces, e.g. does the adjoint operator fulfill its defining relation? @@ -193,6 +193,5 @@ Further reading .. _real numbers: https://en.wikipedia.org/wiki/Real_number .. _rectangular boxes: https://en.wikipedia.org/wiki/Hypercube .. _set: https://en.wikipedia.org/wiki/Set_%28mathematics%29 -.. _STIR: http://stir.sourceforge.net/ .. _vector space: https://en.wikipedia.org/wiki/Vector_space .. _vectorized: https://en.wikipedia.org/wiki/Array_programming diff --git a/doc/source/getting_started/installing_extensions.rst b/doc/source/getting_started/installing_extensions.rst index 5aeff5b0089..896377c436e 100644 --- a/doc/source/getting_started/installing_extensions.rst +++ b/doc/source/getting_started/installing_extensions.rst @@ -30,11 +30,6 @@ Astra is most easily installed using conda: For further instructions, check `the ASTRA GitHub page `_. -STIR for emission tomography -============================ -For applications in emission tomography, i.e. PET or SPECT, install `STIR`_ with Python bindings. -Support for STIR is currently very limited. - CUDA backend for linear arrays ============================== @@ -121,4 +116,3 @@ If the above command instead raises a ``MemoryError`` or similar, your graphics .. _odlcuda: https://github.com/odlgroup/odlcuda .. _CUDA toolkit: https://developer.nvidia.com/cuda-toolkit .. _ASTRA: https://github.com/astra-toolbox/astra-toolbox -.. _STIR: https://github.com/UCL/STIR diff --git a/examples/tomo/README.md b/examples/tomo/README.md index 053d3dac7b6..7fd18bd6d63 100644 --- a/examples/tomo/README.md +++ b/examples/tomo/README.md @@ -52,12 +52,3 @@ Example | Purpose | Complexity [`filtered_backprojection_cone_3d_short_scan.py`](filtered_backprojection_cone_3d_short_scan.py) | (Inexact) FBP reconstruction in 3D circular cone beam geometry **with short scan (less than 360 degrees)** | middle [`filtered_backprojection_helical_3d.py`](filtered_backprojection_helical_3d.py) | (Inexact) FBP reconstruction in 3D helical cone beam geometry | middle - -# Other - -[comment]: <> (This stuff will be removed from core ODL, just putting it to "Other" for now) - -Example | Purpose | Complexity -------- | ------- | ---------- -[`stir_project.py`](stir_project.py) | Projection and back-projection in 3D PET geometry using the `stir` back-end | middle -[`stir_reconstruct.py`](stir_reconstruct.py) | Iterative reconstruction in 3D PET geometry using the `stir` back-end | middle diff --git a/examples/tomo/data/stir/initial.hv b/examples/tomo/data/stir/initial.hv deleted file mode 100644 index 5ac7120c342..00000000000 --- a/examples/tomo/data/stir/initial.hv +++ /dev/null @@ -1,26 +0,0 @@ -!INTERFILE := -name of data file := initial.v -!GENERAL DATA := -!GENERAL IMAGE DATA := -!type of data := PET -imagedata byte order := LITTLEENDIAN -!PET STUDY (General) := -!PET data type := Image -process status := Reconstructed -!number format := float -!number of bytes per pixel := 4 -number of dimensions := 3 -matrix axis label [1] := x -!matrix size [1] := 64 -scaling factor (mm/pixel) [1] := 2.05941 -matrix axis label [2] := y -!matrix size [2] := 64 -scaling factor (mm/pixel) [2] := 2.05941 -matrix axis label [3] := z -!matrix size [3] := 15 -scaling factor (mm/pixel) [3] := 3.125 -first pixel offset (mm) [1] := -65.9011 -first pixel offset (mm) [2] := -65.9011 -first pixel offset (mm) [3] := 0 -number of time frames := 1 -!END OF INTERFILE := diff --git a/examples/tomo/data/stir/initial.v b/examples/tomo/data/stir/initial.v deleted file mode 100644 index eca6c819de3..00000000000 Binary files a/examples/tomo/data/stir/initial.v and /dev/null differ diff --git a/examples/tomo/data/stir/small.hs b/examples/tomo/data/stir/small.hs deleted file mode 100644 index 033db92899a..00000000000 --- a/examples/tomo/data/stir/small.hs +++ /dev/null @@ -1,36 +0,0 @@ -!INTERFILE := -name of data file := small.s -originating system := RATPET -!GENERAL DATA := -!GENERAL IMAGE DATA := -!type of data := PET -imagedata byte order := LITTLEENDIAN -!PET STUDY (General) := -!PET data type := Emission -applied corrections := {arc correction} -!number format := float -!number of bytes per pixel := 4 -number of dimensions := 4 -matrix axis label [4] := segment -!matrix size [4] := 3 -matrix axis label [3] := view -!matrix size [3] := 28 -matrix axis label [2] := axial coordinate -!matrix size [2] := { 11,15,11} -matrix axis label [1] := tangential coordinate -!matrix size [1] := 56 -minimum ring difference per segment := { -4,-1,2} -maximum ring difference per segment := { -2,1,4} -number of rings := 8 -number of detectors per ring := 112 -inner ring diameter (cm) := 11.5 -distance between rings (cm) := 0.625 -default bin size (cm) := 0.165 -number of blocks_per_bucket in axial direction := 1 -number of crystals_per_block in axial direction := 8 -number of crystals_per_block in transaxial direction := 7 -number of detector layers := 1 -image scaling factor[1] := 1 -data offset in bytes[1] := 0 -number of time frames := 1 -!END OF INTERFILE := diff --git a/examples/tomo/data/stir/small.s b/examples/tomo/data/stir/small.s deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/examples/tomo/stir_project.py b/examples/tomo/stir_project.py deleted file mode 100644 index 0feb186c53c..00000000000 --- a/examples/tomo/stir_project.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Example for PET projection and back-projection using STIR. - -This example computes projection data and the back-projection of that -data using the Shepp-Logan phantom in ODL as input. Definition -of the acquisition geometry and computations are done entirely in STIR, -where the communication between ODL and STIR is realized with files -via hard disk. - -Note that running this example requires an installation of -`STIR `_ and its Python bindings. -""" - -from os import path -import stir -import odl - -# Load STIR input files with data -base = path.join(path.dirname(path.abspath(__file__)), 'data', 'stir') - -volume_file = str(path.join(base, 'initial.hv')) -volume = stir.FloatVoxelsOnCartesianGrid.read_from_file(volume_file) - -projection_file = str(path.join(base, 'small.hs')) -proj_data_in = stir.ProjData.read_from_file(projection_file) -proj_data = stir.ProjDataInMemory(proj_data_in.get_exam_info(), - proj_data_in.get_proj_data_info()) - -# Create ODL spaces matching the discretization as specified in the -# interfiles. -recon_sp = odl.uniform_discr([0, 0, 0], [1, 1, 1], (15, 64, 64)) -data_sp = odl.uniform_discr([0, 0, 0], [1, 1, 1], (37, 28, 56)) - -# Make STIR projector -proj = odl.tomo.backends.stir_bindings.ForwardProjectorByBinWrapper( - recon_sp, data_sp, volume, proj_data) - -# Create Shepp-Logan phantom -vol = odl.phantom.shepp_logan(proj.domain, modified=True) - -# Project and show -result = proj(vol) -result.show() - -# Also show back-projection -back_projected = proj.adjoint(result) -back_projected.show(force_show=True) diff --git a/examples/tomo/stir_reconstruct.py b/examples/tomo/stir_reconstruct.py deleted file mode 100644 index c4d0078b7b5..00000000000 --- a/examples/tomo/stir_reconstruct.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Example PET reconstruction using STIR. - -This example computes projections from the ODL Shepp-Logan phantom -and uses them as input data for reconstruction in STIR. Definition -of the acquisition geometry and computations are done entirely in STIR, -where the communication between ODL and STIR is realized with files -via hard disk. - -Note that running this example requires an installation of -`STIR `_ and its Python bindings. -""" - -from os import path -import odl - -# Set path to input files -base = path.join(path.dirname(path.abspath(__file__)), 'data', 'stir') -volume_file = str(path.join(base, 'initial.hv')) -projection_file = str(path.join(base, 'small.hs')) - -# Create a STIR projector from file data. -proj = odl.tomo.backends.stir_bindings.stir_projector_from_file( - volume_file, projection_file) - -# Create Shepp-Logan phantom -vol = odl.phantom.shepp_logan(proj.domain, modified=True) - -# Project data. Note that this delegates computations to STIR. -projections = proj(vol) - -# Calculate operator norm required for Landweber's method -op_norm_est_squared = proj.adjoint(projections).norm() / vol.norm() -omega = 0.5 / op_norm_est_squared - -# Reconstruct using the STIR forward projector in the ODL reconstruction scheme -recon = proj.domain.zero() -odl.solvers.landweber(proj, recon, projections, niter=50, omega=omega) -recon.show(force_show=True) diff --git a/odl/test/largescale/tomo/data/stir/initial.hv b/odl/test/largescale/tomo/data/stir/initial.hv deleted file mode 100644 index 5ac7120c342..00000000000 --- a/odl/test/largescale/tomo/data/stir/initial.hv +++ /dev/null @@ -1,26 +0,0 @@ -!INTERFILE := -name of data file := initial.v -!GENERAL DATA := -!GENERAL IMAGE DATA := -!type of data := PET -imagedata byte order := LITTLEENDIAN -!PET STUDY (General) := -!PET data type := Image -process status := Reconstructed -!number format := float -!number of bytes per pixel := 4 -number of dimensions := 3 -matrix axis label [1] := x -!matrix size [1] := 64 -scaling factor (mm/pixel) [1] := 2.05941 -matrix axis label [2] := y -!matrix size [2] := 64 -scaling factor (mm/pixel) [2] := 2.05941 -matrix axis label [3] := z -!matrix size [3] := 15 -scaling factor (mm/pixel) [3] := 3.125 -first pixel offset (mm) [1] := -65.9011 -first pixel offset (mm) [2] := -65.9011 -first pixel offset (mm) [3] := 0 -number of time frames := 1 -!END OF INTERFILE := diff --git a/odl/test/largescale/tomo/data/stir/initial.v b/odl/test/largescale/tomo/data/stir/initial.v deleted file mode 100644 index eca6c819de3..00000000000 Binary files a/odl/test/largescale/tomo/data/stir/initial.v and /dev/null differ diff --git a/odl/test/largescale/tomo/data/stir/small.hs b/odl/test/largescale/tomo/data/stir/small.hs deleted file mode 100644 index 033db92899a..00000000000 --- a/odl/test/largescale/tomo/data/stir/small.hs +++ /dev/null @@ -1,36 +0,0 @@ -!INTERFILE := -name of data file := small.s -originating system := RATPET -!GENERAL DATA := -!GENERAL IMAGE DATA := -!type of data := PET -imagedata byte order := LITTLEENDIAN -!PET STUDY (General) := -!PET data type := Emission -applied corrections := {arc correction} -!number format := float -!number of bytes per pixel := 4 -number of dimensions := 4 -matrix axis label [4] := segment -!matrix size [4] := 3 -matrix axis label [3] := view -!matrix size [3] := 28 -matrix axis label [2] := axial coordinate -!matrix size [2] := { 11,15,11} -matrix axis label [1] := tangential coordinate -!matrix size [1] := 56 -minimum ring difference per segment := { -4,-1,2} -maximum ring difference per segment := { -2,1,4} -number of rings := 8 -number of detectors per ring := 112 -inner ring diameter (cm) := 11.5 -distance between rings (cm) := 0.625 -default bin size (cm) := 0.165 -number of blocks_per_bucket in axial direction := 1 -number of crystals_per_block in axial direction := 8 -number of crystals_per_block in transaxial direction := 7 -number of detector layers := 1 -image scaling factor[1] := 1 -data offset in bytes[1] := 0 -number of time frames := 1 -!END OF INTERFILE := diff --git a/odl/test/largescale/tomo/data/stir/small.s b/odl/test/largescale/tomo/data/stir/small.s deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/odl/test/largescale/tomo/stir_slow_test.py b/odl/test/largescale/tomo/stir_slow_test.py deleted file mode 100644 index 31d287a12c2..00000000000 --- a/odl/test/largescale/tomo/stir_slow_test.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2014-2017 The ODL contributors -# -# This file is part of ODL. -# -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -"""Test reconstruction with STIR.""" - -from __future__ import division -import os.path as pth -import odl -from odl.tomo.backends.stir_bindings import stir_projector_from_file - - -pytestmark = odl.util.skip_if_no_largescale - - -@odl.util.skip_if_no_stir -def test_from_file(): - # Set path to input files - base = pth.join(pth.dirname(pth.abspath(__file__)), 'data', 'stir') - volume_file = str(pth.join(base, 'initial.hv')) - projection_file = str(pth.join(base, 'small.hs')) - - # Create a STIR projector from file data. - proj = stir_projector_from_file(volume_file, projection_file) - - # Create SPECT phantom - vol = odl.phantom.derenzo_sources(proj.domain) - - # Project data - projections = proj(vol) - - # Calculate operator norm for landweber - op_norm_est_squared = proj.adjoint(projections).norm() / vol.norm() - omega = 0.5 / op_norm_est_squared - - # Reconstruct using ODL - recon = proj.domain.zero() - odl.solvers.landweber(proj, recon, projections, niter=100, omega=omega) - - # Make sure the result is somewhat close to the actual result. - assert recon.dist(vol) < vol.norm() / 2.0 - - -if __name__ == '__main__': - odl.util.test_file(__file__, ['--largescale']) diff --git a/odl/test/test_examples.py b/odl/test/test_examples.py index cd1fb7275d8..b9d7916088e 100644 --- a/odl/test/test_examples.py +++ b/odl/test/test_examples.py @@ -31,7 +31,7 @@ except ImportError: pass -ignore_prefix = ['stir', 'proximal_lang'] +ignore_prefix = ['proximal_lang'] # Make a fixture for all examples here = os.path.dirname(os.path.abspath(__file__)) diff --git a/odl/tomo/backends/__init__.py b/odl/tomo/backends/__init__.py index 0f3f394d852..94fb40af500 100644 --- a/odl/tomo/backends/__init__.py +++ b/odl/tomo/backends/__init__.py @@ -12,8 +12,6 @@ __all__ = () -from . import stir_bindings - from .astra_setup import * __all__ += astra_setup.__all__ diff --git a/odl/tomo/backends/stir_bindings.py b/odl/tomo/backends/stir_bindings.py deleted file mode 100644 index 424c6eb9a49..00000000000 --- a/odl/tomo/backends/stir_bindings.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright 2014-2017 The ODL contributors -# -# This file is part of ODL. -# -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -"""Back-end for STIR: Software for Tomographic Reconstruction. - -Back and forward projectors for PET. - -`ForwardProjectorByBinWrapper` and `BackProjectorByBinWrapper` are general -objects of STIR projectors and back-projectors, these can be used to wrap a -given projector. - -`stir_projector_from_file` allows users a easy way to create a -`ForwardProjectorByBinWrapper` by giving file paths to the required templates. - -References ----------- -See the `STIR webpage`_ for more information and the `STIR doc`_ for info on -the STIR classes used here. - -.. _STIR webpage: http://stir.sourceforge.net -.. _STIR doc: http://stir.sourceforge.net/documentation/doxy/html/ -""" - -# Imports for common Python 2/3 codebase -from __future__ import print_function, division, absolute_import - -try: - import stir - # Fix for stirextra being moved around in various stir versions - try: - stirextra = stir.stirextra - except AttributeError: - import stirextra - - STIR_AVAILABLE = True -except ImportError: - STIR_AVAILABLE = False - -from odl.discr import uniform_discr -from odl.operator import Operator - - -__all__ = ('ForwardProjectorByBinWrapper', - 'BackProjectorByBinWrapper', - 'stir_projector_from_file', - 'STIR_AVAILABLE') - - -class StirVerbosity(object): - - """Context manager setting STIR verbosity to a fixed level.""" - - def __init__(self, verbosity): - self.verbosity = verbosity - self.old_verbosity = None - - def __enter__(self): - self.old_verbosity = stir.Verbosity.get() - stir.Verbosity.set(self.verbosity) - - def __exit__(self, *_): - stir.Verbosity.set(self.old_verbosity) - - -class ForwardProjectorByBinWrapper(Operator): - - """A forward projector using STIR. - - Uses "ForwardProjectorByBinUsingProjMatrixByBin" as a projector. - """ - - def __init__(self, domain, range, volume, proj_data, - projector=None, adjoint=None): - """Initialize a new instance. - - Parameters - ---------- - domain : `DiscreteLp` - Volume of the projection. Needs to have the same shape as - ``volume.shape()``. - range : `DiscreteLp` - Projection space. Needs to have the same shape as - ``proj_data.to_array().shape()``. - volume : ``stir.FloatVoxelsOnCartesianGrid`` - Stir volume to use in the forward projection - proj_data : ``stir.ProjData`` - Stir description of the projection. - projector : ``stir.ForwardProjectorByBin``, optional - A pre-initialized projector. - adjoint : `BackProjectorByBinWrapper`, optional - A pre-initialized adjoint. - """ - # Check data sizes - if domain.shape != volume.shape(): - raise ValueError('domain.shape {} does not equal volume shape {}' - ''.format(domain.shape, volume.shape())) - # TODO: improve - proj_shape = proj_data.to_array().shape() - if range.shape != proj_shape: - raise ValueError('range.shape {} does not equal proj shape {}' - ''.format(range.shape, proj_shape)) - - # Set domain, range etc - super(ForwardProjectorByBinWrapper, self).__init__( - domain, range, linear=True) - - # Read template of the projection - self.proj_data = proj_data - self.proj_data_info = proj_data.get_proj_data_info() - self.volume = volume - - # Create forward projection by matrix - if projector is None: - proj_matrix = stir.ProjMatrixByBinUsingRayTracing() - proj_matrix.set_up(self.proj_data_info, self.volume) - self.projector = stir.ForwardProjectorByBinUsingProjMatrixByBin( - proj_matrix) - self.projector.set_up(self.proj_data_info, self.volume) - - # If no adjoint was given, we initialize a projector here to - # save time. - if adjoint is None: - back_projector = stir.BackProjectorByBinUsingProjMatrixByBin( - proj_matrix) - back_projector.set_up(self.proj_data.get_proj_data_info(), - self.volume) - else: - # If user wants to provide both a projector and a back-projector, - # he should wrap the back projector in an Operator - self.projector = projector - back_projector = None - - # Pre-create an adjoint to save time - if adjoint is None: - self._adjoint = BackProjectorByBinWrapper( - self.range, self.domain, self.volume, self.proj_data, - back_projector, self) - else: - self._adjoint = adjoint - - def _call(self, volume, out): - """Forward project a volume.""" - # Set volume data - self.volume.fill(volume.asarray().flat) - - # project - with StirVerbosity(0): - self.projector.forward_project(self.proj_data, self.volume) - - # make ODL data - out[:] = stirextra.to_numpy(self.proj_data) - - @property - def adjoint(self): - """Back-projector associated with this operator.""" - return self._adjoint - - -class BackProjectorByBinWrapper(Operator): - - """A back projector using STIR.""" - - def __init__(self, domain, range, volume, proj_data, - back_projector=None, adjoint=None): - """Initialize a new instance. - - Parameters - ---------- - domain : `DiscreteLp` - Projection space. Needs to have the same shape as - ``proj_data.to_array().shape()``. - range : `DiscreteLp` - Volume of the projection. Needs to have the same shape as - ``volume.shape()``. - volume : ``stir.FloatVoxelsOnCartesianGrid`` - Stir volume to use in the forward projection - proj_data : ``stir.ProjData`` - Stir description of the projection. - back_projector : ``stir.BackProjectorByBin``, optional - A pre-initialized back-projector. - adjoint : `ForwardProjectorByBinWrapper`, optional - A pre-initialized adjoint. - - Notes - ----- - See `STIR doc`_ for info on the STIR classes. - - References - ---------- - .. _STIR doc: http://stir.sourceforge.net/documentation/doxy/html/ - """ - - # Check data sizes - if range.shape != volume.shape(): - raise ValueError('`range.shape` {} does not equal volume shape {}' - ''.format(range.shape, volume.shape())) - # TODO: improve - proj_shape = proj_data.to_array().shape() - if domain.shape != proj_shape: - raise ValueError('`domain.shape` {} does not equal proj shape {}' - ''.format(range.shape, proj_shape)) - - # Set range domain - super(BackProjectorByBinWrapper, self).__init__( - domain, range, linear=True) - - # Read template of the projection - self.proj_data = proj_data - self.proj_data_info = proj_data.get_proj_data_info() - self.volume = volume - - # Create forward projection by matrix - if back_projector is None: - proj_matrix = stir.ProjMatrixByBinUsingRayTracing() - proj_matrix.set_up(self.proj_data_info, self.volume) - - self.back_projector = stir.BackProjectorByBinUsingProjMatrixByBin( - proj_matrix) - self.back_projector.set_up(self.proj_data.get_proj_data_info(), - self.volume) - - if adjoint is None: - projector = stir.ForwardProjectorByBinUsingProjMatrixByBin( - proj_matrix) - projector.set_up(self.proj_data_info, self.volume) - - else: - self.back_projector = back_projector - projector = None - - # Pre-create an adjoint to save time - if adjoint is None: - self._adjoint = ForwardProjectorByBinWrapper( - self.range, self.domain, self.volume, self.proj_data, - projector, self) - else: - self._adjoint = adjoint - - def _call(self, projections, out): - """Back project.""" - # Set projection data - self.proj_data.fill(projections.asarray().flat) - - # back-project - with StirVerbosity(0): - self.back_projector.back_project(self.volume, self.proj_data) - - # make ODL data - out[:] = stirextra.to_numpy(self.volume) - - -def stir_projector_from_file(volume_file, projection_file): - """Create a STIR projector from given template files. - - Parameters - ---------- - volume_file : string - Full file path to the STIR input file containing information on the - volume. This is usually a '.hv' file. For STIR reasons, - a '.v' file is also needed. - projection_file : string - Full file path to the STIR input file with information on the - projection data. This is usually a '.hs' file. For STIR reasons, - a '.s' file is also needed. - - Returns - ------- - projector : `ForwardProjectorByBinWrapper` - A STIR forward projector. - """ - volume = stir.FloatVoxelsOnCartesianGrid.read_from_file(volume_file) - - proj_data_in = stir.ProjData.read_from_file(projection_file) - proj_data = stir.ProjDataInMemory(proj_data_in.get_exam_info(), - proj_data_in.get_proj_data_info()) - - origin = volume.get_origin() - grid_spacing = volume.get_grid_spacing() - grid_shape = [volume.get_z_size(), - volume.get_y_size(), - volume.get_x_size()] - min_pt = [origin[1], origin[2], origin[3]] - max_pt = [origin[1] + grid_spacing[1] * grid_shape[0], - origin[2] + grid_spacing[2] * grid_shape[1], - origin[3] + grid_spacing[3] * grid_shape[2]] - - # reverse to handle STIR bug? See: - # https://github.com/UCL/STIR/issues/7 - recon_sp = uniform_discr(min_pt, max_pt, grid_shape, - dtype='float32') - - # TODO: set correct projection space. Currently, a default grid with - # stride (1, 1, 1) is used. - proj_shape = proj_data.to_array().shape() - data_sp = uniform_discr([0, 0, 0], proj_shape, proj_shape, dtype='float32') - - return ForwardProjectorByBinWrapper(recon_sp, data_sp, volume, proj_data) - - -if __name__ == '__main__': - from odl.util.testutils import run_doctests - run_doctests() diff --git a/odl/util/testutils.py b/odl/util/testutils.py index a0f54f76452..b6314193ed5 100644 --- a/odl/util/testutils.py +++ b/odl/util/testutils.py @@ -22,7 +22,7 @@ __all__ = ( 'all_equal', 'all_almost_equal', 'dtype_ndigits', 'dtype_tol', - 'never_skip', 'skip_if_no_stir', 'skip_if_no_pywavelets', + 'never_skip', 'skip_if_no_pywavelets', 'skip_if_no_pyfftw', 'skip_if_no_largescale', 'noise_array', 'noise_element', 'noise_elements', 'Timer', 'timeit', 'ProgressBar', 'ProgressRange', 'test', 'run_doctests', 'test_file' @@ -191,7 +191,6 @@ def _pass(function): return function never_skip = _pass - skip_if_no_stir = _pass skip_if_no_pywavelets = _pass skip_if_no_pyfftw = _pass skip_if_no_largescale = _pass @@ -203,11 +202,6 @@ def _pass(function): reason='Fill in, never skips' ) - skip_if_no_stir = pytest.mark.skipif( - "not odl.tomo.backends.stir_bindings.STIR_AVAILABLE", - reason='STIR not available' - ) - skip_if_no_pywavelets = pytest.mark.skipif( "not odl.trafos.PYWT_AVAILABLE", reason='PyWavelets not available'