Construction and test of an X-ray CT setup for material resolved 3D imaging with Medipix based detectors