Segmentation - Drawing Tablet

Only when I use the pen. The mouse works ok, but I prefer using a pen to prevent rsi-risk and it’s also much faster. I draw left (I’m lefthanded) and mouse right.

A few years ago when I started working with segmentation software, within a week I started to feel muscle pain in my lower arm. Since then I’m using a drawing tablet.

I also prefer Linux over Windows, because it’s safer and needs less maintenance. Just try it!

Thanks! It indeed sounds like a nice workflow!

I was wondering because I cannot think of why the different input device would cause slowdown. Is it also slower when you use the pen to rotate the 3D view as opposed to using the mouse for that? If unsure you can show the FPS in the 3D view settings.

I also have no idea what is slowing down the pen. But it only happens in the paint or erase mode and not in draw! That’s what makes it so strange. You would think that everything would be affected.
Maybe there are more issues that I haven noticed because I also use the mouse and keyboard a lot. For rotating I normally use the mouse, I’ve tested it just now and that works ok.

What do you mean by “show the FPS in the 3D View setting”?

Only a few percent of Slicer users are on Linux and even less own a graphic tablet. Maybe you are the only Slicer user in the world who uses Linux AND a graphic tablet. If we find out what’s the root cause of the performance problem and there is a trivial fix then we can help. For example, I can imagine that the tablet generates too many events due to its higher resolution. Try to lower the resolution setting and see if performance is satisfactory then. If it is, then we might be able to add a filter that limits the events to the display resolution.

If we cannot find an easy solution, then you might need to switch to a bit more main-stream technologies: Windows or Mac OS instead of Linux; active pen instead of drawing tablet. We are improving Windows pen and touchscreen and Mac touchpad support (a big update is expected within a month). I’m not aware of any plans for improving tablet support.

I consider this as a compliment being “the only Slicer user in the world who uses Linux AND a graphic tablet”!
:slight_smile:

Thanks for your help for sofar. I will try to fix it by lowering the resolution (although I have to figure out how to do this).

About Linux not being main-stream:

  • Mac OS and Linux are both Unix-based.
  • Most servers in the world run on Linux (because of it’s stability and reliability)
  • Androïd is Linux.
  • There is Linux in your TV, car and many more things.

So Linux is there where you don’t expect it to be!
Just give it a change and I’m sure that at the end you’ll begin to like it.
:slight_smile:

I’ll Be Back!

I mean Linux desktop is a small niche. It is reflected in Slicer download counts, too.

I don’ t mind being part of a small niche. It give me the feeling of being special.

Just for your interest. I’m now in another Linux Distro and tried out Slicer again and also there I have the same problems with my graphic tablet. Guess I just have to learn to live with it and hope that maybe in future it will be resolved.

Thanks for your help anyway.

I mean turning this on:
image

Everything you reported points to the fact that updating the temporary labelmap when painting/erasing is what takes so long. So I don’t think FPS will be different but it’s worth a shot.

@lassoan might be right about the too many events. To verify this we could create a custom installer for you that will measure the number of events when painting and you could compare mouse and pen.
However if you can reduce the sampling resolution that might just solve the problem.

@Csaba.
Thanks. I will try if this will be of any help

@lassoan.
If found a simple workaround for my problem.
I’ll just ignore both the ‘paint’ and ‘erase’ tool and only focus myself on the ‘draw’ and ‘scissors’ tool.
With ‘draw’ I can sketch the path of my selection with pen (or mouse) and press enter to confirm and with the scissors tool I’ll draw my deselection path. Because I mostly work on the 2D planes, I just have to change the setting for the scissors to a symmetric slicecut at level 0,00mm, so that it only affects the plane I’m working on.
Simple but effective. :wink:

I just have an extra adjustment tip for the ‘draw’ tool.
Now you always have to confirm before the selection action takes place. I know that’s because you need to be able to build up the path by clicking on several points. You can also draw the path by clicking and holding the left mouse button, release it and then confirm, but wouldn’t it be a good idea to build in an extra option so that, when you release the LMB (or take the pen from the tablet) the selection is automatically confirmed. Saves an extra click.
I think that many user would appreciate this function.

Scissors effect can draw and erase in a slice and does not require confirmation by right-click, so you can use that instead of Draw effect.

I’ve added two experimental options to Paint and Erase effects that will probably solve your performance issue. You can set a minimum distance for mouse move events, so if your tablet generates many superfluous events, you can ignore them by setting the appropriate threshold. In addition to this, I’ve exposed a flag to enable/disable delayed paint, i.e., if you modify the segmentation immediately when you move the mouse or only when the moues button is released. This might make the performance worse, but if your computer is fast enough then you may get more rich immediate feedback during painting.

How to adjust these options? Download Slicer revision 28260 or later (should be available tomorrow). Open Python interactor (Ctrl+3) and copy-paste the code below. You can change the numbers to find a good combination that works the best for you.

paint=slicer.modules.segmenteditor.widgetRepresentation().self().editor.effectByName("Paint")
paint.delayedPaint=False
paint.minimumPaintPointDistance=3

If you find that changing these setting help then copy the code into your Slicer startup (.slicerrc) file.

1 Like

You’re great!

I’ll try it out tomorrow.

Sorry lassoan, you did your best but it didn’t solve my problem.
But don’t mind, I’ll just stick to my own solution for that works fine for me.

Regards,
Léon

Try setting paint.delayedPaint=True and use larger paint.minimumPaintPointDistance values (5, 10, 20, 30, …). You should see that less circles are drawn, so there should be no slowdown. Can you confirm that you observe this? As you increase the number, circles will noticeably jump, so the final value will be a trade-off between performance and size of these jumps.

If you have trouble tuning this then please record a few screen capture videos (and upload somewhere and post the link here) so that we can see what’s happening.

Lassoan,

Setting paint.delayedPaint=True and changing PaintPointDistance value to 20 enormously improves the paint function, but the erase function is uneffected (which means it’s still slow and lagging), so maybe we’re almost there.

But now I just discovered that the contrast/brightness setting with LMB doesn’t work in this nightly built version. I don’t know if this has something to do with your adjustments. To check if it was not due to the extra code I pasted in, I restarted Slicer, but also after this fresh restart the contrast/brightness adjustment isn’t working.
In version 4.10 though it works fine.

@Leon Review the following post regarding how contrast/brightness works in the recent Slicer nightly builds. It is now different compared to Slicer 4.10 Feedback requested: How to improve mouse interaction in views?

OK!
That’s a nice feature, thanks!

The example that I wrote is for the paint effect. Replace “Paint” by “Erase” to adjust erase effect parameters.

Did you eventually solve your problems? I am thinking about joining you in the small niche of Slicer users that want Linux AND graphic tablet.

Hi Andras - this link no longer works. I have now got a wacom tablet - i find the space shortcut particularly effective though would prefer if it was not the last 2 effects but just paint/erase, how can I add a few more, such as switching on/off scissors (switching back to None), enabling/disabling 3d and a useful threshold shortcut - i feel this would save me plenty of time?
Thanks

Here is the updated link: Segment editor — 3D Slicer documentation

You can create any number of keyboard shortcuts and connect them to any Slicer feature - see examples here. If you cannot figure out how to access a specific function from Python then you can ask here.

Some users complained about Wacom tablet performance in latest Slicer Preview Release. Do you see any performance issue? What tablet do you use on what operating system?