lassoan / slicersegmenteditorextraeffects Goto Github PK
View Code? Open in Web Editor NEWMany additional segmentation tools for 3D Slicer's Segment Editor
License: BSD 3-Clause "New" or "Revised" License
Many additional segmentation tools for 3D Slicer's Segment Editor
License: BSD 3-Clause "New" or "Revised" License
Hi~, compile fast marching, occur problems. How to solve it? Slicer: 4.13
error MSB8066 “F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\af48e75bdc1f6526df0ee52205b87753\vtkSlicerSegmentEditorFastMarchingModuleLogicHierarchy.txt.rule;F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\30d6f6811f90011a05054f3b2040fa51\vtkSlicerSegmentEditorFastMarchingModuleLogicHierarchy.rule”的自定义生成已退出,代码为 3。 vtkSlicerSegmentEditorFastMarchingModuleLogicHierarchy C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 241
error MSB8066 “F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\af48e75bdc1f6526df0ee52205b87753\vtkSlicerSegmentEditorFastMarchingModuleLogicHierarchy.txt.rule”的自定义生成已退出,代码为 3。 vtkSlicerSegmentEditorFastMarchingModuleLogic C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 241
error MSB8066 “F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\e686317f99aa0cdcfe62d90a5c00061d\vtkPichonFastMarchingPython.cxx.rule;F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\e686317f99aa0cdcfe62d90a5c00061d\vtkPichonFastMarchingPDFPython.cxx.rule;F:\SlicerSegmentEditorExtraEffects\build\CMakeFiles\e686317f99aa0cdcfe62d90a5c00061d\vtkSlicerSegmentEditorFastMarchingModuleLogicPythonInit.cxx.rule”的自定义生成已退出,代码为 3。 vtkSlicerSegmentEditorFastMarchingModuleLogicPythonD C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 241
error C1083 无法打开源文件: “F:\SlicerSegmentEditorExtraEffects\build\SegmentEditorFastMarching\Logic\vtkSlicerSegmentEditorFastMarchingModuleLogicPythonInit.cxx”: No such file or directory vtkSlicerSegmentEditorFastMarchingModuleLogicPython F:\SlicerSegmentEditorExtraEffects\build\SegmentEditorFastMarching\Logic\c1xx 1
While invistigating the SliceTracker issue on the new Slicer release( https://discourse.slicer.org/t/slicetracker-module-cannot-be-loaded-on-slicer-4-11-20200930/13895/3 ), I found that Slicer fails to load SegmentEditorExtraEffects from SilceTracker:
SyntaxError: invalid syntax
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/junichi/slicer/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/imp.py", line 170, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 618, in _exec
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/junichi/.config/NA-MIC/Extensions-29402/SliceTracker/lib/Slicer-4.11/qt-scripted-modules/SurfaceCutToLabel.py", line 11, in <module>
from SegmentEditorSurfaceCutLib import SurfaceCutLogic
File "/home/junichi/.config/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSurfaceCutLib/__init__.py", line 4, in <module>
from SegmentEditorEffect import *
ModuleNotFoundError: No module named 'SegmentEditorEffect'
TypeError: module.__init__() argument 1 must be str, not qSlicerScriptedLoadableModule
The engrave effect is referencing a function vtkMRMLMarkupsPlaneNode.GetPlaneToWorldMatrix
which no longer exists. It seems that it was changed to vtkMRMLMarkupsPlaneNode.GetObjectToWorldMatrix
as part of Slicer/Slicer@4c170cd. Need to update to use new function.
Hi,
Just wondering if there's plans to port this extension over to the latest Slicer. I'm not currently able to find it through the extension manager and I'm wondering how to best install it or whether I should jump back to a previous version of Slicer to continue using it.
Thanks for all your incredible work.
Currently, flood filling can propagate in the entire image and the result is applied to the "editable area".
However, it would help if flood filling would only propagate in the "editable area" - it would make it easier to stop leaking by using an appropriate mask.
vtkImageThresholdConnectivity filter already has a stencil input, so we should just generate a stencil from the editable area and set it in the filter:
http://www.vtk.org/doc/release/6.3/html/classvtkImageThresholdConnectivity.html#a106f02553f3445161a9d742b9481dc14
I think the updates to the new markups framework has caused some error. When placing points for the surface cut and draw tube effect while testing with today's Slicer nightly build, there isn't a model being created. There is just floating fiducial points. When placing points within the MarkupsToModel module, model creation does work.
The following traceback occurs after installing this extension in the current Slicer nightly build. It appears to be caused by SlicerIGT/SlicerMarkupsToModel@7612c42. @lassoan Do you want to go ahead and make a 4.10 branch for this repo as was done in the MarkupsToModel repo? Then the DrawTube effect can work in both the Slicer nightly and in Slicer stable.
Traceback (most recent call last):
File "C:/Users/james/AppData/Roaming/NA-MIC/Extensions-28040/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorDrawTubeLib/SegmentEditorEffect.py", line 14, in __init__
self.logic = DrawTubeLogic(scriptedEffect)
File "C:/Users/james/AppData/Roaming/NA-MIC/Extensions-28040/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorDrawTubeLib/SegmentEditorEffect.py", line 363, in __init__
self.curveGenerator = vtkSlicerMarkupsToModelModuleLogicPython.vtkCurveGenerator()
AttributeError: 'module' object has no attribute 'vtkCurveGenerator'
Traceback (most recent call last):
File "C:/Users/james/AppData/Roaming/NA-MIC/Extensions-28040/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorDrawTube.py", line 27, in registerEditorEffect
instance.self().register()
AttributeError: 'NoneType' object has no attribute 'register'
Warning: In C:\Slicer\Libs\MRML\Core\vtkMRMLDisplayNode.cxx, line 1140
vtkMRMLModelDisplayNode (000001C8006E8970): Deprecated, please use Visibility2DOn instead
If I use, Visibility2DOn
instead of the deprecated method SliceIntersectionVisibilityOn
, should this be accomplished with statements like
if slicer.app.mainApplicationMajorVersion >= 5 or (slicer.app.mainApplicationMajorVersion == 4 and slicer.app.mainApplicationMinorVersion >= 11):
modelDisplayNode.Visibility2DOn()
else:
modelDisplayNode.SliceIntersectionVisibilityOn()
or do you want to create a "4.10" branch for this repo?
I noticed frequent crashes when using 'Fast marching' effect. Sometimes it occurs on first initialization, but most often after 'Cancel', modify 'Maximum volume' parameter and repeat initialization.
It is also volume dependent. I can reproduce it on one sample volume (of good quality), but not with CTA-cardio for example.
Here is a backtrace :
error: libstdc++.so.6 {0x00181389}: DIE has DW_AT_ranges(0x119c8) attribute, but range extraction failed (missing or invalid range list table), please file a bug and attach the file at the start of this error message
Process 111504 stopped
* thread #1, name = 'SlicerApp-real', stop reason = signal SIGSEGV: invalid address (fault address: 0x5555657e6c6c)
frame #0: 0x00007fff7d907ad4 libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`PichonFastMarchingPDF::update(this=0x000055555aa4aa80) at vtkPichonFastMarchingPDF.cxx:139:14
(lldb) bt
* thread #1, name = 'SlicerApp-real', stop reason = signal SIGSEGV: invalid address (fault address: 0x5555657e6c6c)
* frame #0: 0x00007fff7d907ad4 libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`PichonFastMarchingPDF::update(this=0x000055555aa4aa80) at vtkPichonFastMarchingPDF.cxx:139:14
frame #1: 0x00007fff7d90819c libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`PichonFastMarchingPDF::addRealization(this=<unavailable>, k=<unavailable>) at vtkPichonFastMarchingPDF.cxx:224:5
frame #2: 0x00007fff7d906cb7 libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`vtkPichonFastMarching::addSeedIJK(int, int, int) [inlined] vtkPichonFastMarching::collectInfoSeed(this=0x000055555daa8ad0, index=<unavailable>) at vtkPichonFastMarching.cxx:46:19
frame #3: 0x00007fff7d906c93 libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`vtkPichonFastMarching::addSeedIJK(this=0x000055555daa8ad0, I=<unavailable>, J=<unavailable>, K=<unavailable>) at vtkPichonFastMarching.cxx:1223
frame #4: 0x00007fff7d906f1e libvtkSlicerSegmentEditorFastMarchingModuleLogic.so`vtkPichonFastMarching::addSeedsFromImage(this=0x000055555daa8ad0, label=<unavailable>) at vtkPichonFastMarching.cxx:1258:19
frame #5: 0x00007fff7d913e36 vtkSlicerSegmentEditorFastMarchingModuleLogicPython.so`PyvtkPichonFastMarching_addSeedsFromImage(self=<unavailable>, args=<unavailable>) at vtkPichonFastMarchingPython.cxx:0
frame #6: 0x00007fffe55d09fc libpython3.6m.so`_PyCFunction_FastCallDict(func_obj=0x00007ffee084b120, args=0x000055555daf5de0, nargs=<unavailable>, kwargs=0x0000000000000000) at methodobject.c:234:22
frame #7: 0x00007fffe56451bb libpython3.6m.so`call_function(pp_stack=0x00007fffffffb038, oparg=<unavailable>, kwnames=<unavailable>) at ceval.c:4837:9
frame #8: 0x00007fffe564243e libpython3.6m.so`_PyEval_EvalFrameDefault(f=0x000055555daf5ba8, throwflag=<unavailable>) at ceval.c:3335:19
frame #9: 0x00007fffe5646492 libpython3.6m.so`fast_function [inlined] PyEval_EvalFrameEx(f=0x000055555daf5ba8, throwflag=0) at ceval.c:754:12
frame #10: 0x00007fffe5646483 libpython3.6m.so`fast_function [inlined] _PyFunction_FastCall(co=<unavailable>, args=<unavailable>, nargs=2, globals=<unavailable>) at ceval.c:4919
frame #11: 0x00007fffe564642b libpython3.6m.so`fast_function(func=<unavailable>, stack=<unavailable>, nargs=2, kwnames=<unavailable>) at ceval.c:4954
frame #12: 0x00007fffe5645194 libpython3.6m.so`call_function(pp_stack=0x00007fffffffb1f8, oparg=<unavailable>, kwnames=<unavailable>) at ceval.c:4858:17
frame #13: 0x00007fffe564243e libpython3.6m.so`_PyEval_EvalFrameDefault(f=0x00007ffee07ef428, throwflag=<unavailable>) at ceval.c:3335:19
frame #14: 0x00007fffe5646887 libpython3.6m.so`_PyFunction_FastCallDict(func=<unavailable>, args=<unavailable>, nargs=<unavailable>, kwargs=<unavailable>) at ceval.c:0
frame #15: 0x00007fffe558e612 libpython3.6m.so`_PyObject_FastCallDict(func=0x00007fff201e09d8, args=0x00007fffffffb360, nargs=1, kwargs=0x0000000000000000) at abstract.c:2310:18
frame #16: 0x00007fffe558e7b1 libpython3.6m.so`_PyObject_Call_Prepend(func=0x00007fff201e09d8, obj=0x00007ffee074e908, args=<unavailable>, kwargs=0x0000000000000000) at abstract.c:2373:14
frame #17: 0x00007fffe558e6b4 libpython3.6m.so`_PyObject_FastCallDict(func=0x00007ffee0770088, args=0x0000000000000000, nargs=0, kwargs=0x0000000000000000) at abstract.c:2331:18
frame #18: 0x00007fffec1c979b libPythonQt.so`PythonQtSignalTarget::call(callable=0x00007ffee0770088, methodInfos=0x000055555624f140, arguments=0x00007fffffffb5a0, skipFirstArgumentOfMethodInfo=<unavailable>) at PythonQtSignalReceiver.cpp:130:14
frame #19: 0x00007fffec1ca1d1 libPythonQt.so`PythonQtSignalReceiver::qt_metacall(QMetaObject::Call, int, void**) [inlined] PythonQtSignalTarget::call(this=0x000055555d8e78b0, arguments=0x00007fffffffb5a0) const at PythonQtSignalReceiver.cpp:56:22
frame #20: 0x00007fffec1ca1b9 libPythonQt.so`PythonQtSignalReceiver::qt_metacall(this=0x000055555d8e7320, c=<unavailable>, id=5, arguments=<unavailable>) at PythonQtSignalReceiver.cpp:273
frame #21: 0x00007ffff644a4f7 libQt5Core.so.5`___lldb_unnamed_symbol4768$$libQt5Core.so.5 + 631
frame #22: 0x00007ffff6fe25e3 libQt5Widgets.so.5`QAbstractButton::clicked(bool) + 67
frame #23: 0x00007ffff6fe286c libQt5Widgets.so.5`___lldb_unnamed_symbol1438$$libQt5Widgets.so.5 + 60
frame #24: 0x00007ffff6fe4474 libQt5Widgets.so.5`___lldb_unnamed_symbol1444$$libQt5Widgets.so.5 + 196
frame #25: 0x00007ffff6fe4695 libQt5Widgets.so.5`QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 245
frame #26: 0x00007fffec462a81 libPythonQt.so`PythonQtShell_QPushButton::mouseReleaseEvent(this=0x000055555d8e7070, e0=<unavailable>) at com_trolltech_qt_gui7.cpp:7639:16
frame #27: 0x00007ffff6f2e0be libQt5Widgets.so.5`QWidget::event(QEvent*) + 526
frame #28: 0x00007fffec46023c libPythonQt.so`PythonQtShell_QPushButton::event(this=0x000055555d8e7070, e0=<unavailable>) at com_trolltech_qt_gui7.cpp:7111:23
frame #29: 0x00007ffff6eead62 libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 130
frame #30: 0x00007ffff6ef2ac9 libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 2729
frame #31: 0x00007ffff7c90d0e libqSlicerBaseQTGUI.so`qSlicerApplication::notify(this=<unavailable>, receiver=<unavailable>, event=<unavailable>) at qSlicerApplication.cxx:412:26
frame #32: 0x00007ffff64133fa libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 314
frame #33: 0x00007ffff6ef157b libQt5Widgets.so.5`QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 443
frame #34: 0x00007ffff6f47a84 libQt5Widgets.so.5`___lldb_unnamed_symbol921$$libQt5Widgets.so.5 + 740
frame #35: 0x00007ffff6f4adb5 libQt5Widgets.so.5`___lldb_unnamed_symbol932$$libQt5Widgets.so.5 + 517
frame #36: 0x00007ffff6eead62 libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 130
frame #37: 0x00007ffff7c90d0e libqSlicerBaseQTGUI.so`qSlicerApplication::notify(this=<unavailable>, receiver=<unavailable>, event=<unavailable>) at qSlicerApplication.cxx:412:26
frame #38: 0x00007ffff64133fa libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 314
frame #39: 0x00007ffff67ec1f0 libQt5Gui.so.5`QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 1712
frame #40: 0x00007ffff67c17d5 libQt5Gui.so.5`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 181
frame #41: 0x00007fffce39afcc libQt5XcbQpa.so.5`___lldb_unnamed_symbol407$$libQt5XcbQpa.so.5 + 28
frame #42: 0x00007fffe0b834dc libglib-2.0.so.0`g_main_context_dispatch + 620
frame #43: 0x00007fffe0bd7799 libglib-2.0.so.0`___lldb_unnamed_symbol452$$libglib-2.0.so.0 + 521
frame #44: 0x00007fffe0b80bc1 libglib-2.0.so.0`g_main_context_iteration + 49
frame #45: 0x00007ffff646c026 libQt5Core.so.5`QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 102
frame #46: 0x00007ffff6411d6c libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 300
frame #47: 0x00007ffff641a2d4 libQt5Core.so.5`QCoreApplication::exec() + 148
frame #48: 0x00007ffff752f4c6 libqSlicerBaseQTCore.so`qSlicerCoreApplication::exec() at qSlicerCoreApplication.cxx:876:19
frame #49: 0x000055555555999c SlicerApp-real`main [inlined] (anonymous namespace)::SlicerAppMain(argc=1, argv=0x00007fffffffc498) at Main.cxx:62:10
frame #50: 0x00005555555597b1 SlicerApp-real`main(argc=<unavailable>, argv=0x00007fffffffc498) at qSlicerApplicationMainWrapper.cxx:56
frame #51: 0x00007fffe156bb25 libc.so.6`__libc_start_main + 213
frame #52: 0x00005555555596be SlicerApp-real`_start + 46
(lldb)
Please not that this happens before and after 88673aa.
Hoping it may help for a resolution.
For registration, MRI bias field correction, etc. a binary labelmap input is required. Although the selected segment can be exported to a binary labelmap, it would be slightly more convenient to be able to create a binary labelmap directly from the Mask volume effect.
Using Slicer 4.10 and the MRHead.nrrd data set, if I place fiducials for "Draw Tube" or "Surface Cut" effect then "No input data" messages will be printed to the log upon adding fiducials. The messages will also be printed to the log when mouse scrolling to another slice in the volume.
It seems like the "No input data" messages originates from vtkTransformPolyDataFilter which is used in "Draw Tube" and "Surface Cut".
The output message is also reminiscent of what was described in Slicer/Slicer#563.
Hi, I want to extent the segment editor module like those extra effects. How can I achieve this goal.
I'm trying the ExtraEffects tools to segment femoral veins in CTAs (arteries great, veins have lower contrast, trying to avoid much manual clean up), couldn't get the control-click to work on Local Threshold, no response on Fast Marching, etc. I found the comment from April '21 by danpak94 at:
https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/42
and can confirm that while the tools work fine on non-transformed segments, I also have the problem that the tools don't like to work with segmentations that have been transformed (both rotated and translated in my case).
A workable workaround for me is to make a separate, non-transformed segmentation, but that may not be appropriate for everyone.
I have a dataset with -1024,3071 range. When I use the Split segment and specify the Fill value as -1024, it still pads with 0.
Mask segment works correctly for the same dataset. My dataset is a bit big so I couldn't upload it.
@smrolfe
Currently, Volume masking effect uses closed surface representation of a segment to create a stencil and use that stencil for masking. However, closed surface representation may produce slightly different stencil as the original binary representation of a segment.
Change the effect to generate stencil directly from closed surface representation (resampled into the input volume's geometry).
Hi
I noticed that after drawing the first tube and clicking "Apply" and then drawing another tube and clicking "Apply" (on the same segment), the first tube is erased
Happens on:
After these improvements, Mask Volume effect should be ready to be merged into Slicer core:
When the SurfaceCut tool is used from a python script, after effect.self().onApply()
is called, the segmentation is still observed for SegmentModified events. I think this is because the deactivate()
function, which would normally remove the observer, is not called when not using the GUI. Removing the observer (via self.observeSegmentation(False)
) in onApply() would work for outside scripts like mine, but would cause problems for GUI users of the SurfaceCut effect. I'm not sure of the best way to to modify the SurfaceCut code to remove the observer just for non-GUI uses of the tool. Now that I am aware of the problem, I add a call to effect.self().observeSegmentation(False)
right after effect.self().onApply()
, but it seems like the effect might be able to do a better job of cleaning up after itself. Or does it make sense to ask the user to run effect.self().deactivate()
after running effect.self().onApply()
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.