A method of performing dose calculations for ion radiotherapy compensating for tissue in which the density within a voxel may be inhomogeneous by approximating a portion of the voxel as an air cavity. For each dose voxel, the voxel is inscribed in a three-dimensional grid comprising a number of cells and the propagation of ions through the voxel is calculated based on the cell pattern in the at least one cell overlapping the voxel. Preferably, the voxel is inscribed in the three-dimensional grid in such a way that it overlaps at least one cell fully. Each cell comprises a first portion representing a first density corresponding to a density of a tissue and a second portion representing a second density corresponding to the density of air, the first and second portions forming a cell pattern.