# Change Opacity of Parts of a Model

**URL:** <https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670>\
**Category:** Support\
**Created:** [September 23, 2020, 2:14pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670 "2020-09-23T14:14:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 2:14pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/1 "2020-09-23T14:14:43Z")

</div>

I’m trying to adjust the opacity of everything but a small range of intensities on a 3d model made of MRI slices. It’s a .nii.gz file. I have one small part of my images that is intensity ~8000 and everything else is around 200-400. I’m very new to slicer.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 23, 2020, 2:19pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/2 "2020-09-23T14:19:27Z")

</div>

Thanks for creating the new topic! However, I don’t know much more than before.

First things first:

- What is your _overall_ goal?
- What do you mean exactly by “3d model made of MRI slices”?

---

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 2:26pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/3 "2020-09-23T14:26:15Z")

</div>

The eventual goal is to create a 3d model of a brain where you can see through the outer layers to visualize a specific highlighted area on the interior. I have a set of 2D MRI slices where the specific interior area is already highlighted by having a much greater intensity, so now I think I just need to make all other intensities have a lower opacity.

The issue is when I export the MRI slices to a 3D model, it just gives me a model of the outer surface of the brain, whereas I need to be able to see inside while still having the outer layer semi-visible.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 23, 2020, 2:29pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/4 "2020-09-23T14:29:44Z")

</div>

> [@CB1](#):
>
> export the MRI slices to a 3D model

I’m sorry but I’m completely lost at what you mean by 3D model here. In Slicer we have Segmentations, Models, Volume rendering… Can you describe what tool you use to create this “3D model”?

---

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 2:34pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/5 "2020-09-23T14:34:34Z")

</div>

I’m trying to create a 3D model of a brain. The file format is .nii.gz, which can be exported to a 3D model using various programs (I used the program mipav). But that should be the easier part for me… What I’m asking is more about changing the opacity of specific sections of an MRI.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 23, 2020, 2:40pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/6 "2020-09-23T14:40:25Z")

</div>

Please look at this page: [https://slicer.readthedocs.io/en/latest/user\_guide/data\_loading\_and\_saving.html](https://slicer.readthedocs.io/en/latest/user_guide/data_loading_and_saving.html)

Which data type is your “3D model”? Without giving us enough information to understand your question we cannot help you.

---

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 2:57pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/7 "2020-09-23T14:57:01Z")

</div>

The eventual 3D model is a .ply, but that was generated using a different program. The MRI volume can be initially loaded into slicer as a .nii.gz or DICOM. What other information do you need?

---

<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:** [September 23, 2020, 3:02pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/8 "2020-09-23T15:02:26Z")

</div>

If you want to make certain intensity range visible and others transparent then you can do it using volume rendering module, by editing Advanced / Volume properties / Scalar opacity mapping function accordingly.

Alternatively, you can segment each region using Segment Editor module, Threshold effect. You can adjust opacity of each segment separately in Segmentations module / Display / Advanced section.

---

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 3:09pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/9 "2020-09-23T15:09:35Z")

</div>

That sounds like exactly what I want. What specifically would I have to do to make everything with intensity \<8000 have opacity of .5? I see the opacity slider but I’m not sure how to affect only certain intensity ranges.

---

<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:** [September 23, 2020, 3:10pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/10 "2020-09-23T15:10:25Z")

</div>

Which method are you planning to try? Volume rendering or segmentation?

---

<div class="post-metadata">

**Author:** ![CB1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cb1/32/6511_2.png) [@CB1](https://discourse.slicer.org/u/CB1)\
**Post date:** [September 23, 2020, 3:12pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/11 "2020-09-23T15:12:28Z")

</div>

I was planning on volume rendering, but whichever is simpler is best.

---

<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:** [September 23, 2020, 3:27pm UTC](https://discourse.slicer.org/t/change-opacity-of-parts-of-a-model/13670/12 "2020-09-23T15:27:30Z")

</div>

If you only need visualization then volume rendering is fine. You can start from a preset by selecting a preset and use “Shift” slider (optional, as you can just start from the default transfer functions, too). Then click on the “Scalar Opacity Mapping” function line to add points and click-and-drag points to move them to achieve the intensity-\>opacity mapping you want.
