GetID() and GetName() methods giving different nodes

Operating system: Ubuntu Debian 18.04 (KDE neon 5.19)
Slicer version: 4.11.0-2020-06-05
Expected behavior: Getting unic node by its ID
Actual behavior: Getting other node ID by GetID() method


I’m devoloping a segmentation module using some of the Sequences Module logic to create or manipulate sequences. When I try to get first and last DataNodes from a sequence, i’m getting a wrong node ID by GetID() method. I think that next image is better to explain my problem:

The SequenceNode is the one selected (named ‘1proxy_Backg_cardIAc’) and has 2 ScalarVolumeNodes as DataNodes (‘patient045_frame01’ and ‘patient045_frame13’). When i try to get first node of sequence by its ID, I get ‘v4_cSAX_time_1’. Anny suggestion?

Here you can see that sequence is actually formed by ‘patient045_frame01’ and ‘patient045_frame13’ nodes:



The data nodes in a sequence are not stored in the main Slicer MRML scene, but in a private scene inside the sequence. They become accessible in the main Slicer scene via the proxy node for the selected item. You can either set the item and use the proxy node, or get the internal sequence MRML scene using this function.