Skip to main content

aim2numpy

aim2numpy is a Python library designed to convert AIM files, specifically CT scan data from Scanco, into numpy arrays.

Installation

You can install the library using pip:

pip install aim2numpy

Usage

Here's a basic example of how to use the library:

import aim2numpy

mynumpy = aim2numpy.extract("myaimfile.aim")
header_info = aim2numpy.get_header_info("myaimfile.aim")

AIM File Format

The AIM file format is used by Scanco Medical for storing CT scan data. These files contain volumetric data that can be used for various analyses in medical imaging and research.

Features

  • Easy Conversion: Convert AIM files to numpy arrays with a single function call.
  • Header Information: Extract metadata and header information from AIM files.
  • Compatibility: Works with CT scan data from Scanco.
  • Extensible: Easily integrate with other Python libraries for further data processing and analysis.

Example

import aim2numpy
import matplotlib.pyplot as plt

# Extract the numpy array from the AIM file
ct_scan_data = aim2numpy.extract("myaimfile.aim")

# Display a slice of the CT scan data
plt.imshow(ct_scan_data[:, :, ct_scan_data.shape[2] // 2], cmap='gray')
plt.title('CT Scan Slice')
plt.show()

# Print header information
header_info = aim2numpy.get_header_info("myaimfile.aim")
print(f"Dimensions: {header_info['dimensions']}")
print(f"Element size: {header_info['element_size']} mm")
print(f"Processing log: {header_info['processing_log']}")

Requirements

  • numpy
  • struct
  • matplotlib

Installation for Development

If you want to install the library for development purposes, you can clone the repository and install it locally:

git clone https://github.com/Alexhal9000/aim2numpy.git
cd aim2numpy
pip install -e .

Running Tests

To run the tests, use the following command:

python -m unittest discover tests

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for aim2numpy 0.3.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 aim2numpy 0.3.1
File Size Uploaded Provenance
aim2numpy-0.3.1.tar.gz 6.4 kB Without provenance Details

Release files / aim2numpy-0.3.1.tar.gz

Download URL aim2numpy-0.3.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c2acf02de407101a8b378d2e15f075088e99a492de265e05f02780e3df02177a
BLAKE2b-256 checksum
How to use checksums
9687d8b8e7745ca04f925ad3d32b9a2d4d64dd191abd12be10c79a9228b2edcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Security for aim2numpy 0.3.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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