CUQIpy-CIL
CUQIpy-CIL is a plugin for the CUQIpy software package.
It adds a thin wrapper around Computed Tomography (CT) forward models from the Core Imaging Library (CIL).
Installation
First install CIL. Then install CUQIpy-CIL with pip:
pip install cuqipy-cil
If CUQIpy is not installed, it will be installed automatically.
Quickstart
import numpy as np
import matplotlib.pyplot as plt
import cuqi
import cuqipy_cil
# Load a CT forward model and data from testproblem library
A, y_data, info = cuqipy_cil.testproblem.ParallelBeam2D(
im_size=(128, 128),
det_count=128,
angles=np.linspace(0, np.pi, 180),
phantom="shepp-logan"
).get_components()
# Set up Bayesian model
x = cuqi.distribution.Gaussian(np.zeros(A.domain_dim), cov=1) # x ~ N(0, 1)
y = cuqi.distribution.Gaussian(A@x, cov=0.05**2) # y ~ N(Ax, 0.05^2)
# Set up Bayesian Problem
BP = cuqi.problem.BayesianProblem(y, x).set_data(y=y_data)
# Sample from the posterior
samples = BP.sample_posterior(200)
# Analyze the samples
info.exactSolution.plot(); plt.title("Exact solution")
y_data.plot(); plt.title("Data")
samples.plot_mean(); plt.title("Posterior mean")
samples.plot_std(); plt.title("Posterior standard deviation")
For more examples, see the demos folder.
Metadata
Release files for CUQIpy-CIL 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cuqipy_cil-0.7.0.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cuqipy_cil-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.1 kB
Release files / cuqipy_cil-0.7.0.tar.gz
| Download URL | cuqipy_cil-0.7.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e23b03c920bd55eb8b352046ba5231330d9bdc9d438ca8e735dcbe00ccd792cd
|
|
BLAKE2b-256 checksum How to use checksums |
5e046629de863354f38cf65cf01cbf5b6b584e1308bf6fa77e0d0ca7bcac476f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / cuqipy_cil-0.7.0-py3-none-any.whl
| Download URL | cuqipy_cil-0.7.0-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4546d5a002c1b84a4864ef27b68ccf1aac5858eec86ca3c127b11f2a5c08925a
|
|
BLAKE2b-256 checksum How to use checksums |
5d9f318057ce8dca5ea9956eaa7ebeb9d51d00da8eab9ab770790333c5e0d1e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|