A 25-year-old man is evaluated for a 3-year history of low back and bilateral buttock pain that has gradually increased over the past year. The pain is worse in the morning and after inactivity; he feels better after stretching his back. He has 90 minutes of morning stiffness in his back. Ibuprofen provides moderate relief of symptoms. He reports no other arthritic symptoms, rash, or gastrointestinal symptoms. Family history is notable for his paternal uncle with long-standing back problems.

On physical examination, vital signs are normal. There is painful and diminished forward flexion and extension of the lumbar spine. Tenderness to palpation over both buttocks is noted.

Laboratory studies reveal an erythrocyte sedimentation rate of 35 mm/h; HLA-B27 testing is negative.

Plain radiographs of the lumbar spine and sacroiliac joints are normal.

Which of the following is the most appropriate diagnostic test to perform next?