Improved calculation of the number of detector rows