A reader and preprocessor for txrm/xrm data acquired by Zeiss microscopes.
Project description
Reading and preprocessing x-ray projection data in Zeiss .txrm format
This package extends the dxchange reader to read the Zeiss proprietary data format .txrm to python lists or arrays. In particular, the import of metadata from the file headers is extended to access information needed for reconstructing x-ray projection data, e.g. acquired on Zeiss x-ray microscopes. Further, the package contains some simple functions to preprocess x-ray projections in preparation for reconstruction. These include flat field correction, revision of detector shifts, downsampling, conversion into line integral domain and truncation correction.
For installation, please run
conda install -c conda-forge dxchange
pip install xrmreader
This example code uses pyconrad for visualization.
import xrmreader
import pyconrad.autoinit
from edu.stanford.rsl.conrad.data.numeric import NumericGrid
projection_data = r'your_file.txrm'
metadata = xrmreader.read_metadata(projection_data)
print(metadata)
# load raw data
raw_projections = xrmreader.read_txrm(projection_data)
NumericGrid.from_numpy(raw_projections).show('Raw projections')
# preprocess data in individual steps
projections = xrmreader.read_txrm(projection_data)
projections = xrmreader.divide_by_reference(projections, metadata['reference'])
projections = xrmreader.revert_shifts(projections, metadata['x-shifts'], metadata['y-shifts'])
projections = xrmreader.downsample(projections, spatial_factor=2)
projections = xrmreader.negative_logarithm(projections)
projections = xrmreader.truncation_correction(projections)
NumericGrid.from_numpy(projections).show('Preprocessed projections version 1')
# load and preprocess data in one step (this does the same thing as the individual steps above, but needs less memory)
preprocessed_projections = xrmreader.read_and_preprocess_txrm(projection_data)
NumericGrid.from_numpy(preprocessed_projections).show('Preprocessed projections version 2')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xrmreader-2.0.tar.gz
.
File metadata
- Download URL: xrmreader-2.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7788c611343a5bcc3c09c5d1aea386e19c444a608c93694e4e70a6188be13925 |
|
MD5 | 431f69bf8c2eb4a650b1ce2837a44dd5 |
|
BLAKE2b-256 | 61bfd2a683869a307ce0cce4b18075d02af13577f847c459fbcd194c2d53520b |
File details
Details for the file xrmreader-2.0-py3-none-any.whl
.
File metadata
- Download URL: xrmreader-2.0-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c0efc7dad5f3ae5226456051cabb6c5633ed8c9829d20ae99d5f65628aa8f9a |
|
MD5 | 72a8929b6d86c6b7d0f887ddf43a13c6 |
|
BLAKE2b-256 | 82a083a15a2331eeec130ec9d0f9b5d5fe7025781ba6332b76adf4e88b18a140 |