Skip to main content

Neutron Imaging Reduction

Project description

NeutronImagingScripts

This pakcage contains a suite of Python modules and scripts that are critical for the data reduction of Neutron Imaging at Oak Ridge National Laboratory.

Overview

Installation

General users

Install the package (once published on pip) with

$ pip install NeutronImagingScripts

Developers

For developers, it is highly recommended to setup an isolated virtual environment for this repository. After cloning this repository to your local machine, go to the root of this repo and use the follwing commands to install dependencies

$ pip install -r requirements.txt
$ pip install -r requirements_dev.txt

use the following command to install this package to your path

$ pip install -e .

For unit test, run pytest tests at the root of this repo.

Usage

Use as a Package

Examples of using this package as a Python module are provided as Jupyter Notebooks insdie the example folder.

Use as a commandline tool

Generate Configuration File for Data Reduction

To generate the json file that is needed for subsequent data reduction, use

$ generate_config.py IPTS-20267/raw/radiographs IPTS-20267/raw/ob IPTS-20267/raw/df IPTS-20267.json

where

  • IPTS-20267/raw/radiographs contains the raw images
  • IPTS-20267/raw/ob contains open beam images (white field)
  • IPTS-20267/raw/df contains dark field images

If you would like to have multiple experiment configuration files nested in one json file, simply use

$ generate_config.py IPTS-20267/raw/radiographs,IPTS-20267-2/raw/radiographs IPTS-20267/raw/ob IPTS-20267/raw/df IPTS-20267.json

notice that:

  • You can have more than one folder for raw images, but they need to be within the same string separated by ,.
  • You can have only one folder for open beam directory
  • You cna have only one folder for dark field directory

The command above will yield a json file with the following structure

 {"IPTS-20267": {"CONFIG_DATA"},
  "IPTS-20268": {"CONFIG_DATA"}
 }

The default tolerance for the categorization with respect to aperture positions is 1mm. However, you can change the default value by specify it as below

$ generate_config.py \
    IPTS-20267/raw/radiographs \
    IPTS-20267/raw/ob \
    IPTS-20267/raw/df \
    IPTS-20267.json --tolerance=2

MCP Detector correction

After installing this package, the scripts located in scripts should be visible in your Path. Simpy type mcp_detector_correction.py, you should see the following

$ mcp_detector_correction.py
Usage:
    mcp_detector_correction [--skipimg] [--verbose] <input_dir> <output_dir>
    mcp_detector_correction (-h | --help)
    mcp_detector_correction --version

Therefore, you can process the example data with the following command at the root of this repo

$ mcp_detector_correction.py data tmp

and you will see the following in your terminal

$ mcp_detector_correction.py data tmp
Parsing input
Validating input arguments
Processing metadata
Loading images into memory
Perform correction
corrected image summary
	dimension:	(916, 512, 512)
	type:	float64
Writing data to tmp

NOTE: make sure you create a tmp folder first.

Developer Notes

Project details


Release history Release notifications | RSS feed

This version

1.2

Download files

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

Source Distribution

NeutronImaging-1.2.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

NeutronImaging-1.2-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file NeutronImaging-1.2.tar.gz.

File metadata

  • Download URL: NeutronImaging-1.2.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.10

File hashes

Hashes for NeutronImaging-1.2.tar.gz
Algorithm Hash digest
SHA256 fb56f5cff1af44400dcde00ce76934cbed0e34d961414a487daf24cbab8e9915
MD5 1a5a2fcbc5c85c2a4e76ed9ae6f530b4
BLAKE2b-256 7da6748fea90c8c1c4ed867f751b7efa42188835fdc2bea79bf861d4231a30d8

See more details on using hashes here.

File details

Details for the file NeutronImaging-1.2-py3-none-any.whl.

File metadata

  • Download URL: NeutronImaging-1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.10

File hashes

Hashes for NeutronImaging-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11bc3fc2cb59aee0e743e29a8dcef1c924bb61e720da9e2c0b79a29a4158cb7a
MD5 297ab62f72a33a9b11f35548dc1767fc
BLAKE2b-256 dcbc9d475ec1f11f87e4ba751d0198cc30405a98314d5284cb51ca9a71b0a4ac

See more details on using hashes here.

Supported by

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