Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
cde954e
Fix file_to_dictionary call: translate -> translation
fgbossema Jun 13, 2019
42a1145
Merge pull request #6 from fgbos/fgbos-patch-1
wjp Jun 13, 2019
86a625a
Fix python version in README
ahendriksen Jun 7, 2019
302e6f5
Merge pull request #5 from ahendriksen/fix-readme
Jun 13, 2019
786d9f6
WIP: versie 2
Jun 17, 2019
5127d9b
Add FLEXTOML_VERSION to toml file format
Jun 17, 2019
678c7c4
Ignore PyCharm project files
adriaangraas Jun 17, 2019
7e0dc1b
Split correction into separate function
Jun 17, 2019
552b0c6
Fix various small things
Jun 17, 2019
e80cc77
Add geom_diff method, with example.
adriaangraas Jun 17, 2019
3784b80
Deprecate read_*log functions
Jun 18, 2019
8b80e81
Implement geom.log() method
Jun 18, 2019
7bab780
Fix error message in correct.correct()
Jun 18, 2019
3b77332
Add logging to correct.correct() and correct.correct_roi()
Jun 18, 2019
00f33f1
Add logging to parse_*log() functions
Jun 18, 2019
352cb3e
Update reconstruction example to work with the new corrections
Jun 18, 2019
b6c1426
Rename correction profile and various fixes
Jun 18, 2019
32f8afd
Merge pull request #7 from ahendriksen/update-toml-format
Jun 18, 2019
b0d9efe
Fix parse_flexraymeta() for pre-binned data
wjp Oct 9, 2019
aa36746
Fix parse_flexraymeta() for pre-binned data
wjp Oct 9, 2019
a0d53d3
Fix ROI correction in _flex_motor_correct_
Jul 28, 2021
2639ad9
Merge pull request #9 from vandriiashen/roi_fix
wjp Sep 29, 2021
06c130e
Fix ROI correction in _flex_motor_correct_
wjp Sep 29, 2021
7a4dff6
Update conda channels in installation instruction
wjp Jan 17, 2022
9ae3fa4
Add overwrite option to write_toml
wjp Jan 17, 2022
a55f043
Don't let correct.* functions modify their input
wjp Jan 17, 2022
ba8c680
Log result of correct_vol_center
wjp Jan 17, 2022
f4bdc60
Fix custom geometry vectors for subsetting
fgbossema Feb 24, 2020
755e4e8
Compute img_pixel in read_flexraymeta
fgbossema Feb 24, 2020
ca36bc9
Add motor corrections to read_flexraymeta
fgbossema Feb 24, 2020
9501109
Add read_flexraydatasettings to read 'data settings XRE.txt'
fgbossema Feb 24, 2020
eb44af3
Try 'data settings XRE.txt' and 'geometry.toml' as fallback in read_f…
fgbossema Feb 24, 2020
0cc795e
Move all transforms3d calls together
wjp Jan 24, 2022
cd1916a
Remove unnecessary dependencies
wjp Jan 24, 2022
6cb7721
Replace transforms3d by scipy.spatial.transform.Rotation
wjp Jan 24, 2022
cc6f1a9
Remove global pyqtgraph import
wjp Jan 24, 2022
a1aa9fa
Remove global astra import
wjp Jan 24, 2022
f6b0755
Remove global matplotlib imports
wjp Jan 24, 2022
8cb9463
Merge branch 'master' into development
wjp Jan 25, 2022
a7289da
Make correct_roi calls consistent
wjp Jan 25, 2022
3cf5305
Fix removed function signatures
wjp Jan 25, 2022
ed74bbe
Fix writing files in current dir
wjp Jan 25, 2022
3f4b535
Log origin of geometry
wjp Jan 25, 2022
6aa85b3
Fix flextoml_version case when reading toml
wjp Jan 25, 2022
9cdb90d
Make parse_flexray* function names reflect actual files read
wjp Jan 25, 2022
c0db28b
Make geometry.toml handling functions more consistent
wjp Jan 25, 2022
f7c30ec
Update samples to new reading functions
wjp Jan 25, 2022
2d9e5b8
Update read_flexray
wjp Jan 25, 2022
bb06277
Fix correct_vol_center
wjp Jan 25, 2022
0a4783e
Log modified geometry in _check_success_
wjp Jan 25, 2022
e4006b1
Add correction options to read_flexray
wjp Jan 26, 2022
5f55ce7
Clean up example
wjp Jan 26, 2022
14323b6
Merge branch 'development'
wjp Jan 26, 2022
e4652cc
Add note about reproducibility of corrections
wjp Jan 26, 2022
b96b47f
Fix name collision
wjp Jan 31, 2022
d3903bc
Fix ROI reading for new 'data settings XRE.txt' files
wjp Feb 3, 2022
13832d3
Warn about potentially wrong ROI
wjp Feb 11, 2022
04ed7f6
Add up-to-date correction profiles
wjp Jul 4, 2022
0cebacf
Add up-to-date correction profile
wjp Nov 16, 2022
12aa62e
Add up-to-date correction profiles
askorikov Aug 21, 2023
96920b2
Add up-to-date correction profile
askorikov Jul 25, 2024
9a19970
Refactor conda build files
askorikov Jul 25, 2024
f457b93
Add more metadata
askorikov Jul 26, 2024
cda5d87
Update README
askorikov Jul 26, 2024
9f2f4df
Update makefile for conda packages
askorikov Jul 26, 2024
25a8313
Remove changelog file
askorikov Jul 29, 2024
4cad8dd
Fix examples
askorikov Jul 29, 2024
803a77a
Fix compatibility with matplotlib >= 3.6
askorikov Jul 29, 2024
37f08ba
Add entry for building python wheels
askorikov Jul 29, 2024
0bd3f2a
Update docs
askorikov Jul 29, 2024
52cafd2
Fix escape warning
wjp Aug 1, 2024
554c7ff
Let read_stack directly store stack in transposed form
wjp Aug 1, 2024
696b3d7
Add transpose test
askorikov Aug 28, 2024
3b70505
Fix imageio v2 API warning
askorikov Aug 28, 2024
c8929d5
Fix typos
askorikov Aug 28, 2024
dcf5f4b
Version 1.0.1
askorikov Aug 28, 2024
d2377ab
Deprecate compression for image writing
askorikov Aug 28, 2024
d6a60d6
Update setup.py and Makefile to follow the style of other flexbox pac…
askorikov Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ venv.bak/
# mypy
.mypy_cache/

