I would like to extract a portion of an equirectangular 360x180 panorama taken with a Theta S and convert it to what I think is a rectilinear image (a picture where straight lines are shown as such regardless of the lines' direction). Could you please advise on how to do it? Thanks in advance!
You need a way to remap the panorama. An open source tool for doing this is the Hugin application. A commercial Photoshop plugin for doing this is Flaming Pear's Flexify; a commercial panostitcher you can use is PTGui.
You basically just have to feed the software the equirectangular, and then choose a Rectilinear projection. (See also: How to reproject and crop a 360°x180° panorama? for step-by-step instructions with Hugin; the steps are similar for PTGui.) You'll probably need to adjust yaw/pitch/roll to the portion of the scene you want, as well as the FoV. Be aware that you'll have to use a much smaller FoV than 360, because a rectilinear projection is closer to a 90º FoV. Going larger will mean a lot of smearing and stretching at the edges.