Halbach hollow cylinder dipole magnets of a low or relatively low aspect ratio attract considerable attention due to their applications, among others, in compact NMR and MRI systems for investigating small objects. However, a complete mathematical framework for the analysis of magnetic fields in these magnets has been developed only for their infinitely long precursors. In such a case the analysis is reduced to two-dimensions (2D). The paper details the analysis of the 3D magnetic field in the Halbach dipole cylinders of a finite length. The analysis is based on three equations in which the components of the magnetic flux density Bx, By and Bz are expanded to infinite power series of the radial coordinate r. The zeroth term in the series corresponds to a homogeneous magnetic field Bc, which is perturbed by the higher order terms due to a finite magnet length. This set of equations is supplemented with an equation for the field profile B(z) along the magnet axis, presented for the first time. It is demonstrated that the geometrical factors in the coefficients of particular powers of r, defined by intricate integrals are the coefficients of the Taylor expansion of the homogeneity profile (B(z)−Bc)/Bc. As a consequence, the components of B can be easily calculated with an arbitrary accuracy. In order to describe perturbations of the field due to segmentation, two additional equations are borrowed from the 2D theory. It is shown that the 2D approach to the perturbations generated by the segmentation can be applied to the 3D Halbach structures unless r is not too close to the inner radius of the cylinder ri. The mathematical framework presented in the paper was verified with great precision by computations of B by a highly accurate integration of the magnetostatic Coulomb law and utilized to analyze the inhomogeneity of the magnetic field in the magnet with the accuracy better than 1ppm.