# segmentation: scissors

**URL:** <https://discourse.slicer.org/t/segmentation-scissors/5997>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [March 2, 2019, 10:55pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997 "2019-03-02T22:55:19Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 2, 2019, 10:55pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/1 "2019-03-02T22:55:19Z")

</div>

Hello everyone,  
I have problem we the tool scissors in segmentation menu. It started to be very laggy like minutes to do just simple cutting.

My workflow didn’t change, but i started experience these long waiting periods.  
I usually segment a vessel with fast marching (segmentationeditor extension), apply it, and try to cut off some parts in 3d view windows with the scissors tool, which takes form a few minutes to even half hour in more vast and complex cut. The workflow is similar to that presented on youtube: “make hollow” from ParkLab research. The problems occurred on version 4.9 and didn’t disappear after upgrade to 4.10.1

I work on iMac 2017y, Mojave OS; I7 4.2Ghz, 64GB ram; AMD Radeon 580 8gb  
In my opinion the hardware and software should be enough.  
What can I do with the issue?

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 4, 2019, 8:19am UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/2 "2019-03-04T08:19:42Z")

</div>

Did you try disabling “smoothing” under show 3d? it significantly reduces the computing time

 ![Capture%20d%E2%80%99%C3%A9cran%20(249)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/1/c1a48d4a00a783cb33bd3671ea0ce233e3c047b8.png)

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 4, 2019, 5:01pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/3 "2019-03-04T17:01:19Z")

</div>

It used to work well but something changed. I always worked with smoothing and was fine. Moreover, turning off smoothing don’t help.  
The strange thing is that the same scans are working normally on slower computer (MacBook pro 2015y).  
Now it looks like during scissoring the slicer is not responding and it takes long minutes to deal with it. On the other computer just 2 seconds. I tried reinstalling slicer, cleaning disk, computer. The other things work super fast. Therefore I think it is something wrong with Slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 4, 2019, 5:13pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/4 "2019-03-04T17:13:52Z")

</div>

Could you please send us a data set with that you can reproduce this issue? (upload to dropbox/onedrive/etc. and post the link)

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 3:51pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/5 "2019-03-05T15:51:54Z")

</div>

I enclose the dataset I discovered the problem. I do aorta segmentation with fast marching. I do some over segmentation that i have leakage on the spinal vertebra. When i cut the spine off in 3D view, Slicer is not responding for about 30 minutes. When I use scissors tool but in the saggital/axial view then cutting is very fast.  
Unfortunetly, the enclosed CT is not the only one. Currently, I have the same problem with all CTs when trying to cut the bigger surface. I worked fine 2-3 months ago. I don’t know what happened.

> **[Dropbox - File Deleted](https://www.dropbox.com/s/kvkewbfqi2cqkjt/Vascular%20Aorta_Brzuszna%20%28Adult%29.zip?dl=0)**
>
> Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 5, 2019, 4:37pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/6 "2019-03-05T16:37:11Z")

</div>

I’ve tried the processing that you describe on your data. Cutting is fast for me in all views, on a 3-year old PC with 16GB RAM (see this video: [https://1drv.ms/v/s!Arm\_AFxB9yqHtvxvfwJOk1vLFwnv7Q](https://1drv.ms/v/s!Arm_AFxB9yqHtvxvfwJOk1vLFwnv7Q)).

Do you see any errors in the application log?  
Do you have similar issues if you use simple thresholding to extract the vessel?

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 6:36pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/7 "2019-03-05T18:36:05Z")

</div>

. I recorded my screen, but the mac wheel of death is not being recorded (apple is clever:)))  
logs as on the movie. [https://www.dropbox.com/s/ui4wsp6kk7enlis/Nagranie%20z%20ekranu%202019-03-5%20o%2019.23.50.mov?dl=0](https://www.dropbox.com/s/ui4wsp6kk7enlis/Nagranie%20z%20ekranu%202019-03-5%20o%2019.23.50.mov?dl=0)

For treshold segmentation is the same. The method of segmentation doesn’t matter. Smth wrong when working on 3d rendering data. I tried 3d volume renderings on Horos and they work fine.

I reinstalled Slicer with removing ~/.config/NA-MIC, but without improvement. Are there any other files that slicer could left after uninstalling?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 5, 2019, 7:01pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/8 "2019-03-05T19:01:28Z")

</div>

Can you run XCode instruments to see what the application is doing?  
How is the memory usage while the computation is in progress?  
Any messages in the application log (menu: Help/Report a bug)?

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 7:29pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/9 "2019-03-05T19:29:59Z")

</div>

my CPU and memory usage is as following :

 ![19](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/3/c39763506d7c07f7efa48385c9927b3e38ac0107.jpeg) ![09](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/b/0bf2d52b670a3baf992d2d38054e85febf57ddf4.jpeg)

bug report [Dropbox - bug report.docx - Simplify your life](https://www.dropbox.com/s/z014esz86612si6/bug%20report.docx?dl=0)  
and there is nothing wrong in application log

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 7:32pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/10 "2019-03-05T19:32:55Z")

</div>

i tried Slicer under bootcamp Windows on the same iMac and it works pretty fine 4-5 sec lags when cutting big areas. So the problem is on MacOS

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 5, 2019, 7:47pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/11 "2019-03-05T19:47:25Z")

</div>

Can you run XCode Instruments to see what the application is doing? It can tell in what function Slicer spends time, which can help a lot in narrowing down what the issue can be.

[https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/debugging\_with\_xcode/chapters/debugging\_tools.html](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/debugging_tools.html)

