# Logical operators

**URL:** <https://discourse.slicer.org/t/logical-operators/17132>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [April 16, 2021, 1:26pm UTC](https://discourse.slicer.org/t/logical-operators/17132 "2021-04-16T13:26:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eileen](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@Eileen](https://discourse.slicer.org/u/Eileen)\
**Post date:** [April 16, 2021, 1:26pm UTC](https://discourse.slicer.org/t/logical-operators/17132/1 "2021-04-16T13:26:34Z")

</div>

logical operators do not work when i import self created models (created with inventor) as segmentations

---

<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:** [April 16, 2021, 1:41pm UTC](https://discourse.slicer.org/t/logical-operators/17132/2 "2021-04-16T13:41:43Z")

</div>

I think Logical Operators in the Segmentation module only work on segments. You need to convert your model to a segmentation node - in the Data module, right click on the model and select “Convert model to segmentation node”. Then you should be able to use logical operators.

---

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [April 16, 2021, 4:31pm UTC](https://discourse.slicer.org/t/logical-operators/17132/3 "2021-04-16T16:31:16Z")

</div>

In addtion to importing the models as segments you will need to select/create a master volume for the segment editor logical operators to work.

If you need only union, intersection and subtraction operations you can do that directly on models with the “combine models” module that you can install in the preview version of Slicer. (Install the sandbox extension and search for combine models module".

---

<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:** [April 16, 2021, 4:34pm UTC](https://discourse.slicer.org/t/logical-operators/17132/4 "2021-04-16T16:34:24Z")

</div>

Oh yeah, good point. I just downloaded CT Head and tried it to verify, so there was already a volume.

---

<div class="post-metadata">

**Author:** ![Eileen](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@Eileen](https://discourse.slicer.org/u/Eileen)\
**Post date:** [April 19, 2021, 6:38am UTC](https://discourse.slicer.org/t/logical-operators/17132/5 "2021-04-19T06:38:25Z")

</div>

Thanks for the replies. I converted or imported the model as segmentation. I have a Master Volume, which is always in preselection.  
When I convert the segmentation to a model and back to a segmentation the following message appears when using the logical operators.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/a/3aeb625228eac18aa1683c092715b45db7d4b994.png)

---

<div class="post-metadata">

**Author:** ![Eileen](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@Eileen](https://discourse.slicer.org/u/Eileen)\
**Post date:** [April 19, 2021, 6:41am UTC](https://discourse.slicer.org/t/logical-operators/17132/6 "2021-04-19T06:41:34Z")

</div>

The problem is that I can then unfortunately only use substract, but not add, for example. And the result of subtracting does not always look as desired. Instead of a “round” hole, a dalle is created.

---

<div class="post-metadata">

**Author:** ![chinaso1111](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@chinaso1111](https://discourse.slicer.org/u/chinaso1111)\
**Post date:** [May 31, 2023, 4:54am UTC](https://discourse.slicer.org/t/logical-operators/17132/7 "2023-05-31T04:54:23Z")

</div>

i try it ,and it works,  
thanks
