pax_global_header 0000666 0000000 0000000 00000000064 15210541515 0014511 g ustar 00root root 0000000 0000000 52 comment=ed0e5bdc832e636e44d40cf8fb8eb5728d906e1e
ufo-kit-tofu-ed0e5bd/ 0000775 0000000 0000000 00000000000 15210541515 0014614 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/.gitignore 0000664 0000000 0000000 00000000122 15210541515 0016577 0 ustar 00root root 0000000 0000000 *.pyc
build/
dist/
*.egg-info/
install_manifest*.txt
.idea/
.vscode/settings.json
ufo-kit-tofu-ed0e5bd/.readthedocs.yml 0000664 0000000 0000000 00000001317 15210541515 0017704 0 ustar 00root root 0000000 0000000 # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
build:
os: ubuntu-20.04
apt_packages:
- gobject-introspection
- libgirepository1.0-dev
tools:
python: "3.8"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF
# formats:
# - pdf
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
ufo-kit-tofu-ed0e5bd/LICENSE 0000664 0000000 0000000 00000016743 15210541515 0015634 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
ufo-kit-tofu-ed0e5bd/MANIFEST.in 0000664 0000000 0000000 00000000047 15210541515 0016353 0 ustar 00root root 0000000 0000000 include pkgconfig.py
include README.md
ufo-kit-tofu-ed0e5bd/README.md 0000664 0000000 0000000 00000011002 15210541515 0016065 0 ustar 00root root 0000000 0000000 ## About
[](http://badge.fury.io/py/ufo-tofu)
[](http://tofu.readthedocs.io/en/latest/?badge=latest)
This repository contains Python data processing scripts to be used with the UFO
framework. At the moment they are targeted at high-performance reconstruction of
tomographic data sets.
If you use this software for publishing your data, we kindly ask you to cite the article
**Faragó, T., Gasilov, S., Emslie, I., Zuber, M., Helfen, L., Vogelgesang, M. & Baumbach, T. (2022). J. Synchrotron Rad.
29, https://doi.org/10.1107/S160057752200282X**
If you want to stay updated, subscribe to our [newsletter](mailto:sympa@lists.kit.edu?subject=subscribe%20ufo%20YourFirstName%20YourLastName). Simply leave the body of the e-mail empty and in the subject change ``YourFirstName YourLastName`` accordingly.
## Installation
First make sure you have [ufo-core](https://github.com/ufo-kit/ufo-core) and [ufo-filters](https://github.com/ufo-kit/ufo-filters) installed. For that, please follow the [installation instructions](https://ufo-core.readthedocs.io/en/latest/install/index.html). You can either install the prerequisites yourself on [Linux](https://ufo-core.readthedocs.io/en/latest/install/linux.html), or use one of our [Docker containers](https://ufo-core.readthedocs.io/en/latest/install/docker.html).
Then, for the newest version run the following in *tofu*'s top directory:
pip install .
or to install via PyPI:
pip install ufo-tofu
in a prepared virtualenv or as root for system-wide installation.
Note that graphical user interfaces require additional packages. You are strongly advised to install PyQt through your system package
manager. You can install the requirements for the different guis as extras:
pip install .[gui]
# OR
pip install ufo-tofu[gui]
depending if you are installing from source or PyPI.
`tofu flow` and `tofu ez` are supported similarly:
pip install .[flow]
pip install .[ez]
pip install .[interactive,gui,flow,ez,test] # All extras
## Usage
### Flow
`tofu flow` is a visual flow programming tool. You can create a flow by using any task from [ufo-filters](https://github.com/ufo-kit/ufo-filters) and execute it. In includes visualization of 2D and 3D results, so you can quickly check the output of your flow, which is useful for finding algorithm parameters.

### Reconstruction
To do a tomographic reconstruction you simply call
$ tofu tomo --sinograms $PATH_TO_SINOGRAMS
from the command line. To get get correct results, you may need to append
options such as `--axis-pos/-a` and `--angle-step/-a` (which are given in
radians!). Input paths are either directories or glob patterns. Output paths are
either directories or a format that contains one `%i`
[specifier](http://www.pixelbeat.org/programming/gcc/format_specs.html):
$ tofu tomo --axis-pos=123.4 --angle-step=0.000123 \
--sinograms="/foo/bar/*.tif" --output="/output/slices-%05i.tif"
You can get a help for all options by running
$ tofu tomo --help
and more verbose output by running with the `-v/--verbose` flag.
You can also load reconstruction parameters from a configuration file called
`reco.conf`. You may create a template with
$ tofu init
Note, that options passed via the command line always override configuration
parameters!
Besides scripted reconstructions, one can also run a standalone GUI for both
reconstruction and quick assessment of the reconstructed data via
$ tofu gui

### Performance measurement
If you are running at least ufo-core/filters 0.6, you can evaluate the performance
of the filtered backprojection (without sinogram transposition!), with
$ tofu perf
You can customize parameter scans, pretty easily via
$ tofu perf --width 256:8192:256 --height 512
which will reconstruct all combinations of width between 256 and 8192 with a
step of 256 and a fixed height of 512 pixels.
### Estimating the center of rotation
If you do not know the correct center of rotation from your experimental setup,
you can estimate it with:
$ tofu estimate -i $PATH_TO_SINOGRAMS
Currently, a modified algorithm based on the work of [Donath et
al.](http://dx.doi.org/10.1364/JOSAA.23.001048) is used to determine the center.
ufo-kit-tofu-ed0e5bd/bin/ 0000775 0000000 0000000 00000000000 15210541515 0015364 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/bin/tofu 0000775 0000000 0000000 00000020302 15210541515 0016264 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python3
import os
import sys
import argparse
import logging
import time
import re
import gi
from tofu import config, __version__
try:
gi.require_version('Ufo', '0.0')
except ValueError:
gi.require_version('Ufo', '1.0')
LOG = logging.getLogger('tofu')
def init(args):
if not os.path.exists(args.config):
config.write(args.config)
else:
raise RuntimeError("{0} already exists".format(args.config))
def run_tomo(args):
from tofu import reco
reco.tomo(args)
def run_lamino(args):
from tofu import lamino
lamino.lamino(args)
def run_genreco(args):
from tofu import genreco
genreco.genreco(args)
def run_flat_correct(args):
from tofu import preprocess
preprocess.run_flat_correct(args)
def run_preprocessing(args):
from tofu import preprocess
preprocess.run_preprocessing(args)
def run_sinos(args):
from tofu import preprocess
preprocess.run_sinogram_generation(args)
def run_ez(args):
if args.ezvars:
LOG.info(f"Loading ez parameters from {args.ezvars}")
from tofu.ez.main import execute_from_params
execute_from_params(args)
else:
from tofu.ez.GUI.ezufo_launcher import main_qt
main_qt(args)
def get_ipython_shell(config=None):
import IPython
version = IPython.__version__
shell = None
def cmp_versions(v1, v2):
"""Compare two version numbers and return cmp compatible result"""
def normalize(v):
return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
n1 = normalize(v1)
n2 = normalize(v2)
return (n1 > n2) - (n1 < n2)
if cmp_versions(version, '0.11') < 0:
from IPython.Shell import IPShellEmbed
shell = IPShellEmbed()
elif cmp_versions(version, '1.0') < 0:
from IPython.frontend.terminal.embed import \
InteractiveShellEmbed
shell = InteractiveShellEmbed(config=config, banner1='')
else:
from IPython.terminal.embed import InteractiveShellEmbed
shell = InteractiveShellEmbed(config=config, banner1='')
return shell
def run_shell(args):
from tofu import reco
shell = get_ipython_shell()
shell()
def run_find_large_spots(args):
from tofu.find_large_spots import find_large_spots, find_large_spots_median
if args.method == 'grow':
find_large_spots(args)
else:
find_large_spots_median(args)
def run_inpaint(args):
from tofu import inpaint
inpaint.run(args)
def gui(args):
try:
from tofu import gui
gui.main(args)
except ImportError as e:
LOG.error(str(e))
def run_flow(args):
from tofu.flow.main import main as flow_main
flow_main()
def estimate(params):
from tofu import reco
center = reco.estimate_center(params)
if params.verbose:
out = '>>> Best axis of rotation: {}'.format(center)
else:
out = center
print(out)
def perf(args):
from tofu import reco
def measure(args):
exec_times = []
total_times = []
for i in range(args.num_runs):
start = time.time()
exec_times.append(reco.tomo(args))
total_times.append(time.time() - start)
exec_time = sum(exec_times) / len(exec_times)
total_time = sum(total_times) / len(total_times)
overhead = (total_time / exec_time - 1.0) * 100
input_bandwidth = args.width * args.height * num_projections * 4 / exec_time / 1024. / 1024.
output_bandwidth = args.width * args.width * height * 4 / exec_time / 1024. / 1024.
slice_bandwidth = args.height / exec_time
# Four bytes of our output bandwidth constitute one slice pixel, for each
# pixel we have to do roughly n * 6 floating point ops (2 mad, 1 add, 1
# interpolation)
flops = output_bandwidth / 4 * 6 * num_projections / 1024
msg = ("width={:<6d} height={:<6d} n_proj={:<6d} "
"exec={:.4f}s total={:.4f}s overhead={:.2f}% "
"bandwidth_i={:.2f}MB/s bandwidth_o={:.2f}MB/s slices={:.2f}/s "
"flops={:.2f}GFLOPs\n")
sys.stdout.write(msg.format(args.width, args.height, args.number,
exec_time, total_time, overhead,
input_bandwidth, output_bandwidth, slice_bandwidth, flops))
sys.stdout.flush()
args.projections = None
args.sinograms = None
args.dry_run = True
for width in range(*args.width_range):
for height in range(*args.height_range):
for num_projections in range(*args.num_projection_range):
args.width = width
args.height = height
args.number = num_projections
measure(args)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', **config.SECTIONS['general']['config'])
parser.add_argument('--version', action='version',
version='%(prog)s {}'.format(__version__))
sino_params = ('flat-correction', 'sinos')
reco_params = ('flat-correction', 'reconstruction')
tomo_params = config.TOMO_PARAMS
lamino_params = config.LAMINO_PARAMS
gui_params = tomo_params + ('gui', )
cmd_parsers = [
('init', init, (), "Create configuration file"),
('preprocess', run_preprocessing, config.PREPROC_PARAMS, "Run preprocessing"),
('flatcorrect', run_flat_correct, ('flat-correction',), "Run flat field correction"),
('sinos', run_sinos, sino_params, "Generate sinograms from projections"),
('tomo', run_tomo, tomo_params, "Run tomographic reconstruction"),
('lamino', run_lamino, lamino_params, "Run laminographic reconstruction"),
('reco', run_genreco, config.GEN_RECO_PARAMS, "Run general projection-based "
"reconstruction for tomographic/"
"laminographic cone/parallel beam"),
('gui', gui, tomo_params + ('gui',), "GUI for tomographic reconstruction"),
('flow', run_flow, (), "Visual flow creation"),
('ez', run_ez, ('ez',), "GUI for making ufo-kit data processing pipelines"),
('estimate', estimate, tomo_params + ('estimate',), "Estimate center of rotation"),
('perf', perf, tomo_params + ('perf',), "Check reconstruction performance"),
('interactive', run_shell, tomo_params, "Run interactive mode"),
('find-large-spots', run_find_large_spots, ('find-large-spots',), "Find large spots on images"),
('inpaint', run_inpaint, ('inpaint',), "Inpaint images"),
]
if sys.version < '3.7':
subparsers = parser.add_subparsers(title="Commands", dest='commands')
else:
subparsers = parser.add_subparsers(title="Commands", dest='commands', required=True)
for cmd, func, sections, text in cmd_parsers:
cmd_params = config.Params(sections=sections)
cmd_parser = subparsers.add_parser(cmd, help=text, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
cmd_parser = cmd_params.add_arguments(cmd_parser)
cmd_parser.set_defaults(_func=func)
args = config.parse_known_args(parser, subparser=True)
log_level = logging.DEBUG if args.verbose else logging.INFO
LOG.setLevel(log_level)
stream_handler = logging.StreamHandler(sys.stdout)
stream_handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
LOG.addHandler(stream_handler)
if args.log:
file_handler = logging.FileHandler(args.log)
file_handler.setFormatter(logging.Formatter('[%(asctime)s] %(name)s:%(levelname)s: %(message)s'))
LOG.addHandler(file_handler)
try:
config.log_values(args)
args._func(args)
except RuntimeError as e:
LOG.error(str(e))
sys.exit(1)
if __name__ == '__main__':
main()
# vim: ft=python
ufo-kit-tofu-ed0e5bd/docs/ 0000775 0000000 0000000 00000000000 15210541515 0015544 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/Makefile 0000664 0000000 0000000 00000001110 15210541515 0017175 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) ufo-kit-tofu-ed0e5bd/docs/requirements.txt 0000664 0000000 0000000 00000000132 15210541515 0021024 0 ustar 00root root 0000000 0000000 docutils==0.17.1
jinja2==3.1.2
sphinx==5.0.2
sphinx-rtd-theme==1.0.0
sphinxcontrib-bibtex
ufo-kit-tofu-ed0e5bd/docs/source/ 0000775 0000000 0000000 00000000000 15210541515 0017044 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/source/_static/ 0000775 0000000 0000000 00000000000 15210541515 0020472 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/source/_static/css/ 0000775 0000000 0000000 00000000000 15210541515 0021262 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/source/_static/css/custom.css 0000664 0000000 0000000 00000000127 15210541515 0023306 0 ustar 00root root 0000000 0000000 @import url("theme.css");
.wy-nav-content {
min-width: 50%;
max-width: 55%;
}
ufo-kit-tofu-ed0e5bd/docs/source/api.rst 0000664 0000000 0000000 00000000247 15210541515 0020352 0 ustar 00root root 0000000 0000000 Application Programming Interface
=================================
.. toctree::
:maxdepth: 2
api/preprocessing
api/inpaint
api/genreco
api/util
ufo-kit-tofu-ed0e5bd/docs/source/api/ 0000775 0000000 0000000 00000000000 15210541515 0017615 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/source/api/genreco.rst 0000664 0000000 0000000 00000000121 15210541515 0021763 0 ustar 00root root 0000000 0000000 3D Reconstruction
=================
.. automodule:: tofu.genreco
:members:
ufo-kit-tofu-ed0e5bd/docs/source/api/inpaint.rst 0000664 0000000 0000000 00000011147 15210541515 0022015 0 ustar 00root root 0000000 0000000 Inpainting
==========
Module for inpainting images, mainly used for the following:
* interpolation of holes in the images
* seamless cloning
* removal of harsh transitions between image borders for cross removal in
the power spectrum
Power Spectrum Cross Removal
----------------------------
The helper function for the removal of the cross in the power spectrum is
:func:`.prepare_border_smoothing`. For details see :cite:`moisan2011periodic`.
Our implementation, which uses the 2-step forward/backward gradient to get the
Laplacian in :func:`.create_inpaint_pipeline` makes the "v" field slightly
different than in the paper (defined in :cite:`moisan2011periodic` below eq.
11). The right/bottom border is equal to "v" from the paper but the left/top
border are True Laplacian values. Nevertheless, the other side does get inside,
so the filtering result is very similar. How is it similar and different::
g_forw( 0) = f(1) - f( 0)
g_forw(-1) = f(0) - f(-1)
# This is different from the paper
g_back( 0) = g_forw( 0) - g_forw(-1) = -2f(0) + f(1) + f(-1)
# After the forward pass, the gradient field is set to zeros everywhere except the borders.
# This is equivalent to the paper
g_back(-1) = g_forw(-1) - g_forw(-2) = g_forw(-1) - 0 = f(0) - f(-1)
On the top of that, we use the fact that:
.. math::
:nowrap:
\begin{align}
g(x, y)
& = f(x, y) - \mathcal{F}^{-1} \left\{
\frac{\mathcal{F}
\left[
\frac{\partial}{\partial x}
\left(
\left( \frac{\partial}{\partial x} f(x, y) \right) m(x, y)
\right)
+ \frac{\partial}{\partial y}
\left(
\left( \frac{\partial}{\partial y} f(x, y) \right) m(x, y)
\right)
\right]}
{L(u, v)} \right\} \\
& = \mathcal{F}^{-1}
\left\{
\frac{\mathcal{F}
\left[
\frac{\partial}{\partial x}
\left(
\left(
\frac{\partial}{\partial x} f(x, y)
\right) \left( 1 - m(x, y) \right)
\right)
+ \frac{\partial}{\partial y}
\left(
\left(
\frac{\partial}{\partial y} f(x, y)
\right) \left( 1 - m(x, y) \right)
\right)
\right]}
{L(u, v)}
\right\} \\
& = \mathcal{F}^{-1}
\left\{
\frac{\mathcal{F}
\left[
\frac{\partial}{\partial x}
\left( \frac{\partial}{\partial x} f(x, y) \right)
+ \frac{\partial}{\partial y}
\left( \frac{\partial}{\partial y} f(x, y) \right)
\right]} {L(u, v)}
- \frac{\mathcal{F}
\left[
\frac{\partial}{\partial x}
\left(
\left( \frac{\partial}{\partial x} f(x, y) \right) m(x, y)
\right)
+ \frac{\partial}{\partial y}
\left(
\left( \frac{\partial}{\partial y} f(x, y) \right) m(x, y)
\right)
\right]} {L(u, v)}
\right\} \\
& = \mathcal{F}^{-1}
\left\{
\mathcal{F} \left[ f(x, y) \right]
- \frac{\mathcal{F}
\left[
\frac{\partial}{\partial x}
\left(
\left( \frac{\partial}{\partial x} f(x, y) \right) m(x, y)
\right)
+ \frac{\partial}{\partial y}
\left(
\left( \frac{\partial}{\partial y} f(x, y) \right) m(x, y)
\right)
\right]} {L(u, v)}
\right\}
\end{align}
to remove the need of the subtraction from the original image, thus, we implement Eq. (2)
instead of Eq. (1). :math:`\mathcal{F}` is the Fourier transform, :math:`m(x, y)` is the binary
mask which specifies which pixels in the gradient will be zeroed, :math:`L(u, v)` is the Laplace
operator in Fourier space.
Inpaint Module
--------------
.. automodule:: tofu.inpaint
:members:
ufo-kit-tofu-ed0e5bd/docs/source/api/preprocessing.rst 0000664 0000000 0000000 00000000115 15210541515 0023227 0 ustar 00root root 0000000 0000000 Pre-processing
==============
.. automodule:: tofu.preprocess
:members:
ufo-kit-tofu-ed0e5bd/docs/source/api/util.rst 0000664 0000000 0000000 00000000075 15210541515 0021326 0 ustar 00root root 0000000 0000000 Utilities
=========
.. automodule:: tofu.util
:members:
ufo-kit-tofu-ed0e5bd/docs/source/conf.py 0000664 0000000 0000000 00000013601 15210541515 0020344 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
# -- Project information -----------------------------------------------------
project = 'Tofu'
copyright = '2020, Tomas Farago'
author = 'Tomas Farago'
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinxcontrib.bibtex',
]
autodoc_mock_imports = ['gi']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
# language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
html_css_files = [
'css/custom.css'
]
html_style = 'css/custom.css'
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'Tofudoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Tofu.tex', 'Tofu Documentation',
'Tomas Farago', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'tofu', 'Tofu Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Tofu', 'Tofu Documentation',
author, 'Tofu', 'One line description of project.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
bibtex_bibfiles = ['refs.bib']
bibtex_reference_style = 'author_year'
ufo-kit-tofu-ed0e5bd/docs/source/figs/ 0000775 0000000 0000000 00000000000 15210541515 0017774 5 ustar 00root root 0000000 0000000 ufo-kit-tofu-ed0e5bd/docs/source/figs/harmonization-images.jpg 0000664 0000000 0000000 00000250207 15210541515 0024631 0 ustar 00root root 0000000 0000000 JFIF C
$.' ",#(7),01444'9=82<.342
} !1AQa"q2#BR$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ? ((((((((((((((((((((((((((((((((+H[s+Uc! H=@~?`~F2_7]M³v#sTg^"Yh
-e fXePhJU+`3̣zZ&wY
nXx7֤ݳ"mf]k=U(NG)
II|:~rGoCRƌG_j;cc