Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Make Clone action clone a segment when a segment is selected in subject hierarchy #5700

Merged
merged 1 commit into from Jun 17, 2021

Conversation

lassoan
Copy link
Contributor

@lassoan lassoan commented Jun 17, 2021

Previously, "Clone" action duplicated the entire segmentation node, even when right-clicked on a segment.
This commit changes the behavior so that if the user right-clicks on a Segment and chooses Clone then only that selected segment will be cloned.

@lassoan lassoan added this to the Slicer 4.13.0 milestone Jun 17, 2021
@lassoan lassoan requested a review from cpinter June 17, 2021 13:17
@lassoan lassoan self-assigned this Jun 17, 2021
// Add the segment in subject hierarchy to allow individual handling (e.g. visibility)
vtkIdType segmentShItemID = shNode->CreateHierarchyItem(
segmentationShItemID, (segment->GetName() ? segment->GetName() : ""),
vtkMRMLSubjectHierarchyConstants::GetSubjectHierarchyVirtualBranchAttributeName());
vtkMRMLSubjectHierarchyConstants::GetSubjectHierarchyVirtualBranchAttributeName(),
segmentation->GetSegmentIndex(segmentId));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be positionUnderParent I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Good catch.

Copy link
Member

@cpinter cpinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andras! It looks good, I just added one thing that I think should fixed.

…subject hierarchy

Previously, "Clone" action duplicated the entire segmentation node, even when right-clicked on a segment.
This commit changes the behavior so that if the user right-clicks on a Segment and chooses Clone then only that selected segment will be cloned.
@lassoan lassoan merged commit ac3d96b into Slicer:master Jun 17, 2021
@lassoan lassoan deleted the clone-segment-sh-action branch June 17, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants