Skip to content

Commit

Permalink
BUG:label map name empty. LabelVolume is never created by openigtlink…
Browse files Browse the repository at this point in the history
…if, rename of nodes needs to be determined by the query type instead of volume type.
  • Loading branch information
leochan2009 committed Apr 5, 2021
1 parent 73b56a5 commit 77ae07d
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions OpenIGTLinkRemote/Widgets/qSlicerOpenIGTLinkRemoteQueryWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -379,34 +379,38 @@ void qSlicerOpenIGTLinkRemoteQueryWidget::onNewDeviceAdded(vtkObject* vtkNotUsed
Q_D(qSlicerOpenIGTLinkRemoteQueryWidget);
// change the node name to match the full descriptive name from the ImageMetaList or LabelMetaList
vtkMRMLScalarVolumeNode* imageNode = vtkMRMLScalarVolumeNode::SafeDownCast((vtkObject*)deviceNode);
vtkMRMLLabelMapVolumeNode* labelNode = vtkMRMLLabelMapVolumeNode::SafeDownCast((vtkObject*)deviceNode);
//vtkMRMLLabelMapVolumeNode* labelNode = vtkMRMLLabelMapVolumeNode::SafeDownCast((vtkObject*)deviceNode);
std::string name;
if (imageNode)
{
if (d->imageDeviceNameToNodeNameMap.find(imageNode->GetName()) != d->imageDeviceNameToNodeNameMap.end())
if (d->typeButtonGroup.checkedId() == qSlicerOpenIGTLinkRemoteQueryWidgetPrivate::TYPE_IMAGE)
{
name = d->imageDeviceNameToNodeNameMap[imageNode->GetName()];
if (d->imageDeviceNameToNodeNameMap.find(imageNode->GetName()) != d->imageDeviceNameToNodeNameMap.end())
{
name = d->imageDeviceNameToNodeNameMap[imageNode->GetName()];
}
}
}
else if (labelNode)
{
if (d->labelDeviceNameToNodeNameMap.find(labelNode->GetName()) != d->labelDeviceNameToNodeNameMap.end())
else if (d->typeButtonGroup.checkedId() == qSlicerOpenIGTLinkRemoteQueryWidgetPrivate::TYPE_LABEL)
{
name = d->labelDeviceNameToNodeNameMap[labelNode->GetName()];
if(d->labelDeviceNameToNodeNameMap.find(imageNode->GetName()) != d->labelDeviceNameToNodeNameMap.end())
{
name = d->labelDeviceNameToNodeNameMap[imageNode->GetName()];
//vtkMRMLLabelMapVolumeNode* labelVolumeNode = this->QueryLogic->CreateNewLabelVolumeFromVolume(imageNode);
//imageNode->SetHideFromEditors(true);
}
}
// Rename the node (give a unique name if the node is retrieved already)
if (imageNode->GetScene())
{
name = imageNode->GetScene()->GetUniqueNameByString(name.c_str());
}
imageNode->SetName(name.c_str());
}
else
{
// node metadata not found
return;
}

// Rename the node (give a unique name if the node is retrieved already)
if (imageNode->GetScene())
{
name = imageNode->GetScene()->GetUniqueNameByString(name.c_str());
}
imageNode->SetName(name.c_str());
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 77ae07d

Please sign in to comment.