# Rendering Performance with Large number of slab slices

**URL:** https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351
**Category:** Development
**Created:** [September 9, 2019, 10:01pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351 "2019-09-09T22:01:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)
#### Post date: [September 9, 2019, 10:01pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/1 "2019-09-09T22:01:29Z")

</div>

I have a volume with 512x512,313 dimensions.

I have enabled reslice driver for tracking of a needle. The reslice rendering performance is quite good when I am navigating on only once slice at a time. However when I set the slab thickness to around 75 and have a spacing fraction of 5 I see a huge slowdown to about 1fps. Is this normal? I am seeing that my computer is being CPU limited. I have a i7 with 1.9ghz speed.

---

<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: [September 9, 2019, 10:17pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/2 "2019-09-09T22:17:46Z")

</div>

Yes, I would say that sounds normal. You might want to change to using GPU volume rendering instead (unfortunately it’s a very different pipeline so you’d probably need to change the way you do things).

---

<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 9, 2019, 11:44pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/3 "2019-09-09T23:44:34Z")

</div>

Yes, this performance is expected if you use CPU for raycasting.

See instructions in this post how to configure the GPU volume renderer to create projection image: [Is it possible to change a cbct to 2d](https://discourse.slicer.org/t/is-it-possible-to-change-a-cbct-to-2d/7617)

If you want to limit the slab to a certain thickness then set the volume rendering clipping ROI’s Z size to the desired thickness and then apply the SlicerToRAS transform of the slice view to this ROI.

---

<div class="post-metadata">

### Author: ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)
#### Post date: [September 10, 2019, 4:19pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/4 "2019-09-10T16:19:32Z")

</div>

Thanks for the responses. I used the 3d view and followed the steps as Iassoan linked with some tweaks for the scan I have. It does seem to be much more responsive.

To set the view I set the camera focal point to the center of my volume and then I offset the camera position to a position above the focal point to get a Coronal image of the scan. This seems to work ok. Although the FOV isnt currently applicable to an volume since I set the distance manually.

Im a little confused about the last suggestion

> [@lassoan](#):
>
> If you want to limit the slab to a certain thickness then set the volume rendering clipping ROI’s Z size to the desired thickness and then apply the SlicerToRAS transform of the slice view to this ROI.

I’m not using a slice view. Are you suggesting that I can place a volume render in a slice view window?

---

<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 10, 2019, 5:09pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/5 "2019-09-10T17:09:55Z")

</div>

> [@burnhamd](#):
>
> I’m not using a slice view. Are you suggesting that I can place a volume render in a slice view window?

If the axes of the thick slab is aligned with anatomical axes then you don’t need a transform, you can just set the center and size of the ROI to define the slab.

If you want to show an oblique slab then you need to create a transform to position/orient your ROI node. If you use slice views, you can set this transform by copying the position/orientation of an oblique slice view.

---

<div class="post-metadata">

### Author: ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)
#### Post date: [September 10, 2019, 6:21pm UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/6 "2019-09-10T18:21:45Z")

</div>

Sorry for being dense 😆

I understand I need to get a transform if I want a arbitrary slice angle/oblique view. What I dont understand is how to get a volume render to display in a slice view. Is that what you are suggesting?

---

<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 11, 2019, 1:01am UTC](https://discourse.slicer.org/t/rendering-performance-with-large-number-of-slab-slices/8351/7 "2019-09-11T01:01:25Z")

</div>

> [@burnhamd](#):
>
> What I dont understand is how to get a volume render to display in a slice view. Is that what you are suggesting?

I’m not suggesting to display a volume rendered image in a slice view. If you need that then you need to implement it yourself (grab the image from the 3D view, put it into a single-slice volume, and show that volume in a slice view).
