Skip to main content

Neutron imaging geometric correction for cylindrical samples

Project description

neutron-geomcorr (Neutron Geometry Correction)

Documentation Status

Formerly known as CylindricalGeometryCorrection, this library performs geometric corrections for neutron transmission imaging of cylindrical samples (both solid and hollow).

Principle

Any homogeneous cylindrical sample placed in a beam (neutron for example) will show a much higher transmission signal near the edge seen by the beam, compare to the center. This is simply due to the fact that the beam has to go through more material at the center compare to the side.

ATTENTION: This library only works with cylinder placed in the vertical position!

The following figure illustrate this.

image

In order to correctly analyze data for those samples, one must cancel this cylindrical effect by "making" the sample flat related to the direction of the beam. The user needs to specify the position of the center as well as the radius of the cylinder. The program will then produce an image corresponding to the same rectangular sample. Such samples are called homogeneous because they are made of only one uniform and homogeneous material. But program also work with inhomogeneous sample for which the cylinder is hollow such as shown here.

image

Program works the same way, user needs to specify center and inner and outer radius of material sample.

Installation

Using Pixi (Recommended for Development)

# Install pixi if you haven't already
curl -fsSL https://pixi.sh/install.sh | bash

# Clone the repository
git clone https://github.com/ornlneutronimaging/CylindricalGeometryCorrection.git
cd CylindricalGeometryCorrection

# Install dependencies and setup environment
pixi install

# Run Python with the package
pixi run python

Using pip

pip install neutron-geomcorr

After package is published to PyPI.

Using conda

conda install -c neutronimaging neutron-geomcorr

After package is published to conda.

Usage

from neutron_geomcorr.geometry_correction import GeometryCorrection

# Initialize with your image files
o_cgc = GeometryCorrection(list_files=['image1.tif', 'image2.tif'])
o_cgc.load_files()

# Define cylinder parameters
o_cgc.define_parameters(pixel_center=256, outer_radius=200)

# Run correction
o_cgc.correct()

# Access corrected data
corrected_images = o_cgc.list_data_corrected

Development

Running Tests

pixi run test

Building Documentation

pixi run build-docs

Building Package

# For PyPI
pixi run pypi-build

# For conda
pixi run conda-build

Tutorial

It's recommended to follow the notebook tutorials in the notebooks/ directory to learn how to use the library

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

neutron_geomcorr-2.0.0.tar.gz (21.6 MB view details)

Uploaded Source

Built Distribution

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

neutron_geomcorr-2.0.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file neutron_geomcorr-2.0.0.tar.gz.

File metadata

  • Download URL: neutron_geomcorr-2.0.0.tar.gz
  • Upload date:
  • Size: 21.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for neutron_geomcorr-2.0.0.tar.gz
Algorithm Hash digest
SHA256 6aa03645ce64754819bf9009d28d72816dc6f93a711f2152e33907d753cc9a72
MD5 0ffda544992286086ae6e4872562209e
BLAKE2b-256 c9adb01b0fe8da122ba720a120be8689c46ab53228ca3d1ef32b61637a11cf92

See more details on using hashes here.

Provenance

The following attestation bundles were made for neutron_geomcorr-2.0.0.tar.gz:

Publisher: package.yaml on ornlneutronimaging/CylindricalGeometryCorrection

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file neutron_geomcorr-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for neutron_geomcorr-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30dd6bf83b0bf399c1a0fae5b7551b53662168d3cb40effd16577bb8a144d68e
MD5 6137fcee1c0b626ee9d540191cc9a4c1
BLAKE2b-256 f6d2c5976e89c48d29186f1818f42524c033ad77d5b26046561e2601270f2787

See more details on using hashes here.

Provenance

The following attestation bundles were made for neutron_geomcorr-2.0.0-py3-none-any.whl:

Publisher: package.yaml on ornlneutronimaging/CylindricalGeometryCorrection

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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