Skip to main content

Open AI library for research and education.

Project description

Kelluwen

Open AI library for research and education designed to be easy to use and develop with.

Installation

pip install kelluwen

Usage

from kelluwen.functions.transforms import generate_affine, apply_affine
from kelluwen.functions.tools import show_midplanes
from torch import rand

# Create image tensor of shape BxCxDxHxW
img = rand(2, 3, 100, 100, 100)

# Define parameters for affine transform. These transforms can be independent for each channel. If there is no channel dimension, the same transform will be applied for all channels.
parameters = dict(
    parameter_translation=rand(2,3),
    parameter_rotation=rand(2,3),
    parameter_scaling=rand(2,3),
    type_rotation="euler_xyz",
    transform_order="trs",
)

# Generate affine transform
transform = generate_affine(**parameters)

# Apply affine transform to image tensor
img_transformed = apply_affine(image=img, **transform)


# Show midplanes of volume. In this example we're using the RAS coordinate system, and we're scaling the features using a min-max method.
show_midplanes(
    image=img_transformed,
    title="Example midplanes",
    show=True,
    type_coordinates="ras",
    type_scaling="min_max")
# ```

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

kelluwen-0.0.29-py3-none-any.whl (24.4 kB view hashes)

Uploaded Python 3

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