Made the calculations for computing the dimensions of a layer
layer(Region or SensorCell[][]) into it's own private method.