pax_global_header00006660000000000000000000000064134727030240014514gustar00rootroot0000000000000052 comment=2469675b2a2eb9df13e7dc8b5e4250c370874afc tomogui-v0.3.1/000077500000000000000000000000001347270302400133665ustar00rootroot00000000000000tomogui-v0.3.1/.gitignore000066400000000000000000000015071347270302400153610ustar00rootroot00000000000000*.edf *.pyc *.idea* *.h5 *.pdf *.html *.cache* *.db *.dat *.cfg build/ dataTest/ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml coverage.rst *,cover # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ # PyBuilder target/ # Vim .*.swp # PyCharm .idea/ untilted/tomogui-v0.3.1/.gitlab-ci.yml000066400000000000000000000025721347270302400160300ustar00rootroot00000000000000 test:with_freeartmaster: type: test image: docker-registry.esrf.fr/dau/tomwer:python3.5_stretch_pyqt5 script: - export http_proxy=http://proxy.esrf.fr:3128/ - export https_proxy=http://proxy.esrf.fr:3128/ - python --version - python -m pip install pip --upgrade - python -m pip install setuptools --upgrade - pip install numpy --upgrade - python -m pip install PyQt5 --upgrade - python -m pip install matplotlib - python -m pip install -r requirements.txt --upgrade - source ./ci/tomogui_install.sh - install_freeart 'master' - freeart_version - python -m pip install . - xvfb-run --server-args="-screen 0 1024x768x24" -a tomogui test -v test:with_freeart3.3.1: type: test image: docker-registry.esrf.fr/dau/tomwer:python3.5_stretch_pyqt5 script: - export http_proxy=http://proxy.esrf.fr:3128/ - export https_proxy=http://proxy.esrf.fr:3128/ - python --version - python -m pip install pip --upgrade - python -m pip install setuptools --upgrade - pip install numpy --upgrade - python -m pip install PyQt5 --upgrade - python -m pip install matplotlib - python -m pip install -r requirements.txt --upgrade - source ./ci/tomogui_install.sh - install_freeart '3.3.1' - freeart_version - python -m pip install . - xvfb-run --server-args="-screen 0 1024x768x24" -a tomogui test -v tomogui-v0.3.1/ChangeLog.rst000066400000000000000000000024431347270302400157520ustar00rootroot00000000000000Change Log ========== 0.3.1: ------ - fix six import issue - update screenshot directive to fit the one of silx. 0.3.0: ------ - use silx.io.url to save get the file information, to store configurations and use silx.io.util.loadData to merge some code. - use the latest silx.gui.dialog.ImageFileDialog 0.2.0: 2018/03/16 ----------------- - deal with h5 files for saving/loading project, matrices, material definition - add sinogramselector - fix bug with fisx: create a unique material name - add continuous integration - add examples for fluorescence and transmission from .h5 files - add tutorial for fluorescence reconstruction - fix fisx issue when name wasn't unique was taking existing material definition if already existing - deal with several sinograms for Tx and FBP - move scripts to use the silx system. tomoGUIproject-> tomogui project and tomoGUIrecons -> tomogui recons - add applications creator, invert, materials and norm - add the configuration module as third party - add ImageFileDialog as third party 0.1.0 2017/07/21: ----------------- - add scripts tomoGUIproject and tomoGUIrecons - add precision management from the interpreter - deal with several fluorescence sinogram - can store project in .cfg files - draw materials composition from a mask - compatibility python 2 - python 3 tomogui-v0.3.1/LICENSE000066400000000000000000000036111347270302400143740ustar00rootroot00000000000000The silx toolkit is a software library and one of its goals is not to impose any license to the end user. Silx follows the permissive MIT license although it may include contributions following other licenses not interfering with the previous goal. Detailed information can be found in the copyright file. Silx uses the Qt library for its graphical user interfaces. A word of caution is to be provided. If users develop and distribute software using modules accessing Qt by means of Riverbank Computing Qt bindings PyQt4 or PyQt5, those users will be conditioned by the license of their PyQt4/5 software (GPL or commercial). If the end user does not own a commercial license of PyQt4 or PyQt5 and wishes to be free of any distribution condition, (s)he should be able to use PySide because it uses the LGPL license. The MIT license follows: Copyright (c) European Synchrotron Radiation Facility (ESRF) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. tomogui-v0.3.1/README.rst000066400000000000000000000016641347270302400150640ustar00rootroot00000000000000Tomogui ####### Tomogui offers a Graphical User Interface to run tomographic reconstruction based on freeart (https://gitlab.esrf.fr/freeart/freeart) and silx (https://github.com/silx-kit/silx) algorithms Installation ------------ pip install tomogui Usage ----- Tomogui contains two main applications: - tomogui project : to create a new project from scratch - tomogui recons : to run reconstruction from a configuration file created by 'tomogui project' See more in `documentation `_. Documentation ------------- Documentation of latest release is available at http://www.edna-site.org/pub/doc/tomogui/latest License ------- The source code of tomogui is licensed under the MIT license. See the `LICENSE `_ and `copyright `_ files for details. tomogui-v0.3.1/bootstrap.py000077500000000000000000000171021347270302400157610ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bootstrap helps you to test scripts without installing them by patching your PYTHONPATH on the fly example: ./bootstrap.py ipython """ __authors__ = ["Frédéric-Emmanuel Picca", "Jérôme Kieffer"] __contact__ = "jerome.kieffer@esrf.eu" __license__ = "MIT" __date__ = "02/03/2018" import sys import os import distutils.util import subprocess import logging logging.basicConfig() logger = logging.getLogger("bootstrap") def is_debug_python(): """Returns true if the Python interpreter is in debug mode.""" try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig if sysconfig.get_config_var("Py_DEBUG"): return True return hasattr(sys, "gettotalrefcount") def _distutils_dir_name(dname="lib"): """ Returns the name of a distutils build directory """ platform = distutils.util.get_platform() architecture = "%s.%s-%i.%i" % (dname, platform, sys.version_info[0], sys.version_info[1]) if is_debug_python(): architecture += "-pydebug" return architecture def _distutils_scripts_name(): """Return the name of the distrutils scripts sirectory""" f = "scripts-{version[0]}.{version[1]}" return f.format(version=sys.version_info) def _get_available_scripts(path): res = [] try: res = " ".join([s.rstrip('.py') for s in os.listdir(path)]) except OSError: res = ["no script available, did you ran " "'python setup.py build' before bootstrapping ?"] return res if sys.version_info[0] >= 3: # Python3 def execfile(fullpath, globals=None, locals=None): "Python3 implementation for execfile" with open(fullpath) as f: try: data = f.read() except UnicodeDecodeError: raise SyntaxError("Not a Python script") code = compile(data, fullpath, 'exec') exec(code, globals, locals) def run_file(filename, argv): """ Execute a script trying first to use execfile, then a subprocess :param str filename: Script to execute :param list[str] argv: Arguments passed to the filename """ full_args = [filename] full_args.extend(argv) try: logger.info("Execute target using exec") # execfile is considered as a local call. # Providing globals() as locals will force to feed the file into # globals() (for examples imports). # Without this any function call from the executed file loses imports try: old_argv = sys.argv sys.argv = full_args logger.info("Patch the sys.argv: %s", sys.argv) logger.info("Executing %s.main()", filename) print("########### EXECFILE ###########") module_globals = globals().copy() module_globals['__file__'] = filename execfile(filename, module_globals, module_globals) finally: sys.argv = old_argv except SyntaxError as error: logger.error(error) logger.info("Execute target using subprocess") env = os.environ.copy() env.update({"PYTHONPATH": LIBPATH + os.pathsep + os.environ.get("PYTHONPATH", ""), "PATH": os.environ.get("PATH", "")}) print("########### SUBPROCESS ###########") run = subprocess.Popen(full_args, shell=False, env=env) run.wait() def run_entry_point(entry_point, argv): """ Execute an entry_point using the current python context (http://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-creation) :param str entry_point: A string identifying a function from a module (NAME = PACKAGE.MODULE:FUNCTION) """ import importlib elements = entry_point.split("=") target_name = elements[0].strip() elements = elements[1].split(":") module_name = elements[0].strip() function_name = elements[1].strip() logger.info("Execute target %s (function %s from module %s) using importlib", target_name, function_name, module_name) full_args = [target_name] full_args.extend(argv) try: old_argv = sys.argv sys.argv = full_args print("########### IMPORTLIB ###########") module = importlib.import_module(module_name) if hasattr(module, function_name): func = getattr(module, function_name) func() else: logger.info("Function %s not found", function_name) finally: sys.argv = old_argv def find_executable(target): """Find a filename from a script name. - Check the script name as file path, - Then checks if the name is a target of the setup.py - Then search the script from the PATH environment variable. :param str target: Name of the script :returns: Returns a tuple: kind, name. """ if os.path.isfile(target): return ("path", os.path.abspath(target)) # search the file from setup.py import setup config = setup.get_project_configuration(dry_run=True) # scripts from project configuration if "scripts" in config: for script_name in config["scripts"]: if os.path.basename(script) == target: return ("path", os.path.abspath(script_name)) # entry-points from project configuration if "entry_points" in config: for kind in config["entry_points"]: for entry_point in config["entry_points"][kind]: elements = entry_point.split("=") name = elements[0].strip() if name == target: return ("entry_point", entry_point) # search the file from env PATH for dirname in os.environ.get("PATH", "").split(os.pathsep): path = os.path.join(dirname, target) if os.path.isfile(path): return ("path", path) return None, None home = os.path.dirname(os.path.abspath(__file__)) LIBPATH = os.path.join(home, 'build', _distutils_dir_name('lib')) cwd = os.getcwd() os.chdir(home) build = subprocess.Popen([sys.executable, "setup.py", "build"], shell=False, cwd=os.path.dirname(os.path.abspath(__file__))) build_rc = build.wait() if not os.path.exists(LIBPATH): logger.warning("`lib` directory does not exist, trying common Python3 lib") LIBPATH = os.path.join(os.path.split(LIBPATH)[0], "lib") os.chdir(cwd) if build_rc == 0: logger.info("Build process ended.") else: logger.error("Build process ended with rc=%s", build_rc) sys.exit(-1) if __name__ == "__main__": if len(sys.argv) < 2: logger.warning("usage: ./bootstrap.py