  We study the field theoretical model of a scalar field in presence of spacial
inhomogeneities in form of one and two finite width mirrors (material slabs).
The interaction of the scalar field with the defect is described with
position-dependent mass term. For the single layer system we develop a rigorous
calculation method and derive explicitly the propagator of the theory, S-matrix
elements and the Casimir self-energy of the slab. Detailed investigation of
particular limits of self-energy is presented, and connection to know cases is
discussed. The calculation method is found applicable to the two mirrors case
as well. By means of it we derive the corresponding Casimir energy and analyze
it. For particular values of the parameters of the model the obtained results
recover the Lifshitz formula. We also propose a procedure to obtain
unambiguously the finite Casimir \textit{self}-energy of a single slab without
reference to any renormalizations. We hope that our approach can be applied to
calculation of Casimir self-energies in other demanded cases (such as
dielectric ball, etc.)
