The Flexify 2 (by flaming pear) plugin for photoshop (which will actually also work in gimp, the preview is just kinda fubar so you have to know what you want to do) will also do this along with hugin/etc. that others have mentioned. I usually use hugin for projection-switching, but flexify is really nice for especially this particular transformation; it's very user-friendly.