ANTs register only part of 3D volume

I was wondering if somebody knows how to use ANTs to register only parts of a volume, e.g. a mask including the brainstem (could be a rectangular prism). Also, is it possible to cut out everything else and just keep the part inside the prism? And lastly, how can I do this in nipype :D?