Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xrmreader-1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xrmreader-1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file xrmreader-1.1.tar.gz.

File metadata

  • Download URL: xrmreader-1.1.tar.gz
  • Upload date:
  • Size: 10.5 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

Hashes for xrmreader-1.1.tar.gz
Algorithm Hash digest
SHA256 e908e666a478d056ee386bb24d8135b67dc3f93ee0ef759d5a17230a81964ad2
MD5 2b5f65651e6264d830e4ba9718a6e7d7
BLAKE2b-256 ded96955231cc4999ce8259bf23d3c5e1466869a9811b75c6fbcf2b5cec42a31

See more details on using hashes here.

File details

Details for the file xrmreader-1.1-py3-none-any.whl.

File metadata

  • Download URL: xrmreader-1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 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

Hashes for xrmreader-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b82f1bbb2fa90990cb64cdee1fb03a07f396ec9d614699bf1670502f26ab19f
MD5 4dcfeb1126f1bca8e008a541d3984f8b
BLAKE2b-256 1ae2f9cd001e1763f4b6d912347fb82c9a03c4bc0a9e51aee01d67837f94c423

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page