# Limiting DTI computation to a masked region, axis re-oreintaton

**URL:** <https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040>\
**Category:** Support\
**Created:** [November 2, 2022, 4:47pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040 "2022-11-02T16:47:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ron/32/10835_2.png) [@Ron](https://discourse.slicer.org/u/Ron)\
**Post date:** [November 2, 2022, 4:47pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/1 "2022-11-02T16:47:30Z")

</div>

To all,

1. I am trying to limit the computation of the DTI data to a masked region (created using the segment editor) within the volume (in this case a human disc). For reference, I am trying to remove the green regions around the disc.  
 ![Master Scene View](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/b/fb169f0e83b32e1ac94e0000aeec740a409797de.jpeg)
2. How would re-Oriente the imaging planes ( green and yellow) windows to better match the disc anatomical axes  
 ![Imaging axes](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/b/eb21d27d3f6779ac6e5b339a8a519a7131e1214d.jpeg)  
Thank you, Ron

---

<div class="post-metadata">

**Author:** ![Ron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ron/32/10835_2.png) [@Ron](https://discourse.slicer.org/u/Ron)\
**Post date:** [November 3, 2022, 5:36pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/2 "2022-11-03T17:36:12Z")

</div>

@lassoan  
Andras hi, could ask for your help with the first issue? I hope to present next week, and it would be very helpful to be able to segment out all the data outside the disc segmentation. I think there used to be an option to use the segment label to restrict the region of DTI reconstruction. However, I cannot find a way to do so (only option is brain label?). Happy to share the slicer file. R

---

<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:** [November 3, 2022, 5:42pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/3 "2022-11-03T17:42:11Z")

</div>

> [@Ron](#):
>
> I am trying to limit the computation of the DTI data to a masked region

You can use “Mask volume” effect in Segment Editor to blank out voxels of a volume outside the current segment. Would that be sufficient for you?

> [@Ron](#):
>
> How would re-Oriente the imaging planes ( green and yellow) windows to better match the disc anatomical axes

You can use Crop volume module for this. You can enable rotation for the region of interest (by right-clicking on any of its control point and in check “Interaction options” → “Rotate”.

---

<div class="post-metadata">

**Author:** ![Ron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ron/32/10835_2.png) [@Ron](https://discourse.slicer.org/u/Ron)\
**Post date:** [November 3, 2022, 5:43pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/4 "2022-11-03T17:43:41Z")

</div>

I hope so, I will try this now. Steve is also looking into this.

---

<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:** [November 3, 2022, 5:59pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/5 "2022-11-03T17:59:05Z")

</div>

Trying to mask a DTI volume with the segment editor led to a crash (maybe not a surprise but still not good).

This method works after exporting the segmentation to a label:

```auto
>>> d = array("Output DTI*e")
>>> m = array("11-9001-pre_load-Segmentation-label")
>>> d[numpy.where(m != 1)] = numpy.zeros([3,3])

```

I’ll make new nrrd dti files for you Ron.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/2/426e655f1e7b2c37ff703611a286c76c0823fcd1.jpeg)

---

<div class="post-metadata">

**Author:** ![Ron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ron/32/10835_2.png) [@Ron](https://discourse.slicer.org/u/Ron)\
**Post date:** [November 3, 2022, 6:02pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/6 "2022-11-03T18:02:55Z")

</div>

Steve Thanks!!!

Ron Noah Alkalay is inviting you to a scheduled Zoom meeting.

Topic: My Meeting  
Time: Nov 3, 2022 02:00 PM Eastern Time (US and Canada)

Join Zoom meeting

> **[Join our Cloud HD Video Meeting](https://harvard.zoom.us/j/91785507313?pwd=ZThhc0hoSWpFYkc1WjBraE04OHlLQT09)**
>
> Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference...

Password: 898459

Join by telephone (use any number to dial in)  
+1 312 626 6799  
+1 646 931 3860  
+1 929 436 2866  
+1 301 715 8592  
+1 309 205 3325  
+1 669 900 6833  
+1 689 278 1000  
+1 719 359 4580  
+1 253 215 8782  
+1 346 248 7799  
+1 360 209 5623  
+1 386 347 5053  
+1 507 473 4847  
+1 564 217 2000  
+1 669 444 9171

International numbers available: [Zoom International Dial-in Numbers - Zoom](https://harvard.zoom.us/u/adf8DddVEX)

One tap mobile: +13126266799,91785507313# US (Chicago)

Join by SIP conference room system  
Meeting ID: 917 8550 7313  
[91785507313.898459@zoomcrc.com](mailto:91785507313.898459@zoomcrc.com)

Ron N Alkalay  
Associate Professor,  
Dept of Orthopedic Surgery, Harvard Medical School  
Center for Advanced  
Orthopedic Studies  
Beth Israel  
Deaconess Medical Center  
1 Overland Street  
Boston, MA, 02215  
Tel. 617-667-5185  
Fax. 617-667-7175  
email:  
rn\_alkalay@bidmc.harvard.edu

---

<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:** [November 3, 2022, 6:38pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/7 "2022-11-03T18:38:40Z")

</div>

Thanks for your help with this @lassoan. I showed @Ron how to do the numpy approach so he’s set now.

---

<div class="post-metadata">

**Author:** ![Ron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ron/32/10835_2.png) [@Ron](https://discourse.slicer.org/u/Ron)\
**Post date:** [November 3, 2022, 7:11pm UTC](https://discourse.slicer.org/t/limiting-dti-computation-to-a-masked-region-axis-re-oreintaton/26040/8 "2022-11-03T19:11:30Z")

</div>

![Full spine hi-res-oreintation map](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/7/57ef0c39043f20087191876c8ab50c0c1d6a6c87.jpeg)  
:)!
