There are different ways to diagnose spondyloarthritis, such as X-rays of the sacroiliac joints in the pelvis, MRI (magnetic resonance imaging), and a blood test to check for the HLA-B27 gene.