# How to remove NthDataNode from a vtkMRMLSequenceNode?

**URL:** <https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083>\
**Category:** Development\
**Tags:** sequences, python, module, scripted\
**Created:** [November 5, 2022, 4:09pm UTC](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083 "2022-11-05T16:09:14Z")\
**Posts on this page:** 3\
**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:** [November 5, 2022, 4:09pm UTC](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083/1 "2022-11-05T16:09:14Z")

</div>

Hi everyone,

I am working on the scripted module development, trying to edit the `vtkMRMLSequenceNode`.  
However, did not find any functions like `RemoveNthDataNode()`.

How could I remove the NthDataNode?

Thank you very much in advance!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 6, 2022, 4:17am UTC](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083/2 "2022-11-06T04:17:01Z")

</div>

You can use this method:

```
sequenceNode->RemoveDataNodeAtValue(sequenceNode->GetNthIndexValue(n));

```

---

<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:** [November 6, 2022, 3:14pm UTC](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083/3 "2022-11-06T15:14:13Z")

</div>

Thank you so much, Andras!
