# How to do online (real-time) annotation when recording a new sequence of ultrasound stream using the module "Sequences"?

**URL:** <https://discourse.slicer.org/t/how-to-do-online-real-time-annotation-when-recording-a-new-sequence-of-ultrasound-stream-using-the-module-sequences/24923>\
**Category:** Support\
**Tags:** sequences, python\
**Created:** [August 25, 2022, 7:24pm UTC](https://discourse.slicer.org/t/how-to-do-online-real-time-annotation-when-recording-a-new-sequence-of-ultrasound-stream-using-the-module-sequences/24923 "2022-08-25T19:24:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunshine](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@sunshine](https://discourse.slicer.org/u/sunshine)\
**Post date:** [August 25, 2022, 7:24pm UTC](https://discourse.slicer.org/t/how-to-do-online-real-time-annotation-when-recording-a-new-sequence-of-ultrasound-stream-using-the-module-sequences/24923/1 "2022-08-25T19:24:33Z")

</div>

Hi everyone,

This topic is to continue a question from

> [@How to dynamically update the StringName of ParameterNode?](https://discourse.slicer.org/t/how-to-dynamically-update-the-stringname-of-parameternode/24895/3):
>
> Hi Andras, Thank you so much for your help! I found the attribute “selectedItemNumber” from vtkMRMLSequenceBrowserNode in the scene file, which solved my problem. As you can see in the screenshot below, I am now able to retrieve SequenceBrowser and show the FrameIndex in my own module, and I should also be able to do offline annotation now. [image] However, it might be impossible for me to complete a new “Sequences” module for the new sequence recording, and it seems that the existing “Sequ…

I am trying to design my first extension module, similar to the module “Sequences” but with real-time frame annotations from AI image processing for live ultrasound sequence collection.

As you can see in the screenshot below, I am now able to retrieve SequenceBrowser and show the FrameIndex in my own module, and I should also be able to do **offline** annotation now.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/7/377dc8ab7965659ecc9efe1fbd99745a6898e18b.png)

However, it might be impossible for me to complete a new “Sequences” module for the new sequence recording, and it seems that the existing “Sequences” module does not support PyQt5 script source code.

What should I do to make the annotation **online**?  
E.g., after I click the recording button in the “Sequences” module to record a sequence of ultrasound data, as the real-time raw image shown in the red widget, how should I annotate a “Yes” notation in the center of the raw image and show the annotated image in the yellow widget simultaneously?

Assume this problem can be solved in three steps:

1. How can I add a new shortcut button in the toolbar to trigger the annotation?
2. How should I retrieve the real-time raw image?
3. How should I display the annotated image in the yellow widget?

Thank you again for your valuable time!