*~
# IntellIJ
.idea/
*~
31 changes: 0 additions & 31 deletions CHANGELOG.md

This file was deleted.

69 changes: 58 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,65 @@
.PHONY: clean clean-test clean-pyc clean-build docs help install_dev
.DEFAULT_GOAL := help

.PHONY: install docs
define BROWSER_PYSCRIPT
import os, webbrowser, sys

install:
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT

define PRINT_HELP_PYSCRIPT
import re, sys

for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT

BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc

clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

docs/.nojekyll:
touch docs/.nojekyll

docs: docs/.nojekyll install_dev ## generate Sphinx HTML documentation, including API docs
make --directory doc_sources clean
make --directory doc_sources html
$(BROWSER) docs/index.html

install: clean ## install the package to the active Python's site-packages
pip install .

install_dev:
# https://stackoverflow.com/a/28842733
install_dev: ## install in editable mode
pip install -e .[dev]

docs: install_dev
@cd doc_sources && make html

style: install_dev
black flexdata
conda_package: ## build Conda package
conda build conda/ -c astra-toolbox -c nvidia

conda_package: install_dev
conda build conda/ -c astra-toolbox/label/dev -c conda-forge -c owlas
pypi_wheels: ## build wheel package for PyPI
python -m build --wheel
45 changes: 19 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
# flexDATA

