LION.experiments.ct_experiments

LION’s CT experiments: a geometry, a dataset and, for simulated data, the noise added to the sinograms (param.noise_params).

Noise of the simulated (LIDC-IDRI) experiments, since 25 October 2026

Experiment.noise_parameters(I0): the physical noise model of ct_utils.sinogram_add_noise. The images are densities (g/cm^3, see the LIDC-IDRI data loader), the geometries are in mm, so the line integrals give the real transmission through water at 80 keV, and I0 is the number of photons per detector pixel in vacuum. Thicker patients get noisier data, as in a scanner, and photon-starved rays are floored at 1 photon before the log. The detector is energy-integrating (electronic noise, cross-talk) unless detector="photon_counting".

The doses (CLINICAL_I0, LOW_DOSE_I0, EXTREMELY_LOW_DOSE_I0) were chosen by Ander by looking at FDK reconstructions of small, typical and large LIDC-IDRI patients (25 Oct 2026: 20000, 5000, 1000). When the slices were resampled to their real size (26 Oct 2026, see the geometry below), most patients became thicker and noisier at the same I0, so the doses were raised to 42000, 11000 and 2100: the I0 that give, on average over 30 patients, the same noise in the FDK images as before (checked by eye by Ander).

Before, the experiments used the relative model: each sinogram divided by its maximum, so every patient’s thickest ray kept I0/e photons (I0 = 10000, 3500 and 1000). That is not how a scanner works; the noise did not depend on the size of the patient. noise_model = "relative" gives the relative model, with the errors LION’s noise had before October 2026 fixed (cross-talk across angles, batch maximum, 1e-6 rule for starved rays), so its results are close to, but not bit-identical with, the old ones. New results are not comparable with old results of the same experiment name.

Each slice has one noisy measurement (noise_params.seed): its noise is drawn from a generator seeded by the seed and the slice (patient and slice file), so it is the same in every epoch, run, sample order and DataLoader worker, in training, validation and test, as a scan is measured once. Training randomness (shuffling, noise a solver adds) is not affected. seed = None, and parameter files without it, draw fresh noise each time a slice is read. One seed gives the same noise on the same device type (CPU or CUDA) and torch version; see LION.utils.rng.

Measured 2DeteCT data have their own noise; see the deteCT data loader.

Geometry of the LIDC-IDRI experiments, since 26 October 2026

LIDC_IDRI.default_geometry(angles): 512x512 pixels over 500 mm (the pre-processing resamples every scan to that spacing, see the LIDC-IDRI data loader) and a 1024-pixel detector that covers it. The angles are as before: 360 over 360 degrees, 60 over 60 degrees for limited angle (LIMITED_ANGLES), 50 over 360 degrees for sparse view (SPARSE_ANGLES). Before, the experiments used Geometry.default_parameters() and its sparse presets (300 mm, 900-pixel detector) on slices of each scan’s own pixel spacing.

Classes

Experiment([experiment_params, dataset, ...])

A CT experiment: a geometry, a dataset and, for simulated data, the noise added to the sinograms; the base class of LION's experiments, which differ only in their parameters (see the module docstring for the noise and geometry).

ExtremeLowDoseCTRecon([experiment_params, ...])

Extremely low dose, full angular sampling.

LimitedAngleCTRecon([experiment_params, ...])

Clinical dose, limited angle.

LimitedAngleExtremeLowDoseCTRecon([...])

Extremely low dose, limited angle.

LimitedAngleLowDoseCTRecon([...])

Low dose, limited angle.

LowDoseCTRecon([experiment_params, dataset, ...])

Low dose, full angular sampling.

SparseAngleCTRecon([experiment_params, ...])

Clinical dose, sparse view.

SparseAngleExtremeLowDoseCTRecon([...])

Extremely low dose, sparse view.

SparseAngleLowDoseCTRecon([...])

Low dose, sparse view.

clinicalCTRecon([experiment_params, ...])

Clinical dose, full angular sampling.


