A medical apparatus comprises a first component (2), at least one second component (4, 4', 4") movable with respect to the first component (2), a driving device (6, 6', 6") to drive the at least one second component (4, 4', 4"), a sensor (7, 7', 7") to detect a position of the at least one second component (4, 4', 4"), and a controller (8) to retrieve stored data of at least one bounding box (10, 10', 10", 10", 10"', 10") of the at least one second component (4, 4', 4"), to calculate actual positions of the at least one bounding box (10, 10', 10", 10'", 10", 10"', 10") based on the position of the at least one second component (4, 4', 4") as transformed data, and to determine a collision between the at least one second component (4, 4', 4") and the first component (2) or a surface (3) supporting the first component (2) by the transformed data and further transformed data of a further bounding box (11, 11') representing the first component (2) or of a surface (3) supporting the first component (2).