[https://help.apple.com/instruments/mac/current/#//apple\_ref/doc/uid/TP40004652-CH6-SW11](https://help.apple.com/instruments/mac/current/#//apple_ref/doc/uid/TP40004652-CH6-SW11)

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 8:24pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/12 "2019-03-05T20:24:17Z")

</div>

I’ve downloaded Xcode app but I have no idea how to load in 3d slicer  
Could you help with that part?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 5, 2019, 8:39pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/13 "2019-03-05T20:39:18Z")

</div>

You start 3D Slicer as usual, then launch Instruments, choose _attach to process_, and select the Slicer process. I don’t have a Mac, so I cannot help with specific instructions, but you should be able to find them by searching the web and if you have questions then Mac users should be able to help.

@pieper

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [March 5, 2019, 8:49pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/14 "2019-03-05T20:49:47Z")

</div>

Disable (or uninstall) CleanMyMac X.

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 9:25pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/15 "2019-03-05T21:25:17Z")

</div>

disabling CleanMac X didn’t help.

i attached the Slicer process to Xcode Debugger. However I am not sure the data is correct

 ![22](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/8/d876cf74832eccffaa9704930ae7579596884c97.jpeg)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 5, 2019, 9:41pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/16 "2019-03-05T21:41:37Z")

</div>

> [@froth](#):
>
> I’ve downloaded Xcode app but I have no idea how to load in 3d slicer  
> Could you help with that part?

Easiest is to select the Slicer entry in the mac Activity Monitor and then select Sample Process from the gear menu. This gives you most of the same information as Xcode instruments.

---

<div class="post-metadata">

**Author:** ![froth](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@froth](https://discourse.slicer.org/u/froth)\
**Post date:** [March 5, 2019, 10:45pm UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/17 "2019-03-05T22:45:39Z")

</div>

The Sample Process of not responding 3d Slicer looks like this [https://www.dropbox.com/s/ghj54e8pqd9jauw/Slicer%20sample.docx?dl=0](https://www.dropbox.com/s/ghj54e8pqd9jauw/Slicer%20sample.docx?dl=0)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 6, 2019, 12:51am UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/18 "2019-03-06T00:51:42Z")

</div>

Thanks for posting that - it does look like most of the time is spent executing the scissors, so maybe there’s a very inefficient code path that stalls on mac.

@lassoan is there a test for the scissors so we can compare the exact operation on multiple platforms?

```auto
    + 2564 qMRMLSegmentEditorWidget::processEvents(vtkObject*, unsigned long, void*, void*) (in libqSlicerSegmentationsModuleWidgets.dylib) + 382 [0x128e29b5e]
    + 2564 qSlicerSegmentEditorScissorsEffect::processInteractionEvents(vtkRenderWindowInteractor*, unsigned long, qMRMLWidget*) (in libqSlicerSegmentationsEditorEffects.dylib) + 445 [0x128fc1a2d]
    + 2564 qSlicerSegmentEditorScissorsEffectPrivate::paintApply(qMRMLWidget*) (in libqSlicerSegmentationsEditorEffects.dylib) + 205 [0x128fbe1dd]
    + 2564 vtkStreamingDemandDrivenPipeline::Update(int, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 254 [0x11c3f3d8e]
    + 2564 vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 1120 [0x11c3f39a0]
    + 2564 vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 1228 [0x11c3cd61c]
    + 2564 vtkCompositeDataPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 107 [0x11c3c885b]
    + 2564 vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 61 [0x11c3cde9d]
    + 2564 vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) (in libvtkCommon-8.2.1.dylib) + 69 [0x11c3d32c5]
    + 2564 vtkImageStencilAlgorithm::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkImaging-8.2.1.dylib) + 65 [0x11bade4a1]
    + 2564 vtkPolyDataToImageStencil::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (in libvtkImaging-8.2.1.dylib) + 139 [0x11bd0281b]
    + 1284 vtkPolyDataToImageStencil::ThreadedExecute(vtkImageStencilData*, int*, int) (in libvtkImaging-8.2.1.dylib) + 2523 [0x11bd01efb]
    + ! 1013 vtkAOSDataArrayTemplate<float>::GetTuple(long long, double*) (in libvtkCommon-8.2.1.dylib) + 217,28,... [0x11bfa8519,0x11bfa845c,...]
    + ! 271 vtkStructuredGrid::GetPoint(long long, double*) (in libvtkCommon-8.2.1.dylib) + 0,11,... [0x11c28bb90,0x11c28bb9b,...]
    + 1147 vtkPolyDataToImageStencil::ThreadedExecute(vtkImageStencilData*, int*, int) (in libvtkImaging-8.2.1.dylib) + 2595,2603,... [0x11bd01f43,0x11bd01f4b,...]
    + 131 vtkStructuredGrid::GetPoint(long long, double*) (in libvtkCommon-8.2.1.dylib) + 26 [0x11c28bbaa]
    + 2 vtkPolyDataToImageStencil::ThreadedExecute(vtkImageStencilData*, int*, int) (in libvtkImaging-8.2.1.dylib) + 2250 [0x11bd01dea]
    + 2 vtkAOSDataArrayTemplate<float>::GetTuple(long long, double*) (in libvtkCommon-8.2.1.dylib) + 213,217 [0x11bfa8515,0x11bfa8519]

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 14, 2019, 12:21am UTC](https://discourse.slicer.org/t/segmentation-scissors/5997/19 "2019-03-14T00:21:12Z")

</div>

There is no automated test for Scissors.

Most of the time is spent in vtkPolydataToImageFilter, which is a quite simple and robust filter, so I suspect that the input extent or resolution of the output image might not be computed correctly. Does the memory usage of Slicer jumps significantly when Scissors operation takes a long time?
