Skip to main content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.


The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

A Fixed-Memory Moving, Expanding Window for Obtaining Scatter Corrections in X-Ray CT and Other Stochastic Averages



Zachary H. Levine, Adam L. Pintar


A simple algorithm for averaging a stochastic sequence of 1D arrays in a moving, expanding window is provided. The samples are grouped in bins which increase exponentially in size so that a constant fraction of the samples is retained at any point in the sequence. The algorithm is shown to have particular relevance for a class of Monte Carlo sampling problems which includes one characteristic of iterative reconstruction in computed tomography. The code is available in the CPC program library (at, Catalog ID: aexaZ) in both Fortran 95 and C and is also available in R through CRAN.
Computer Physics Communications


Monte Carlo, moving expanding window , stochastic average
Created May 30, 2015, Updated November 10, 2018