How to adjust the distorted image?

For nii files I think you should just resample the image, for example using Crop volume module.

Hi doc-xie -

If you have the original dicom, you can look for the Gantry Tilt header (0018,1120) but it’s not a required tag so your data may not have it [1]. If you know the tilt you can make linear transform to correct the shear. If you don’t know the tilt exactly you could probably estimate visually, maybe by looking at the table. Do you know how do this? If not we can give instructions.

The solution I added to the DICOM module looks at the image positions at each slice, which are required by the standard, and creates a nonlinear transform that fixes the tilt and also handles a few other situations like missing slices. But it really only works on the original DICOM objects, not on data that’s been converted to nifti.

Best,
Steve

[1] http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.8.2

@doc-xie Do you have a nifti file that has shear in its image header?

Thanks a lot,Professor Steve!
I am so sorry,after I transform the .nii file to original format,the data have not the Gantry Tilt and I do not know how to recognize it.
Would you like give me the instructions?
Otherwise,the link you give me can not be opened correctly.
Best,
Doc-xie

Yes,Professor Lassoan!
My distored images have not be adjusted correctly,so the problem confused me for a long time.
I can send the data to you if need,
Thanks!
Doc-xie

If you have old data that you imported earlier versions of Slicer or other software that cannot handle gantry tilt then there is not much you can do. Probably you have to discard the nii files and go back and reimport them from DICOM and probably resample the volume if you need the volume on a rectilinear grid.

Thanks a lot,Professor Lassoan!
After I import the original data,the value of the Gantry Tilt is 20.9. So what we know from this is the data transformed from .nii file can not be used again,especially to be adjusted for disformation. About the Gantry Tilt,what should I do in the next?
Best wishes!
Doc-xie

The Gantry Tilt angle DICOM tag is for display purposes only. Accurate slice positions are defined by the slice position and axis directions DICOM tags. You may be able to compute an approximate transformation matrix from the Gantry Tilt tag, but it won’t be completely accurate (angle is rounded to one decimal, so you may get up to a few pixel error) and you may need some experimentation to get the rotation axis and direction right. Therefore, I would recommend to re-import the images from DICOM with a recent nightly version of Slicer (that computes the accurate image acquisition transformation matrix).

Thanks you very much!
The version of 3D Slicer I used is new Nightly(2017-10-22),need I download some extensions for this transformation?
If I finish adjustment with Transform module,which value should to be corrected?
Would you like show me the specific steps because I am a new learner?:smile::smile:
Best,
doc-xie

Hi doc-xie -

The gantry tilt is a shear transform along the scan axis, which can be described with an off-diagonal entry in an otherwise identity linear transform. I just tried this on the case Andras shared with me, so it should work for your case too. I confirmed that at least visually this gives identical results to the DICOM-based approach (using the image position and orientation tags) that is in the current Nightly builds.

The basic steps are:

  1. calculate the sine of the tilt angle. In my case, tag 0018,1120 was -8.5, so in the python console I typed:
import math
math.sin(math.radians(-8.5))

which gave the answer -0.14780941112961063

  1. In the transforms module I created a linear transform and applied it to the CT

  2. in the second row of the third column I changed the number from 0 to -.15

And it looks good.

The rationale for this from a linear algebra point of view is that the second row third column controls how the Anterior coordinate changes as a function of the Superior direction. Here it’s saying that for each mm increment anteriorly, the image data should be shifted back by .15 mm.

Visually, here is the volume without the transform:

And here it is with the transform:

And for reference here is the same data loaded in the Nightly build where the transform came from the DICOM directly.

Let me know if this doesn’t work for you - we want to get all these coordinate mappings correct!

Best,
Steve

1 Like

Follow up: comparing closely between the gantry tilt shear matrix method described above and the dicom image position/orientation method from the nightly I still see some residual differences (possibly the kinds of errors Andras mentioined). I’m pretty sure the dicom method in the Nightly is correct but be very careful making any measurements on gantry tilted data.

Thank you for your detailed introduction,I will try it.
Best wishes!
Doc-xie!

The problem has been solved successfully with your advice!
Thanks a lot!
Have a good weekend!
Doc-die.

