Piston displacement is simply the air volume that moves through the engine when the crankshaft makes 2 turns. Compression ratio calculations involve figuring in combustion chamber volume, deck clearance, head gasket volume, etc. Then there's that nasty one, volumetric efficiency, where port shape and volume, valve lift and duration, and all those other variables have to be considered. Around 90% VE is a pretty good rule of thumb for a somewhat stock stovebolt engine.
Jerry