A method for controlling a system (1) comprising an imaging modality (3, 34), the method comprising: Receiving (RI) an image (50) and/or a series of images (50) of a portion of a patient (13) from the imaging modality (3, 34), the field of view of the image (50) and/or of the series of images (50) covering at least a part (21) of an instrument (20), Determining (DP) whether said part (21) of the instrument (20) is located within a predefined portion (51, 52, 53) of the field of view and/or whether said part (21) of the instrument (20) is in a given state selected from a plurality of predefined first states and/or whether said part (21) of the instrument (20) executes a given movement selected from a plurality of predefined movements, Generating (GC) a control command for performing a predefined action of an action unit (3, 34, 5) of the system (1) depending on whether said part (21) of the instrument (20) is located within the predefined portion (51, 52, 53) of the field of view and/or whether said part (21) of the instrument (20) is in the given state selected from the plurality of predefined first states and/or whether said part (21) of the instrument (20) executes the given movement selected from the plurality of predefined movements.Linvention concerne un procédé de commande dun système (1) comprenant une modalité dimagerie (3, 34), le procédé consistant à : recevoir (RI) une image (50) et/ou une série dimages (50) dune partie dun patient (13) en provenance de la modalité dimagerie (3, 34), le champ de vision de limage (50) et/ou de la série dimages (50) recouvrant au moins une partie (21) dun instrument (20), déterminer (DP) si ladite partie (21) de linstrument (20) est située à lintérieur dune partie prédéfinie (51, 52, 53) du champ de vision et/ou si ladite partie (21) de linstrument (20) est dans un état donné sélectionné parmi une pluralité de premiers états prédéfinis et/ou si ladite partie (21) de linstrument (20) exécute un mouvement donné sélectionné à