Hello,Steve!
A very intresting problem about the transform module.
When I check a normal brain CT scan(Fig 1),


the gantry tilt is 24.6(Fig 2),
so after i changed the Transform Matrix,the coronal view displayed unnormally and the 3D view distored obviously(Fig 3).

What is the reason about this and whether the Value of the GantryDetectorTilt is right?
Best wished!
Doc-xie

As we explained before, GantryDetectionTilt field indicates that the image was acquired with gantry tilt, but it is not to be used for determining the image geometry. For example, it may be possible that the CT scanner saves the image as a Cartesian volume. The image transformation mechanism that is available in recent nightly versions does not use GantryDetectionTilt field and should handle all cases correctly regardless the volume is saved as a sheared or a Cartesian volume.

Thaks,Professor Lassoan.
But how to estimate the deformation degree of the volume and how to adjust the distorted image in recent nightly version correctly?
Doc-xie

Hi Doc-xie -

Did you try importing and loading the dicom files through the dicom module? This should automatically create the nonlinear transform based on the per-slice geometry. It would be good know if this works for your data - it is a much simpler process.

Best,
Steve

1 Like

Thanks a lot!
What I want to know is whether I should check every Gantry tilt of every volume in order to estimate the deformation degreee,or the value of the Gantry tilt can be shown automatically?Another question,does the value of the Gantry tilt should be adjusted for the reconstruction correctly?
Best wishes!
Doc xie

Hi everyone,

I am pretty new working with 3D slicer, but I use to work with Mimics (I was using it since 2005), so please be patient…

I have a lot of distorsion with my dicom data, I can see perfectly well in axial view but the image is complete distorted in sagittal and coronal view, it is like some kind of unit problem. But I do not know how to fix it. There is no tilt in effect. They seem to be very wide… I was having a look to the dicom parameters but they look ok to me.

I hope you can help me

These are the DICOM image parameters

Study Date: 20100801
Acquisition Date: 20100801
Image Date: 20100801
Study Time: 103821
Acquisition Time: 104048
Image Time: 104050.398998
Accession Number: 0006050
Modality: CT
Manufacturer: Philips
Institution Name: APHP.Pitie PrGRENIER
Institution Address: PARIS 13
Refering Physician’s Name: DR HUYNH
Station Name: HOST-200029
Study Description:
Series Description: OS
Institutional Dept. Name: RADIOLOGIE
Manufacturer’s Model Name: iCT 128
Patient Name: MEMBRE SUP^ANCIEN
Patient Date of Birth: 20000101
Patient Sex: O
Scan Options: HELIX
Slice Thickness: 1.00
KVP: 140
Spacing Between Slices: 0.5
Data Collection Diameter: 500
Software Version: 3.0.1
Protocol Name: EPAULE/Orthoped
Reconstruction Diameter: 269
Gantry/Detector Tilt: 0
Table Height: 51.000000
Rotation Direction: CW
X-ray Tube Current: 99
Exposure: 351
Filter Type: F
Convolution Kernel: F
Patient Position: HFS
Study Instance UID: 1.2.840.113704.1.111.3252.1280651812.6
Series Instance UID: 1.2.276.0.45.45.2.51.3.23084206062387.20131211.112340001
Study ID: 7185
Series Number: 2
Image Number: 0
Image Position Patient: -100.174\111.531\214.8
Image Orientation Patient: 1\0\0\0\1\0
Frame of Reference UID: 1.2.840.113704.1.111.3040.1280651919.3
Slice Location: 5.80
Photometric Interpretation: MONOCHROME2
Pixel Spacing: 0.35026\0.35026
Window Center: 00600\00600
Window Width: 02000\02000

It should have to be something like this other image I am sending to you. Can you see the difference? Bone are thinner

If I can fix this “little” things and I would like to teach my students who to work with 3dslicer.

Hello!
The problem is the same with me.The value of the Gantry/Detector Tilt is 0,but the image is distorted, what is the reason about this? How to estimate the deformation degree?
If we want to adjust the distorted image,which value can be referenced to?
Best wishes!
Doc-xie