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