Comments (6)
While adding a segment on an empty segmentation, show 3D is always disabled (even if it was enabled previously)
"Show 3D" toggle is a shortcut for "Create/delete closed surface representation". Therefore, you cannot have a segmentation without segments that has closed surface representation.
add segment -> paint in slide -> enable Show 3D -> undo.
This undos the paint-stroke but "Show 3D" is still enabled
This is the expected behavior. This is so because the segmentation contains a closed surface representation (even if it is currently does not contain any points).
Then redo brings back the paint-stroke and it's also shown in 3D. This could be considered fine, normal behavior
This is the expected behavior. Redo is supposed to restore the previous state.
add segment -> paint in slide -> paint in slide -> enable Show 3D -> undo
This makes the first paint-stroke disappear from the 3D view even though the Show 3D button is enabled
This is the expected behavior. Redo is supposed to restore the previous state. The state includes the available representations.
add segment -> paint in slide -> paint in slide -> enable Show 3D -> undo -> enable show 3D (click the button twice because there is a bug)
This is indeed a GUI bug - the Show 3D button should be unchecked. -> #7246
You lose the second paint-stroke from the segmentationHistory even though the 3D mesh is not the master representation
This is the expected behavior. If you make any change to the segmentation (change includes the list of avaialble representations) then all future states are deleted.
Overall, everything works as intended (except the small GUI bug that will be fixed).
Probably the source of confusion is that the "show" button text suggests that the button just adjusts some display property, which does not affect the state of the segmentation. However, clicking "Show 3D" actually means "create closed surface representation so that the segmentation can be displayed in 3D" and as such it is modifying the segmentation data, not just its display properties. I don't think we would want to change how things work under the hood, so if you find the current behavior confusing then we should improve text in GUI and/or documentation.
from slicer.
Below is another problem, that may be related?
import SampleData
volumeNode = SampleData.SampleDataLogic().downloadSample("CTChest")
######### Go to segment editor ################
segmentationNode = getNode('Segmentation')
def printRepresentationModified(caller,event):
print("RepresentationModified")
def printSegmentModified(caller,event):
print("SegmentModified")
tagRepresentationModified = segmentationNode.AddObserver(
segmentationNode.GetSegmentation().RepresentationModified,
printRepresentationModified
)
tagSegmentModified = segmentationNode.AddObserver(
segmentationNode.GetSegmentation().SegmentModified,
printSegmentModified
)
After creating a segment, click show3D (to enable), it will print:
RepresentationModified
SegmentModified
click show3D again (to disable), it will print:
SegmentModified
I use RepresentationModified event to handle my own undo/redo segment editor logic but the asymmetric behavior makes it not work. Would you consider the above example a bug or should I just rewrite some of my logic?
from slicer.
RepresentationModified is invoked when there is a representation with modified content. This happens when you create a representation but not when you delete it (because the representation no longer exists). If you want to know when a representation is added or removed then you can observe this event:
/// Invoked if a representation is created or removed in the segments (e.g., created by conversion from master).
ContainedRepresentationNamesModified,
from slicer.
I use RepresentationModified event to handle my own undo/redo segment editor logic
Why the built-in logic does not work for you? Could it be improved?
from slicer.
If you want to know when a representation is added or removed then you can observe this event:
/// Invoked if a representation is created or removed in the segments (e.g., created by conversion from master). ContainedRepresentationNamesModified,
I'll check
from slicer.
I use RepresentationModified event to handle my own undo/redo segment editor logic
Why the built-in logic does not work for you? Could it be improved?
We just have a very simplified segment editor interface with low ui button count. Each step has particular masking configuration or may execute several "normal" segmentation effects on a chain. Then the undo/redo buttons in our GUI have to have in mind this
Hope it's useful feedback :)
from slicer.
Related Issues (20)
- Identical code in vtkITKMorphologicalContourInterpolator::SimpleExecute HOT 2
- unused variable in vtkMRMLNode.cxx HOT 2
- Can I achieve automatic segmentation of the brain midline HOT 1
- Control point visibility for lines HOT 2
- Loading volume from DICOM series using single file archetype fails to reconstruct image geometry properly HOT 6
- Add context-menu item to transform object to make interaction widget visible HOT 2
- Slicer crashes on Windows when volume with NaN voxel value is loaded HOT 3
- Incorrect geometry after running Orient Scalar Volume HOT 1
- Issues downloading the sample HOT 7
- error: EXTENSION_README_FILE points to an inexistent file: C:/Dev/Slicer/README.txt HOT 1
- Add documentation for Ctrl + Left-Click-and-drag in 3D view HOT 1
- Semi-transparent models are not rendered correctly if shadows visibility is enabled HOT 1
- Cannot start after setting language to Chinese HOT 3
- ITK version upgrade broke ALPACA module in SlicerMorph.
- I have found that "Grid Surface" can achieve precise surfaces, so can we use this in turn to generate surfaces from countless points. Just like the effects of the minics below. Because it would be much more convenient to operate in this way
- Value invalid HOT 2
- Allow Extension to Register Additional "Extension Wizard" Templates
- SimpleITK import fails in preview builds of Windows HOT 3
- Head position change - Harden transform was applied for volume rendering but not for scan slices HOT 2
- Set filter for DICOM query in python scipted modules from version 5.7.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slicer.