class LION.experiments.ct_experiments.Experiment(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: ABC

A CT experiment: a geometry, a dataset and, for simulated data, the noise added to the sinograms; the base class of LION’s experiments, which differ only in their parameters (see the module docstring for the noise and geometry).

experiment_params: its parameters (default_parameters(dataset) if None); dataset: “LIDC-IDRI” (simulated sinograms) or “2DeteCT” (measured ones); datafolder: where the dataset is (the data loader’s default if None).

get_dataset(split) gives the data of a split, data_record(split) its record; instantiate and parameters_from_file make an experiment again from a saved file.

static noise_parameters(I0, detector='energy_integrating')[source]

The noise of LION’s simulated experiments: the physical model of ct_utils.sinogram_add_noise, with I0 photons per detector pixel in vacuum, water at 80 keV, and starved rays floored at 1 photon. The default energy-integrating detector has electronic noise (sigma = 5 photons) and cross-talk; “photon_counting” has neither.

seed (0): each slice’s noise is drawn from a generator seeded by the seed and the slice, so a slice has one noisy measurement, the same in every epoch and run, as a scan is measured once (training, validation and test). None: fresh noise each time the slice is read.

abstract static default_parameters()[source]

The experiment’s parameters for dataset: its name, operator_params (the geometry), noise_params (simulated data only) and data_loader_params. Each experiment defines it.

static measured_2detect_parameters(name, angles=slice(None, None, None), dose='clinical')[source]

Parameters of an experiment on the measured 2DeteCT data.

Its geometry is fixed by the scan (3600 angles over 360 degrees), so an experiment can only select some of the measured angles (angles, an index or slice into them). Dose levels are measured modes: “clinical” uses mode2 sinograms, “extremely_low” the low-dose mode1 ones (3 W instead of 90 W tube power, ~30x less); the targets are mode2 reconstructions. There is no noise to simulate.

static not_possible_with_2detect(name, reason)[source]

Raises the ValueError of an experiment, name, that the measured 2DeteCT data can’t give, saying why (reason).

SPLITS = ('train', 'validation', 'test')
baseline()[source]

The reconstruction methods are compared with in this experiment (LION.evaluation.Comparison), as a function f(y, operator); None: the modality’s (LION.evaluation.baseline: FDK for CT). Experiments where another method is the standard override this.

get_dataset(split)[source]

The dataset of a split (“train”, “validation” or “test”). It keeps the experiment and the split (dataset.experiment, dataset.split), which its record (data_record) includes.

get_training_dataset()[source]

The training data (get_dataset("train")).

get_validation_dataset()[source]

The validation data (get_dataset("validation")).

get_testing_dataset()[source]

The test data (get_dataset("test")).

data_record(split, hash_files=False)[source]

The record of a split’s data: this experiment, the split, the dataset, its noise, its samples (LION.data_loaders.data_record).

classmethod instantiate(source, *, allow=(), **arguments)[source]

The experiment a saved file describes. source: a data record, a model’s file (or the dict read from it) saved with one, or the experiment’s spec or its file (a package’s experiment.json). Called on an experiment class it makes that class; called on Experiment, the class the record names (allow: see LION.utils.spec.build). arguments replace recorded ones (e.g. experiment_params from parameters_from_file, changed; datafolder).

Experiment.instantiate(f).get_dataset(record.split) makes the data as they were: dataset, geometry and noise (with its seed).

classmethod parameters_from_file(source, *, allow=())[source]

What default_parameters() gives, as source (as in instantiate) recorded it: the experiment’s parameters (geometry, noise, data), to change and make the experiment with, e.g.

parameters = Experiment.parameters_from_file(“model”) parameters.noise_params.I0 = 5000 experiment = Experiment.instantiate(“model”, experiment_params=parameters)

instantiate makes the class the file records. Made by hand, the class is the one named; another experiment’s parameters give a warning (the experiments differ only in their parameters, so it would be that experiment, recorded under the wrong class).

static get_dataset_parameters(dataset, operator_params=None)[source]

The default parameters of dataset’s data loader (“LIDC-IDRI”, with operator_params as its geometry, or “2DeteCT”).

class LION.experiments.ct_experiments.ExtremeLowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Extremely low dose, full angular sampling. LIDC-IDRI: simulated sinograms with extremely low dose noise (I0 = EXTREMELY_LOW_DOSE_I0, Experiment.noise_parameters), 360 angles over 360 degrees. 2DeteCT: the measured mode 1 sinograms (3 W instead of 90 W tube power), all 3600 angles; mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).

