Skip to main content

A library to convert Scanco AIM image files to numpy arrays and extract header information

Project description

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.

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

aim2numpy-0.2.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

aim2numpy-0.2.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file aim2numpy-0.2.2.tar.gz.

File metadata

  • Download URL: aim2numpy-0.2.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for aim2numpy-0.2.2.tar.gz
Algorithm Hash digest
SHA256 402130ecf49d8b04eb5fc9df0ce758eebc33193bae7bf13906eda46397fe629c
MD5 6dc22602643c29e60d5ff93c8deb49fb
BLAKE2b-256 77e8ece0421492b8f9c7facecdfbd4aba72fafd54f6bc26e23dbf5394a5a3b54

See more details on using hashes here.

File details

Details for the file aim2numpy-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: aim2numpy-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for aim2numpy-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e046009939f9f3c2e9e18ec9bfb8f03d8665f9010f7f7398b3c5a94b64c49d2c
MD5 efd90b1ac0bc016e06ec9784a68f80bd
BLAKE2b-256 965a12ecb3c77d8f2157b9be0a87b3ee2c854fc2d0d37767eb1c300e58bec357

See more details on using hashes here.

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