1. A method for producing three-dimensional information of an object ( 4 ) in medical X-ray imaging, characterized in that the object is X-radiated from at least two different directions and the said X-radiation is detected to form projection data of the object ( 4 ) the object is modelled mathematically utilizing the projection data to solve the imaging geometry and/or the motion of the object, where the solving concerns either some or all parts of the imaging geometry and/or the motion of the object. and said projection data and said mathematical modelling of the object are utilized in Bayesian inversion based on Bayes' formula p ⁡ ( x , θ | m ) = p pr ⁡ ( θ ) ⁢ p pr ⁡ ( x ) ⁢ p ⁡ ( m | x , θ ) p ⁡ ( m ) to produce three-dimensional information of the object, the prior distribution ppr(θ) representing the prior knowledge of the imaging geometry and/or the motion of the object ( 4 ), the prior distribution ppr(x) representing mathematical modelling of the object, x representing the object image vector, which comprises values of the X-ray attenuation coefficient inside the object, θrepresenting the parameter vector of the imaging geometry and/or the motion of the object ( 4 ), m representing projection data, the likelihood distribution p(m|x,θ) representing the X-radiation attenuation model between the object image vector x, geometry parameter vector θ, and projection data m, p(m) being a normalization constant and the posteriori distribution p(x,θ|m) representing the three-dimensional information of the object ( 4 ) and the imaging geometry including the motion of the object.