A comparison of coronal X-ray structures of active regions with magnetic fields computed from photospheric observations