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.0.9.tar.gz
(38.7 kB
view hashes)
Built Distributions
Close
Hashes for pyronn_torch-0.0.9-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf8b9d24b4cc4946190cb5feb0737f2066a26c263f01de0b194d8141cbb0d512 |
|
MD5 | 623ece86bfa046bda7d8057318ca07b7 |
|
BLAKE2b-256 | bf82914953a3bc7d8cbec461120b3cbf3845074c1e23ccab289c1a68065b29a8 |
Close
Hashes for pyronn_torch-0.0.9-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 267b42be82b3769a57bd76a597573597b78392e061162a0598c5a11c5096b120 |
|
MD5 | 607dce39ef094c11b58c5de209bf399e |
|
BLAKE2b-256 | 2a4e390ceba6088be7836e1626cc0353bd72ad071e66c8378e628042bc204750 |
Close
Hashes for pyronn_torch-0.0.9-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c9adb3e7262a6ed60d568b8e2726f913d38e6033d259e4a7a34836d84a3090a |
|
MD5 | 14f514d53004a30f5ab932169f017aa6 |
|
BLAKE2b-256 | 916b9d2ebb816768f7a54321cd720a3c64d84de48f992a6072c5f673ec1e5edd |
Close
Hashes for pyronn_torch-0.0.9-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544bef95c00339eed24d6397d7a2e677db08a971845fe97b5a77844f83e9872d |
|
MD5 | 9b2a437e4830aa2c5a9a5088b4fef284 |
|
BLAKE2b-256 | 340de1754cae18dd11985bcea158a38d5e270b438506b18a09e84a86916faf9c |