# Other brush shapes for paint effect

**URL:** <https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147>\
**Category:** Feature requests\
**Tags:** segmentation\
**Created:** [June 22, 2020, 4:54am UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147 "2020-06-22T04:54:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 22, 2020, 4:54am UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/1 "2020-06-22T04:54:30Z")

</div>

I am trying to measure trabecular bone properties from different regions of mouse proximal and distal femur epiphyses. Paint brush, with sphere brush enabled, works really well to draw a region of specific diameter. Then on, I can potnetially use the bone texture extension to calculate what we need.

For various reasons, we also need to do this as cubes. Would it be possible to implement other brush effects (particularly square and cube in 3D), that works like the current round brush? Right now I am using `CreateModel` from SlicerIGT to generate a cube of arbitrary dimensions, and then put it under transform to move it to specific region of the volume that I want to measure, and then convert to a segmentation. It gets a bit tedious.

---

<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:** [June 22, 2020, 3:41pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/2 "2020-06-22T15:41:02Z")

</div>

It wouldn’t be too hard to add a cube brush option to the code, but I’m not sure how generally useful it would be and whether it’s worth exposing it in the interface. If this is a one-off use case it might be easier to do a little script that paints a cube based on a hot key?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 22, 2020, 4:02pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/3 "2020-06-22T16:02:11Z")

</div>

That will be fine, but the cube edges needs to be of variable size too…

---

<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:** [June 22, 2020, 4:14pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/4 "2020-06-22T16:14:49Z")

</div>

You could add a “Fill ROI” effect, which could fill or clear the an area in a segment specified by an ROI node.

---

<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:** [June 22, 2020, 4:31pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/5 "2020-06-22T16:31:05Z")

</div>

Yes, that’s what I was thinking too - @muratmaga would that be easier than what you are doing now?

What about something where a hot key fills in an ROI?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 22, 2020, 4:39pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/6 "2020-06-22T16:39:22Z")

</div>

If we are talking about the regular annotation ROI boxes, that wouldn’t work for me very well, as it is not trivial to specify where to create them (or set a fix dimension).  
CreateModels work nice, expect it just randomly places the cube somewhere in the scene (as far as I can tell).

---

<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:** [June 22, 2020, 4:56pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/7 "2020-06-22T16:56:31Z")

</div>

> [@muratmaga](#):
>
> If we are talking about the regular annotation ROI boxes, that wouldn’t work for me very well, as it is not trivial to specify where to create them (or set a fix dimension).

You would add all controls that you need to the effect’s GUI (position, size, etc.).

Annotation ROI will be replaced by Markups ROI, so it might make sense to wait a few months for this to happen (or work on Markups ROI implementation to make it happen sooner).

> [@muratmaga](#):
>
> CreateModels work nice, expect it just randomly places the cube somewhere in the scene

CreateModels puts models in the RAS coordinate system origin, so that you can set their position and orientation using a transform.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 22, 2020, 5:01pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/8 "2020-06-22T17:01:50Z")

</div>

It think fillROI with the new markupsROI would be good to have. I will continue using the CreateModels, till then.

---

<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:** [June 22, 2020, 5:51pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/9 "2020-06-22T17:51:09Z")

</div>

`CreateModels` probably just puts it at the origin, but it could be trivial to make it show up where your mouse is.

---

<div class="post-metadata">

**Author:** ![Raj\_Kumar\_Ranabhat](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/raj_kumar_ranabhat/32/9857_2.png) [@Raj\_Kumar\_Ranabhat](https://discourse.slicer.org/u/Raj_Kumar_Ranabhat)\
**Post date:** [May 11, 2021, 5:42pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/10 "2021-05-11T17:42:47Z")

</div>

@muratmaga : Hi, how you were implementing cube model instead of sphere brush ? Can you please share the python scripts if available ? Did you make a change in code of paint effect.py ?

Please feel free to write.

Thanks

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 11, 2021, 7:02pm UTC](https://discourse.slicer.org/t/other-brush-shapes-for-paint-effect/12147/11 "2021-05-11T19:02:34Z")

</div>

I didn’t implement anything. Ended up using cube primitive from CreateModels of converting them to segmentation. but if someone implements the FillROI as a segment editor effect, I think it would be useful in general.
