I noticed that the layout node has an odd ID with a duplicate naming scheme (“vtkMRMLLayoutNodevtkMRMLLayoutNode”) as seen below. It appears to have had this ID since at least 2012 as an old testing file references it, but I was trying to look into where in the code it gets set as I’m assuming it was intended to have an ID of simply “vtkMRMLLayoutNode”. Does anyone have any insight of what might be causing it to be set to this odd ID?
I searched for “vtkMRMLLayoutNodevtkMRMLLayoutNode” in the code base, but only found it being referenced in a few MRML testing files.
Hi @jamesobutler - Since it’s a singleton, there is only one in the scene so the ID can be any unique string. The SingletonTag and basename are used by default and the original author used the class name as the SingletonTag, so that explains the odd pattern. It’s not exactly pretty, but it shouldn’t cause any problems.
Changing the code to
this->SetSingletonTag("Default") would result in node ID
vtkMRMLLayoutNodeDefault which would be much nicer but then for backward compatibility we would need to introduce a mechanism in scene loading that would replace the singleton tag on-the-fly. Singleton tag initialization on scene loading is already somewhat complicated and changing the ID would not have any direct benefits for users or developers, so I’m not sure if this is worth the trouble. Most likely we’ll need to make changes in the layout node when we add multi-monitor support to layouts. It would be a good opportunity to change the singleton tag then.