1. A method for producing an electronic representation of an image of a target region through statistical inversion, comprising: mapping the target region with a grid, and describing a number of voxels in the grid with voxel-specific unknowns, representing said unknowns with components of a vector-valued variable, repeatedly generating a next version of said vector-valued variable by drawing for each component a value from a conditional distribution, and using the components of a so generated version of said vector-valued variable as said electronic representation; wherein: non-zero part of a theory matrix, elements of which indicate, what is the contribution of each voxel in the grid to a detection result obtained at a particular pixel of a detector, is stored in a compressed form, and a proper subset of the elements of the theory matrix is decompressed from said compressed form for at least one of the following: updating the quantity Ax, where A is the theory matrix and x is the vector-valued variable, after drawing a value for a component of said vector-valued variable, calculating the quantity A j T (Ax), where A is the theory matrix, A j T is the transpose of the j:th column of the theory matrix, and x is the vector-valued variable.