Cofnod E-bost: Spatial distortion correction and crystal identification for MRI-compatible position-sensitive avalanche photodiode-based PET scanners