Skip to content

Commit

Permalink
Merge f6f2f0b into 139f4e8
Browse files Browse the repository at this point in the history
  • Loading branch information
carterbox committed Sep 24, 2019
2 parents 139f4e8 + f6f2f0b commit d8d1513
Show file tree
Hide file tree
Showing 19 changed files with 569 additions and 973 deletions.
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -62,6 +62,7 @@ You can try notebooks now using mybinder.org
Contribute
==========

* Bugs Tracker: https://github.com/tomopy/tomopy/projects/1
* Issue Tracker: https://github.com/tomopy/tomopy/issues
* Documentation: https://github.com/tomopy/tomopy/tree/master/doc
* Source Code: https://github.com/tomopy/tomopy/tree/master/tomopy
Expand Down
5 changes: 3 additions & 2 deletions binder/environment.yml
Expand Up @@ -2,7 +2,8 @@ name: tomopy
channels:
- conda-forge
- defaults
- astra-toolbox
dependencies:
- dxchange
- python
- matplotlib
- tomopy
- astra-toolbox
223 changes: 83 additions & 140 deletions doc/demo/gridrec.ipynb

Large diffs are not rendered by default.

174 changes: 87 additions & 87 deletions doc/demo/gridrec.py
@@ -1,87 +1,87 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# #########################################################################
# Copyright (c) 2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2019. UChicago Argonne, LLC. This software was produced #
# under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
# Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
# U.S. Department of Energy. The U.S. Government has rights to use, #
# reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
# UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
# ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
# modified to produce derivative works, such modified software should #
# be clearly marked, so as not to confuse it with the version available #
# from ANL. #
# #
# Additionally, redistribution and use in source and binary forms, with #
# or without modification, are permitted provided that the following #
# conditions are met: #
# #
# * Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# #
# * Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in #
# the documentation and/or other materials provided with the #
# distribution. #
# #
# * Neither the name of UChicago Argonne, LLC, Argonne National #
# Laboratory, ANL, the U.S. Government, nor the names of its #
# contributors may be used to endorse or promote products derived #
# from this software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
# Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
# POSSIBILITY OF SUCH DAMAGE. #
# #########################################################################

"""
TomoPy example script to reconstruct the tomography data as
with gridrec.
"""
from __future__ import print_function
import tomopy
import dxchange

if __name__ == '__main__':

# Set path to the micro-CT data to reconstruct.
fname = '../../../tomopy/data/tooth.h5'

# Select the sinogram range to reconstruct.
start = 0
end = 2

# Read the APS 2-BM 0r 32-ID raw data.
proj, flat, dark, theta = dxchange.read_aps_32id(fname, sino=(start, end))

# Set data collection angles as equally spaced between 0-180 degrees.
theta = tomopy.angles(proj.shape[0])

# Set data collection angles as equally spaced between 0-180 degrees.
proj = tomopy.normalize(proj, flat, dark)

# Set data collection angles as equally spaced between 0-180 degrees.
rot_center = tomopy.find_center(proj, theta, init=290, ind=0, tol=0.5)

proj = tomopy.minus_log(proj)

# Reconstruct object using Gridrec algorithm.
recon = tomopy.recon(proj, theta, center=rot_center, algorithm='gridrec')

# Mask each reconstructed slice with a circle.
recon = tomopy.circ_mask(recon, axis=0, ratio=0.95)

# Write data as stack of TIFs.
dxchange.write_tiff_stack(recon, fname='recon_dir/recon')
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# #########################################################################
# Copyright (c) 2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2019. UChicago Argonne, LLC. This software was produced #
# under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
# Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
# U.S. Department of Energy. The U.S. Government has rights to use, #
# reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
# UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
# ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
# modified to produce derivative works, such modified software should #
# be clearly marked, so as not to confuse it with the version available #
# from ANL. #
# #
# Additionally, redistribution and use in source and binary forms, with #
# or without modification, are permitted provided that the following #
# conditions are met: #
# #
# * Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# #
# * Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in #
# the documentation and/or other materials provided with the #
# distribution. #
# #
# * Neither the name of UChicago Argonne, LLC, Argonne National #
# Laboratory, ANL, the U.S. Government, nor the names of its #
# contributors may be used to endorse or promote products derived #
# from this software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
# Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
# POSSIBILITY OF SUCH DAMAGE. #
# #########################################################################

"""
TomoPy example script to reconstruct the tomography data as
with gridrec.
"""
from __future__ import print_function
import tomopy
import dxchange

if __name__ == '__main__':

# Set path to the micro-CT data to reconstruct.
fname = '../../../source/tomopy/data/tooth.h5'

# Select the sinogram range to reconstruct.
start = 0
end = 2

# Read the APS 2-BM 0r 32-ID raw data.
proj, flat, dark, theta = dxchange.read_aps_32id(fname, sino=(start, end))

# Set data collection angles as equally spaced between 0-180 degrees.
theta = tomopy.angles(proj.shape[0])

# Set data collection angles as equally spaced between 0-180 degrees.
proj = tomopy.normalize(proj, flat, dark)

# Set data collection angles as equally spaced between 0-180 degrees.
rot_center = tomopy.find_center(proj, theta, init=290, ind=0, tol=0.5)

proj = tomopy.minus_log(proj)

# Reconstruct object using Gridrec algorithm.
recon = tomopy.recon(proj, theta, center=rot_center, algorithm='gridrec')

# Mask each reconstructed slice with a circle.
recon = tomopy.circ_mask(recon, axis=0, ratio=0.95)

# Write data as stack of TIFs.
dxchange.write_tiff_stack(recon, fname='recon_dir/recon')
32 changes: 31 additions & 1 deletion doc/source/conf.py
Expand Up @@ -93,7 +93,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ['_build', '**.ipynb_checkpoints']

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down Expand Up @@ -122,6 +122,36 @@

# -- Options for HTML output ----------------------------------------------

nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc={'figure.dpi': 96}",
]

# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base='doc/source') %}
.. only:: html
.. role:: raw-html(raw)
:format: html
.. nbinfo::
This page was generated from `{{ docname }}`__.
Interactive online version:
:raw-html:`<a href="https://mybinder.org/v2/gh/tomopy/tomopy/{{ env.config.release }}?filepath={{ docname }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>`
__ https://github.com/tomopy/tomopy/blob/
{{ env.config.release }}/{{ docname }}
.. raw:: latex
\nbsphinxstartnotebook{\scriptsize\noindent\strut
\textcolor{gray}{The following section was generated from
\sphinxcode{\sphinxupquote{\strut {{ docname | escape_latex }}}} \dotfill}}
"""

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
Expand Down
17 changes: 0 additions & 17 deletions doc/source/data.rst

This file was deleted.

0 comments on commit d8d1513

Please sign in to comment.