class LION.experiments.ct_experiments.LimitedAngleCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Clinical dose, limited angle. LIDC-IDRI: simulated sinograms with clinical noise (I0 = CLINICAL_I0, Experiment.noise_parameters), 60 angles over 60 degrees (limited angle). 2DeteCT: the measured mode 2 sinograms (clinical dose), every 10th of the first 600 angles (60 over 60 degrees); mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).

class LION.experiments.ct_experiments.LimitedAngleExtremeLowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Extremely low dose, limited angle. LIDC-IDRI: simulated sinograms with extremely low dose noise (I0 = EXTREMELY_LOW_DOSE_I0, Experiment.noise_parameters), 60 angles over 60 degrees (limited angle). 2DeteCT: the measured mode 1 sinograms (low dose), every 10th of the first 600 angles (60 over 60 degrees); mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).

class LION.experiments.ct_experiments.LimitedAngleLowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Low dose, limited angle. LIDC-IDRI: simulated sinograms with low dose noise (I0 = LOW_DOSE_I0, Experiment.noise_parameters), 60 angles over 60 degrees (limited angle). Not possible with 2DeteCT (its measured low dose, mode 1, is the extremely low dose experiments’).

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI”; see the class): its name, geometry (operator_params), noise (noise_params) and data loader’s parameters. A ValueError for “2DeteCT”: its measured low dose is the extremely low dose experiments’.

class LION.experiments.ct_experiments.LowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Low dose, full angular sampling. LIDC-IDRI: simulated sinograms with low dose noise (I0 = LOW_DOSE_I0, Experiment.noise_parameters), 360 angles over 360 degrees. Not possible with 2DeteCT (its measured low dose, mode 1, is the extremely low dose experiments’).

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI”; see the class): its name, geometry (operator_params), noise (noise_params) and data loader’s parameters. A ValueError for “2DeteCT”: its measured low dose is the extremely low dose experiments’.

class LION.experiments.ct_experiments.SparseAngleCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Clinical dose, sparse view. LIDC-IDRI: simulated sinograms with clinical noise (I0 = CLINICAL_I0, Experiment.noise_parameters), 50 angles over 360 degrees (sparse view). 2DeteCT: the measured mode 2 sinograms (clinical dose), every 72nd angle (50 over 360 degrees); mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).

class LION.experiments.ct_experiments.SparseAngleExtremeLowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Extremely low dose, sparse view. LIDC-IDRI: simulated sinograms with extremely low dose noise (I0 = EXTREMELY_LOW_DOSE_I0, Experiment.noise_parameters), 50 angles over 360 degrees (sparse view). 2DeteCT: the measured mode 1 sinograms (low dose), every 72nd angle (50 over 360 degrees); mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).

class LION.experiments.ct_experiments.SparseAngleLowDoseCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Low dose, sparse view. LIDC-IDRI: simulated sinograms with low dose noise (I0 = LOW_DOSE_I0, Experiment.noise_parameters), 50 angles over 360 degrees (sparse view). Not possible with 2DeteCT (its measured low dose, mode 1, is the extremely low dose experiments’).

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI”; see the class): its name, geometry (operator_params), noise (noise_params) and data loader’s parameters. A ValueError for “2DeteCT”: its measured low dose is the extremely low dose experiments’.

class LION.experiments.ct_experiments.clinicalCTRecon(experiment_params=None, dataset='LIDC-IDRI', datafolder=None)[source]

Bases: Experiment

Clinical dose, full angular sampling. LIDC-IDRI: simulated sinograms with clinical noise (I0 = CLINICAL_I0, Experiment.noise_parameters), 360 angles over 360 degrees. 2DeteCT: the measured mode 2 sinograms (clinical dose), all 3600 angles; mode 2 reconstructions as targets.

static default_parameters(dataset='LIDC-IDRI')[source]

The experiment’s parameters for dataset (“LIDC-IDRI” or “2DeteCT”): its name, geometry (operator_params), noise (noise_params, simulated data only) and data loader’s parameters (see the class).