Neutron imaging geometric correction for cylindrical samples
Project description
neutron-geomcorr (Neutron Geometry Correction)
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.
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.
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aa03645ce64754819bf9009d28d72816dc6f93a711f2152e33907d753cc9a72
|
|
| MD5 |
0ffda544992286086ae6e4872562209e
|
|
| BLAKE2b-256 |
c9adb01b0fe8da122ba720a120be8689c46ab53228ca3d1ef32b61637a11cf92
|
Provenance
The following attestation bundles were made for neutron_geomcorr-2.0.0.tar.gz:
Publisher:
package.yaml on ornlneutronimaging/CylindricalGeometryCorrection
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
neutron_geomcorr-2.0.0.tar.gz -
Subject digest:
6aa03645ce64754819bf9009d28d72816dc6f93a711f2152e33907d753cc9a72 - Sigstore transparency entry: 1792076696
- Sigstore integration time:
-
Permalink:
ornlneutronimaging/CylindricalGeometryCorrection@65f2ceea6b61ad7961e16d28dea76fd510c24826 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/ornlneutronimaging
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@65f2ceea6b61ad7961e16d28dea76fd510c24826 -
Trigger Event:
push
-
Statement type:
File details
Details for the file neutron_geomcorr-2.0.0-py3-none-any.whl.
File metadata
- Download URL: neutron_geomcorr-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30dd6bf83b0bf399c1a0fae5b7551b53662168d3cb40effd16577bb8a144d68e
|
|
| MD5 |
6137fcee1c0b626ee9d540191cc9a4c1
|
|
| BLAKE2b-256 |
f6d2c5976e89c48d29186f1818f42524c033ad77d5b26046561e2601270f2787
|
Provenance
The following attestation bundles were made for neutron_geomcorr-2.0.0-py3-none-any.whl:
Publisher:
package.yaml on ornlneutronimaging/CylindricalGeometryCorrection
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
neutron_geomcorr-2.0.0-py3-none-any.whl -
Subject digest:
30dd6bf83b0bf399c1a0fae5b7551b53662168d3cb40effd16577bb8a144d68e - Sigstore transparency entry: 1792076766
- Sigstore integration time:
-
Permalink:
ornlneutronimaging/CylindricalGeometryCorrection@65f2ceea6b61ad7961e16d28dea76fd510c24826 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/ornlneutronimaging
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@65f2ceea6b61ad7961e16d28dea76fd510c24826 -
Trigger Event:
push
-
Statement type: