  In this work the interaction of the coupled channels $DN$ and $\pi \Sigma_c$
in an SU(4) extrapolation of the chiral unitary theory, where the
$\Lambda_c(2595)$ resonance appears as dynamically generated from that
interaction, is extended to produce results in finite volume. Energy levels in
the finite box are evaluated and, assuming that they would correspond to
lattice results, the inverse problem of determining the phase shifts in the
infinite volume from the lattice results is solved. We observe that it is
possible to obtain accurate $\pi \Sigma_c$ phase shifts and the position of the
$\Lambda_c(2595)$ resonance, but it requires the explicit consideration of the
two coupled channels. We also observe that some of the energy levels in the box
are attached to the closed $DN$ channel, such that their use to induce the $\pi
\Sigma_c$ phase shifts via L\"uscher's formula leads to incorrect results.
