SCIInstitute / Cleaver

A MultiMaterial Tetrahedral Meshing Library and Application
https://cleaver.readthedocs.io
Other
40 stars 18 forks source link

Padding crashes #83

Closed jobstoks closed 5 years ago

jobstoks commented 5 years ago

Hi,

When I try to set padding larger than 0, I can compute a sizing field, but Cleaver 2.4 crashes pretty soon while cleaving the mesh. I've tried multiple settings because I thought maybe it's just too heavy for my laptop, but even with very coarse mesh settings, Cleaver 2.4 crashes. Is this a known problem, or is there any solution to this problem?

Thanks a lot!

allywarner commented 5 years ago

What OS are you using?

jobstoks commented 5 years ago

Hi Ally,

I am currently using windows 10 64-bit. Would you recommend me to use it on linux?

Kind regards, Job.

Op 14 aug. 2019 20:46 schreef Ally Warner notifications@github.com:

What OS are you using?

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/SCIInstitute/Cleaver2/issues/83?email_source=notifications&email_token=AJHPFTLMVYTVL66KPZRO3ITQERHGZA5CNFSM4ILU4YD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4JXSQQ#issuecomment-521369922, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJHPFTMI4BBAX5UOCJRPM7TQERHGZANCNFSM4ILU4YDQ.

jessdtate commented 5 years ago

I was able to reproduce this on OS X 10.12. Here is the crash report:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: EXC_I386_GPFLT Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 org.qt-project.QtGui 0x0000000103c4137e QPen::QPen() + 46 1 org.qt-project.QtGui 0x0000000103c149e5 QPainterState::QPainterState() + 69 2 org.qt-project.QtGui 0x0000000103beb831 QRasterPaintEngine::createState(QPainterState) const + 49 3 org.qt-project.QtGui 0x0000000103c03e3d QPainter::begin(QPaintDevice) + 413 4 libqcocoa.dylib 0x00000001046634a3 QRasterBackingStore::beginPaint(QRegion const&) + 387 5 org.qt-project.QtGui 0x0000000103b5b95e QBackingStore::beginPaint(QRegion const&) + 350 6 org.qt-project.QtWidgets 0x0000000103437dd1 QWidgetBackingStore::doSync() + 3217 7 org.qt-project.QtWidgets 0x00000001034655eb QWidget::event(QEvent) + 1451 8 org.qt-project.QtWidgets 0x0000000103575755 QMainWindow::event(QEvent) + 277 9 org.qt-project.QtWidgets 0x000000010342af12 QApplicationPrivate::notify_helper(QObject, QEvent) + 306 10 org.qt-project.QtWidgets 0x000000010342c2ed QApplication::notify(QObject, QEvent) + 573 11 org.qt-project.QtCore 0x00000001040a954f QCoreApplication::notifyInternal2(QObject, QEvent) + 159 12 org.qt-project.QtWidgets 0x000000010343414f QWidgetBackingStore::sendUpdateRequest(QWidget, QWidgetBackingStore::UpdateTime) + 319 13 org.qt-project.QtWidgets 0x0000000103434d1f QWidgetBackingStore::markDirty(QRect const&, QWidget, QWidgetBackingStore::UpdateTime, QWidgetBackingStore::BufferState) + 1055 14 org.qt-project.QtWidgets 0x0000000103468eef void QWidgetPrivate::repaint(QRect) + 207 15 org.qt-project.QtWidgets 0x00000001035d56bd QStatusBar::hideOrShow() + 365 16 org.qt-project.QtWidgets 0x00000001035d5534 QStatusBar::showMessage(QString const&, int) + 196 17 0x000000010308114f MainWindow::handleMessage(std::1::basic_string<char, std::__1::char_traits, std::1::allocator >) + 95 18 0x000000010306ba38 MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void) + 584 19 org.qt-project.QtCore 0x00000001040da79a QMetaObject::activate(QObject*, int, int, void*) + 2954 20 0x000000010306caf7 CleaverWidget::message(std::1::basic_string<char, std::__1::char_traits, std::1::allocator >) + 55 21 0x000000010308a325 CleaverWidget::handleMessage(std::1::basic_string<char, std::__1::char_traits, std::1::allocator >) + 37 22 0x000000010306c80b CleaverWidget::qt_static_metacall(QObject, QMetaObject::Call, int, void) + 731 23 org.qt-project.QtCore 0x00000001040d2964 QObject::event(QEvent) + 788 24 org.qt-project.QtWidgets 0x0000000103466407 QWidget::event(QEvent) + 5063 25 org.qt-project.QtWidgets 0x0000000103543b6d QDockWidget::event(QEvent) + 813 26 org.qt-project.QtWidgets 0x000000010342af12 QApplicationPrivate::notify_helper(QObject, QEvent) + 306 27 org.qt-project.QtWidgets 0x000000010342c2ed QApplication::notify(QObject, QEvent) + 573 28 org.qt-project.QtCore 0x00000001040a954f QCoreApplication::notifyInternal2(QObject, QEvent) + 159 29 org.qt-project.QtCore 0x00000001040aa722 QCoreApplicationPrivate::sendPostedEvents(QObject, int, QThreadData) + 850 30 libqcocoa.dylib 0x00000001045843de QCocoaEventDispatcherPrivate::processPostedEvents() + 190 31 libqcocoa.dylib 0x0000000104584c91 QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void) + 33 32 com.apple.CoreFoundation 0x00007fff870c68c1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 33 com.apple.CoreFoundation 0x00007fff870a77bd CFRunLoopDoSources0 + 557 34 com.apple.CoreFoundation 0x00007fff870a6cb6 CFRunLoopRun + 934 35 com.apple.CoreFoundation 0x00007fff870a66b4 CFRunLoopRunSpecific + 420 36 com.apple.HIToolbox 0x00007fff86606ebc RunCurrentEventLoopInMode + 240 37 com.apple.HIToolbox 0x00007fff86606cf1 ReceiveNextEventCommon + 432 38 com.apple.HIToolbox 0x00007fff86606b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71 39 com.apple.AppKit 0x00007fff84b9ba54 _DPSNextEvent + 1120 40 com.apple.AppKit 0x00007fff853177ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796 41 com.apple.AppKit 0x00007fff84b903db -[NSApplication run] + 926 42 libqcocoa.dylib 0x0000000104583a8d QCocoaEventDispatcher::processEvents(QFlags) + 2397 43 org.qt-project.QtCore 0x00000001040a50a2 QEventLoop::exec(QFlags) + 418 44 org.qt-project.QtCore 0x00000001040a9c62 QCoreApplication::exec() + 402 45 0x000000010306e810 main + 352 46 libdyld.dylib 0x00007fff9c8aa235 start + 1

