Fast computation of fractal dimension for 2D, 3D and 4D data