Are you implying that you would like to illuminate the piston/cylinder transversely with the X-rays? And, then take an X-ray image in the traditional way? If this is so, what is the speed of the piston? I assume your question also means there's no connecting rod or something like that.
If the piston is not moving, and the X-ray beam is well collimated you might get away with simple photographic plates using traditional methods. You will also need two reference positions with a known distance apart, also in the image, to establish an 'internal standard'.
If the piston is moving, even slowly, the problem is much more difficult. You'll probably have to move to a digital, or solid state detector (which is much faster than traditional film or optical plates). You would have to consider the sensitivity of the detector and adjust the X-ray brightness so that the piston's motion is effectively 'stopped' during the exposure. That is, given the piston speed, how long does it take to move 1 um?
But, all this seems a bit much. Are you stuck with this particular mechanical configuration? Can you provide an optical window at the top of the cylinder? If so, you can use a laser to measure the position to much better than a micrometer.
If the cylinder can be made non-magnetic and the piston magnetic, you could turn the assembly into an LVDT with the addition of coils wound around the outside of the cylinder. That is, the piston/cylinder becomes the moving core of the LVDT. With this method, you can easily measure to nanometer scale, and even in real time with very high piston velocity (well ... depending on LVDT excitation frequency).