Skip to main content

txrm2tiff

Converts TXRM/XRM files to OME-TIFF files.

Txrm2tiff was created for users of beamline B24 of Diamond Light Source by Thomas Fish. This has been adapted from, and is used by, B24's the automatic processing pipeline. Parts of this code were originally written by Kevin Savage, with further additions and amendments by Peter Chang, Victoria Beilsten-Edmands.

Installation

Available on PyPI and conda-forge as txrm2tiff. To install:

  • PyPI: python -m pip install txrm2tiff
  • conda-forge: conda install -c conda-forge txrm2tiff

Instructions

txrm2tiff {--input input file path (required)} {--reference reference file path (optional, default=None)} {--output path (optional, default=None)} {--annotate (optional)} {--datatype output data type (optional, choices=[uint16, float32, float64], default=None)} {--apply-shifts (optional)} {--ignore-ref (optional)} {--set-logging (optional), default="info"}

If no output path is supplied, the output file will be placed at the input path with the extension ".ome.tiff". The ".ome" signifies the OME XML metadata header.

Unless the data type is specified, the data type will be as it would be direct from XRM Data Explorer. This means that unreferenced images will remain uint16, whereas referenced images will be output as float32.

Logging options are:

  • debug OR 1
  • info OR 2
  • warning OR 3
  • error OR 4
  • critical OR 5

This README aims to be accurate to the latest version with useful examples. However, txrm2tiff -h or txrm2tiff --help will be 100% accurate to the installed version, unlike this README, so please do consult that too.  

- Setup options:

txrm2tiff setup {--windows-shortcut (WINDOWS ONLY: optional, creates shortcut on the desktop for drag'n'drop processing)}

txrm2tiff setup -h or txrm2tiff setup --help will give more info.  

- Inspector options:

txrm2tiff inspect {--input input file path (required)} {--extra (optional, default=False)} {--list-streams (optional, default=False)} {--inspect-streams space separated streams (optional)}

txrm2tiff inspect --input or txrm2tiff inspect -i followed by the path of a txrm/xrm file will output some basic information about the images contained.

  • Adding --extra or -e will add further information to this output.
  • Adding --list-streams or -l will list all of the streams* in addition to the any previous output. This will be a lot so it may be useful to save this to a file using > file.txt.
  • Adding --inspect-streams or -s followed by a 1 or more space separated stream names will read each stream using a variety of formats. As txrm and xrm files do not save the streams with information on what data type is being used**, the output will take some interpreting.

txrm2tiff inspect -h or txrm2tiff inspect --help will give more info.

Additional Notes:

*XRM and TXRM files are 'OLE' type files. These files to separate and store information in streams.

** with the exception of images, which do get the image data type saved separately.

NOTE: any commands beginning with txrm2tiff are essentially equivalent to using python -m txrm2tiff (arguments will be parsed by the same parser via either method). This may be useful if there were any installation issues.

dragndrop.bat has been supplied allowing windows users to drag and drop individual files or entire directories for processing (note: you cannot set output path this way). This may require some setup depending on your Python installation, so please see the file.

Examples:

txrm2tiff -h and txrm2tiff setup --h will give more info

txrm2tiff -i input.txrm Saves "input.ome.tiff" with reference applied, if available.

txrm2tiff -i input.txrm -r ref_stack.txrm Saves "input.ome.tiff" with a reference image applied from running Despeckle & Average on the the txrm stack. This Despeckle & Average algorithm is near-identical to the Zeiss algorithm, based on their logic.

txrm2tiff --input input.txrm --reference ref_single.xrm --ignore-ref Saves "input.ome.tiff" with custom reference applied from a single image (e.g. a Despeckled_Ave.xrm file). If a custom reference is supplied, the ignore reference argument will be ignored.

txrm2tiff -i input.xrm -o custom-output.ome.tiff Saves "custom-output.ome.tiff" with reference applied, if available.