This project is a part of the larger X-ray tomographic reconstruction toolbox comprised of [flexDATA], [flexTOMO] and [flexCALC].
flexDATA contains IO routines that were originally developed for the Flex-Ray X-ray CT scanner but can be used for reading and writing data from other types of CT scanners. It provides an interface between a scanner and a GPU-based CT reconstruction [ASTRA toolbox](https://www.astra-toolbox.com/). It can be especially helpful when the scanner has many degrees of freedom and the geometry of each scan is defined by a large number of parameters.
This project is a part of the larger X-ray tomographic reconstruction toolbox comprised of [flexDATA](https://github.com/cicwi/flexDATA), [flexTOMO](https://github.com/cicwi/flexTOMO) and [flexCALC](https://github.com/cicwi/flexCALC).
flexDATA contains IO routines that were originally developed for the Flex-Ray X-ray CT scanner but can be used for reading and writing data from other types of CT scanners. It provides an interface between a scanner and a GPU-based CT reconstruction [ASTRA Toolbox](https://github.com/astra-toolbox/astra-toolbox). It can be especially helpful when the scanner has many degrees of freedom and the geometry of each scan is defined by a large number of parameters.

## Getting Started

It takes a few steps to setup flexDATA on your machine. We recommend that the user installs [Anaconda package manager](https://www.anaconda.com/download/) for Python 3.
It takes a few steps to setup flexDATA on your machine. We recommend that the user installs [conda package manager](https://docs.anaconda.com/miniconda/) for Python 3.

### Installing with conda

Simply install with:
```
conda create -n <your-environment> python=3.6
conda install -c cicwi -c astra-toolbox/label/dev -c conda-forge -c owlas flexdata
```
`conda install flexdata -c cicwi -c astra-toolbox -c nvidia`

### Installing from source
### Installing with pip

To install flexDATA you will need the latest version of the ASTRA toobox (preferably development version). It can be installed via command line with Anaconda:
`pip install flexdata`

```
conda install -c astra-toolbox/label/dev astra-toolbox
```
### Installing from source

To install flexDATA, simply clone this GitHub project. Go to the cloned directory and run PIP installer:
```
```bash
git clone https://github.com/cicwi/flexdata.git
cd flexdata
pip install -e .
```

## Running the examples

To learn about the functionality of the package check out our examples folder. Examples are separated into blocks that are best to run in Spyder environment step-by-step.
To learn about the functionality of the package check out our `examples/` folder. Examples are separated into blocks that are best to run in VS Code / Spyder environment step-by-step.

## Modules

flexDATA is comprised of the following modules:

* data: read / write raw projection stacks (tiffs), parse settings file of the scanner to produce meta data.
* geometry: geometry classes (circular, helical and linear).
* display: simple display routines for 3D arrays
* `flexdata.data`: Read / write raw projection stacks (tiffs), parse settings file of the scanner to produce meta data.
* `flexdata.geometry`: Geometry classes (circular, helical and linear).
* `flexdata.display`: Simple display routines for 3D arrays

Typical code:
```
Typical usage:
```python
# Import:
from flexdata import data

Expand All @@ -52,7 +45,7 @@ proj = data.read_tiffs(path, file_name)
flat = data.read_tiffs(path, file_name)

# Read metadata:
geom = data.read_flexraylog(path)
geom = data.read_flexraylog(path)

# Generate an ASTRA-compatible projection geometry description:
proj_geom = geom.astra_proj_geom(proj.shape)
Expand All @@ -63,19 +56,19 @@ proj_geom = geom.astra_proj_geom(proj.shape)
* **Alexander Kostenko** - *Initial work*
* **Allard Hendriksen** - *Packaging and installation*
* **Jan-Willem Buurlage** - *Packaging and installation*
* **Willem Jan Palenstijn** - *Packaging, installation and maintenance*
* **Alexander Skorikov** - *Packaging, installation and maintenance*

See also the list of [contributors](https://github.com/cicwi/flexdata/contributors) who participated in this project.

## How to contribute

Contributions are always welcome. Please submit pull requests against the `develop` branch.

If you have any issues, questions, or remarks, then please open an issue on GitHub.
Contributions are always welcome. If you have any issues, questions, or remarks, then please open an issue on GitHub.

## License

This project is licensed under the GNU GENERAL PUBLIC License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* To Willem Jan Palenstijn for endles advices regarding the use of ASTRA toolbox.
* To Willem Jan Palenstijn for endless advices regarding the use of ASTRA toolbox.
3 changes: 0 additions & 3 deletions conda/build.sh

This file was deleted.

3 changes: 0 additions & 3 deletions conda/conda_build_config.yaml

This file was deleted.

20 changes: 9 additions & 11 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ source:
path: ../

build:
number: '0'
noarch: python
number: 0
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation --verbose

requirements:
build:
- python {{ python }}
- tifffile
- transforms3d
- pyqtgraph
host:
- python >=3.7
- pip
- setuptools
- wheel

run:
- python
- python >=3.7
# dependencies are defined in setup.py
{% for dep in data['install_requires'] %}
- {{ dep.lower() }}
Expand All @@ -28,7 +30,3 @@ about:
home: https://github.com/cicwi/flexDATA
license_file: LICENSE.md
summary: "This project comprises IO routines for CT data."

extra:
maintainers:
- Alexander Kostenko
1 change: 1 addition & 0 deletions doc_sources/LICENSE.md
File renamed without changes.
1 change: 0 additions & 1 deletion doc_sources/changelog.md

This file was deleted.

9 changes: 1 addition & 8 deletions doc_sources/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
# sys.path.insert(0, os.path.abspath('.'))


# -- Support markdown -----------------------------------------------------
# See: <https://blog.readthedocs.com/adding-markdown-support/>

from recommonmark.parser import CommonMarkParser
source_parsers = {'.md': CommonMarkParser}
source_suffix = ['.rst', '.md']


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -43,6 +35,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'myst_parser'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
8 changes: 1 addition & 7 deletions doc_sources/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.. flexdata documentation master file, created by
sphinx-quickstart on Wed Oct 24 14:50:47 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to flexdata's documentation!
====================================

Expand All @@ -12,9 +7,8 @@ Contents:
:maxdepth: 2


readme
README.md
flexdata
changelog


Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 29126bc7917be84467c57b79940f875c
config: 52e211fcd5f58437c04148d4e19aab7f
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading