Let $X_n$ be a chain with n elements ($n\in\N$) and let $\OP_n$ be the monoid of all orientation-preserving transformations of $X_n$. In this paper, for any nonempty subset $Y$ of $X_n$, we consider the subsemigroup $\OP_n(Y)$ of $\OP_n$ of all transformations with range contained in $Y$: we describe the largest regular subsemigroup of $\OP_n(Y)$, which actually coincides with its subset of all regular elements, and Green's relations on $\OP_n(Y)$. Also, we determine when two semigroups of the type $\OP_n(Y)$ are isomorphic and calculate their ranks. Moreover, a parallel study is presented for the correspondent subsemigroups of the monoid $\OR_n$ of all either orientation-preserving or orientation-reversing transformations of $X_n$.