Simple elastic augmentation for ND arrays.
Project description
augment
A simple elastic augmentation for ND arrays.
Installation
pip install augment-nd
Usage
import augment
import numpy as np
import math
# create some example data
image = np.zeros((100,500,500), dtype=np.float)
image[:] = 0.5
image[:,:10,:] = 0.75
image[:10,:10,:10] = 1
image[:,::10,:] = 1
image[:,:,::10] = 1
transformation = augment.create_identity_transformation(image.shape)
# jitter in 3D
transformation += augment.create_elastic_transformation(
image.shape,
num_control_points = [3,10,10],
jitter_sigma = [0.3, 10, 10])
# rotate around z axis
transformation += augment.create_rotation_transformation(
image.shape,
math.pi/4)
# apply transformation
image = augment.apply_transformation(image, transformation)
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
augment-nd-0.1.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for augment_nd-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eef78776d6f33d38e7ac37902c9e1b704d7b07ed82edc9b84063a6a4c9f65d7 |
|
MD5 | c5d8f6006f4a9913643f8905b0b1f92d |
|
BLAKE2b-256 | f8744b95ace92c70103c1a09a5dee14d9bb1e3baba1102c84ca38ca27f1f0e8a |