PyTorch bindings for PYRO-NN (https://github.com/csyben/PYRO-NN)
Project description
pyronn-torch
This repository provides PyTorch bindings for PYRO-NN, a collection of back-rotatable projectors for CT reconstruction.
Feel free to cite our publication:
@article{PYRONN2019,
author = {Syben, Christopher and Michen, Markus and Stimpel, Bernhard and Seitz, Stephan and Ploner, Stefan and Maier, Andreas K.},
title = {Technical Note: PYRO-NN: Python reconstruction operators in neural networks},
year = {2019},
journal = {Medical Physics},
}
Installation
From PyPI:
pip install pyronn-torch
From this repository:
git clone --recurse-submodules --recursive https://github.com/theHamsta/pyronn-torch.git
cd pyronn-torch
pip install torch
pip install -e .
You can build a binary wheel using
python setup.py bdist_wheel
Usage
import pyronn_torch
#ConeBeamProjector(volume_shape,
# volume_spacing,
# volume_origin,
# projection_shape,
# projection_spacing,
# projection_origin,
# projection_matrices)
projector = pyronn_torch.ConeBeamProjector(
(128, 128, 128),
(2.0, 2.0, 2.0),
(-127.5, -127.5, -127.5),
(2, 480, 620),
[1.0, 1.0],
(0, 0),
np.array([[[-3.10e+2, -1.20e+03, 0.00e+00, 1.86e+5],
[-2.40e+2, 0.00e+00, 1.20e+03, 1.44e+5],
[-1.00e+00, 0.00e+00, 0.00e+00, 6.00e+2]],
[[-2.89009888e+2, -1.20522754e+3, -1.02473585e-13,
1.86000000e+5],
[-2.39963440e+2, -4.18857765e+0, 1.20000000e+3,
1.44000000e+5],
[-9.99847710e-01, -1.74524058e-2, 0.00000000e+0,
6.00000000e+2]]]) # two projection matrices
)
projection = projector.new_projection_tensor(requires_grad=True)
projection += 1.
result = projector.project_backward(projection, use_texture=True)
assert projection.requires_grad
assert result.requires_grad
loss = result.mean()
loss.backward()
Or easier with PyCONRAD (pip install pyconrad)
projector = pyronn_torch.ConeBeamProjector.from_conrad_config()
The configuration can then be done using CONRAD (startable using conrad from command line)
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
pyronn-torch-0.1.0.tar.gz
(38.6 kB
view hashes)
Built Distributions
Close
Hashes for pyronn_torch-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeb42571ae48dd0f96554db1415c66b910f06d400491ae648d589930494140ac |
|
MD5 | ba1dfb950cda737144cb07ee9bdf23a2 |
|
BLAKE2b-256 | 59a0ebd91ab8f9fa818667011eb05f0d71641fb8a0ba5201bf0305359d2f5265 |
Close
Hashes for pyronn_torch-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dbab29aa50253c000e280f13039e296a221b511b81661ad20a77d4da6e62efb |
|
MD5 | 05f67c8add47b9bbcbefc0b2ffef8b62 |
|
BLAKE2b-256 | 50761a6ef32a5de23276a067330f2ddf388748bf9246e9b2eeb2d8b868cd84eb |
Close
Hashes for pyronn_torch-0.1.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9904e4cdf5b1cca2dfb349a1d366fcbac82a8292a6e6397280afa90ad509a2c1 |
|
MD5 | a6eb106e9cea2c5ebca898cce0acb14a |
|
BLAKE2b-256 | a96510507da7447541405ae1f47cbc5fdb1021c22b8876d910b0b60c5149cf5c |
Close
Hashes for pyronn_torch-0.1.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab0bbb6d4b112b22144d79cb328d02f1660861adb521dd4a24e6654ec851ade0 |
|
MD5 | dcf6fcd651333ea5be7c8d8465c16430 |
|
BLAKE2b-256 | fdad6d2f873055e3ce605930c4e30c5b3ccfe9049850d298bc201632e24100a6 |