jessdtate commented 5 years ago

Crashes with command line tool and 2.3.1 release too. I'm not sure how far back it goes, but it I get a lot of PROBLEM! Creating nullptr Tet when running on the command line.

jessdtate commented 5 years ago

@jobstoks a work around for this bug could be to pad the segmentation or indicator functions. you can use Seg3D to do that.

jobstoks commented 5 years ago

Thanks! How do you mean exactly? I understand that I can pad the segmentation in seg3D, but do you perhaps have any suggestions on how to remove this padding afterwards?

jessdtate commented 5 years ago

Cleaver has an option to clip out the background mesh after it creates the mesh. If you want to clip the background back to the original size, you can use SCIRun. However, I'm not sure why you want padding if you are going to clip it back. Cleaver should handle the borders.

jobstoks commented 5 years ago

@jessdtate thanks! I did indeed notice the option to clip out the background mesh. Well, to be honest, I'm not that expienced with meshing. But what I noticed is that when I’m using Cleaver, the settings cannot be too high, or the application will crash (it doesn’t get stuck, but it just closes right away. FYI: I'm just using my regular middle-end laptop just to try out some stuff). But when I’m turning the settings a little lower and I choose element size to be constant, the element size is not always constant, especially near the borders (see simple non-clipped image). This effect seems to decrease with finer mesh settings, but I cannot make the mesh any finer. For this reason, I thought padding would help. Or do you think I'm on the wrong track here?

image

jessdtate commented 5 years ago

padding may help, but I think it would need to be in the segmentation. Most people don't trim the segmentations that close. Since the myocardial layer touches the boundary of the volume, it is not recognizing some parts as a material boundary. If you add a few pixels on each edge (eg, in Seg3D), it would probably make it more uniform.

The crashing is mostly because meshing can take a lot of memory and you are likely running out.

allywarner commented 5 years ago

Padding doesn't seem to work at all on Cleaver, and it will be disabled for now. Seg3D is a great alternative for padding a segmentation. Hopefully we can reintroduce a padding feature soon (we have opened another issue for it).