Persistent homology for the quantification of prostate cancer morphology in two and three-dimensional histology