# How to adjust the distorted image?

**URL:** <https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817>\
**Category:** Support\
**Created:** [August 3, 2017, 5:15pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817 "2017-08-03T17:15:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [August 3, 2017, 5:15pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/1 "2017-08-03T17:15:34Z")

</div>

Hi!  
After the data was loaded into 3D Slicer,the axinal and coronal view display normally,but the saggital view was distored.  
I cannot understand the reason about this problem,furthermore,whether it is possible the problem happened to axinal or

 ![无标题](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c7f5851babf6a95f9a0725a870a89da51ae691d2.jpeg) coronal view and how to adjust the distorted image?  
Thanks!

---

<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:** [August 3, 2017, 5:29pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/2 "2017-08-03T17:29:05Z")

</div>

Was the volume acquired with tilted gantry?

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [August 4, 2017, 2:55am UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/3 "2017-08-04T02:55:34Z")

</div>

Sorry, I don’t know.The data of DICOM format was acquired through PACS (Picture archiving and communication system) and I have never met this problem before. So I consult with image doctor of our hospital, he have no idea about this too. The 3D Slicer is so powerful, so I think this problem could be solved with “reform” or “transform” module, but the result is failed.

---

<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:** [August 4, 2017, 3:50am UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/4 "2017-08-04T03:50:34Z")

</div>

We should be able to address this in Slicer, but we need some more information.

Install the latest nightly version of Slicer and follow these steps to collect the necessary information:

1. Open the DICOM popup
2. Select the CT image
3. Click `Metadata` button
4. Enter `tilt` in the search box
5. Click `Copy metadata` button
6. Paste the gantry tilt value in your response message here

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/a/aaa60689d5a7c429f8b4c28823fc3bf6dd03967e.png)

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [August 5, 2017, 1:23am UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/5 "2017-08-05T01:23:53Z")

</div>

The value of gantry tilt is 20.9,what should i do next?

---

<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:** [August 5, 2017, 2:05am UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/6 "2017-08-05T02:05:04Z")

</div>

We are working on a solution, probably will be ready in 1-2 weeks. You can monitor the status here: [https://issues.slicer.org/view.php?id=4409](https://issues.slicer.org/view.php?id=4409)

If you need a solution now then you can use a DICOM converter that supports gantry-tilted images, for example [dicomtonifti](https://github.com/dgobbi/vtk-dicom/wiki/dicomtonifti). Download from here: [https://github.com/dgobbi/vtk-dicom/releases](https://github.com/dgobbi/vtk-dicom/releases)

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [August 5, 2017, 2:32pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/7 "2017-08-05T14:32:49Z")

</div>

Thank you very very much,professor lassoan!

---

<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:** [October 12, 2017, 8:09pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/8 "2017-10-12T20:09:54Z")

</div>

I implemented a fix that should work for the gantry tilt data, but I don’t have a sharable dataset for testing.

> <https://github.com/Slicer/Slicer/issues/812>
>
> This issue was created automatically from an original Mantis Issue. Further discussion may take place here.

I’ll try to acquire images of a phantom but if anyone has data they can share that would save the trouble.

For the record on discussion with colleagues we determined that a good phantom dataset for testing would include:

- a phantom with clearly marked up/down/left/right/front/back
- data acquired prone and supine
- slices acquired head first and foot first
- data acquired with gantry tilt
- data acquired with skips and/or variable table speed
- use of different reconstructions (e.g. spiral data at 3mm and the same data at 5mm)
- saved raw data for later reconstruction as needed

If I’m able to time on a scanner and help from a tech I’ll try to acquire these and make them public on midas.

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 17, 2017, 12:34pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/9 "2017-10-17T12:34:01Z")

</div>

Hello Steve,I have the distorted image in dicom format.But how can I share the data with you?

---

<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:** [October 17, 2017, 1:41pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/10 "2017-10-17T13:41:16Z")

</div>

Hi doc-xie -

@lassoan was able to share some sample data with me for testing so after a few tweaks yesterday the new code linked above appears to be working. It will be good for you to test it too with your data once we get it into a build of the application, which should be available in a day or two.

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 17, 2017, 2:28pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/11 "2017-10-17T14:28:50Z")

</div>

Thanks Steve!  
I will be keeping eyes on your achievements all the time,the problem has confused me for a long time.  
Good luck!  
doc-xie!

---

<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:** [October 17, 2017, 3:59pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/12 "2017-10-17T15:59:31Z")

</div>

Thanks for the encouragement! 😄 Yes, I’ve been wanting to fix gantry tilted volume handling in Slicer for a long time too.

Since the the code is still new and relatively untested, @lassoan, @jcfr and I decided not to include it in the 4.8 release but will put it in the Nightly build after the release builds are made.

Best,  
Steve

---

<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:** [October 20, 2017, 9:40pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/13 "2017-10-20T21:40:17Z")

</div>

The pull request was merged today so it should show up in Nightly builds tomorrow. Would be good to know if it works for your data @doc-xie. Have a great weekend ☀

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 22, 2017, 2:31pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/14 "2017-10-22T14:31:42Z")

</div>

Good job!Thanks you very much,Steve!  
Would you like tell the the details about the steps?In other words,what should I do after I setup the new Nightly builds or is there any extentions should be downloaded?  
Best wishes!  
doc-xie

---

<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:** [October 22, 2017, 11:34pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/15 "2017-10-22T23:34:41Z")

</div>

Hi doc-xie -

No special steps should be required, just importing into the DICOM module and then if there’s a gantry tilt detected the loaded volume will be put inside of a grid transform that straightens it out. Of course I’ve only tried this with a few datasets so let us know how it goes for you.

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 23, 2017, 2:00pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/16 "2017-10-23T14:00:42Z")

</div>

Ok!Steve:smile:  
Another question,if the data is in .nii format,how to adjust the distorted image?  
Thanks!

---

<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:** [October 23, 2017, 2:19pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/17 "2017-10-23T14:19:20Z")

</div>

Ah, sorry, the solution I implemented only work with DICOM because that’s where the original image geometry information is available. I’m not sure there is a good solution for nii files unless you know the gantry tilt angle and can manually construct a shear matrix to correct it.

-Steve

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 23, 2017, 2:23pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/18 "2017-10-23T14:23:19Z")

</div>

Thanks for your quick answer!  
But where can I find the gantry tilt in the menu?Is it in the Metadata,and I shoul search it with word"tilt" ?  
Best,  
doc-xie!

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 23, 2017, 2:25pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/19 "2017-10-23T14:25:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/5/95291887cc3988728f3d888b3929b1acd501917b.png)  
The value of the gantry tilt has not been shown in the interface!

---

<div class="post-metadata">

**Author:** ![doc-xie](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@doc-xie](https://discourse.slicer.org/u/doc-xie)\
**Post date:** [October 23, 2017, 2:27pm UTC](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/20 "2017-10-23T14:27:52Z")

</div>

This is the original image of the volume

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/13d97186b0c9829c44dc72504728ee742c92361d.png)

[Next page](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817.md?page=2)
