We investigate diffusion in three dimensions on a comb-like structure in which the particles move freely in a plane, but, out of this plane, are constrained to move only in the perpendicular direction. This model is an extension of the two-dimensional version of the comb model, which allows diffusion along the backbone when the particles are not in the branches. We also consider memory effects, which may be handled with different fractional derivative operators involving singular and non-singular kernels. We find exact solutions for the particle distributions in this model that display normal and anomalous diffusion regimes when the mean-squared displacement is determined. As an application, we use this model to fit the anisotropic diffusion of water along and across the axons in the optic nerve using magnetic resonance imaging. The results for the observed diffusion times (8 to 30 milliseconds) show an anomalous diffusion both along and across the fibers.