Counting topological knots by X-rays