txrm2tiff -i input.xrm --annotate Saves "input.ome.tiff", as well as a separate file "input_Annotated.tiff", which has annotations overlaid (if annotations are found) and scale bar.

txrm2tiff --input input.xrm --ignore-ref --set-logging debug Saves "input.ome.tiff" and ignores any reference, shows debug and above level log messages.

txrm2tiff --input input.xrm --apply-shifts --datatype uint16 Saves "input.ome.tiff", applies any available shifts within the file, and saves the output as uint16.

txrm2tiff -i input.xrm --output custom-output.ome.tif --set-logging error Saves "custom-output.ome.tiff", shows error and above level log messages.

To batch convert:

txrm2tiff --input path/to/inputDirectory/ Converts all XRM/TXRM files within input_directory with reference applied, if available.

txrm2tiff --input path/to/inputDirectory/ --ignore-ref Converts all XRM/TXRM files within input_directory, ignoring all references.

txrm2tiff --input path/to/inputDirectory/ --output path/to/outputDirectory/ --ignore-ref Converts all XRM/TXRM files within "inputDirectory", saving to the automatic name within the specified output directory, ignoring all references.

Batch conversion notes:

  • --output must be a directory or it will be ignored and files placed in the same directory as the XRM/TXRMs
  • Sub directories containing any XRM/TXRM files found within "inputDirectory" will be copied to "outputDirectory" (directories will be created if they don't already exist)
  • --reference inputs will be ignored for batch conversion

Features

  • Converts XRM/TXRM v3.0 (from XM Controller) & v5.0 (from XRM Data Explorer) files to TIFF.
  • If a reference has been applied within XM Controller/XRM Data Explorer, it will automatically apply the reference (image * 100.0 / reference, as done by XM Controller). Internal references can also be ignored.
  • Custom reference images can be specified (can be a TXRM or XRM file, or a TIFF image or stack) - this option overrides any internally stored reference and the ignore reference option.
  • If the reference exposure is available (e.g. from XRM/TXRM or OME-TIFF), the reference image will be rescaled to the image exposure at 0° (if applicable).
  • Any annotations from XRM/TXRM v5.0 files can be exported and saved (along with a scale bar).
  • Data type of the output image can be specified (warnings will be given if the data type limits off the dynamic range of the image, also values are rounded before casting float -> integer).
  • Metadata will be added in OME XML format to the header.
  • Batch convert options.
  • Inspector (can extract any information from XRM/TXRM files).
  • Within Python, XRM/TXRM files can be opened and interacted with using the function open_txrm (from txrm2tiff import open_txrm), which returns a Txrm object of the correct version. Recomended usage: with open_txrm(...) as txrm:.
  • Within Python, XRM/TXRM files can quickly be converted and saved using convert_and_save (from txrm2tiff import convert_and_save).

Release files for txrm2tiff 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for txrm2tiff 2.2.1
File Size Uploaded
txrm2tiff-2.2.1.tar.gz 83.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for txrm2tiff 2.2.1
File Interpreter ABI Platform
txrm2tiff-2.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 154.2 kB

Release files / txrm2tiff-2.2.1.tar.gz

Download URL txrm2tiff-2.2.1.tar.gz
Size 83.5 kB
Tags Source
SHA-256 checksum
How to use checksums
93ddd35e5f5749abd5b5a5b990bf064731d132de410a251167ee7fa860302163
BLAKE2b-256 checksum
How to use checksums
c5fece3f07b64775aa85fc6a68df050297f35cb5b68fb68ffaed571c717c1c60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / txrm2tiff-2.2.1-py3-none-any.whl

Download URL txrm2tiff-2.2.1-py3-none-any.whl
Size 70.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7eaab9ee3e1fdb72fbc59ce75207e0b8e66aeae013f78da9c917a663b26610f
BLAKE2b-256 checksum
How to use checksums
0ec3d6d92faef563782cc5675c91ee2f1e77d6d53c5ae7bdf653e39954fe5f59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.1 This release

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

2.0.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page