# Can't load dicom images generated by dcmtk

**URL:** https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338
**Category:** Support
**Tags:** dicom
**Created:** [June 27, 2019, 12:00pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338 "2019-06-27T12:00:19Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![pdeman](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@pdeman](https://discourse.slicer.org/u/pdeman)
#### Post date: [September 12, 2019, 1:58pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/21 "2019-09-12T13:58:40Z")

</div>

[quote=“lassoan, post:20, topic:7338”]  
Slicer’s Scalar volume DICOM reader plugin requires image geometry information defined by slice position and orientation tags.  
[/quote] and you can see them on the dcmdump that I posted.

they are present. as I said,

> self.targetCorners  
> read from the dicom header in this python script are correct.

if I transform the dicom in nifti the transformation matrix is correct.

the problem comes from ```  
volumeNode.GetIJKToRASMatrix(ijkToRAS)

```auto

```

---

<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 12, 2019, 2:13pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/22 "2019-09-12T14:13:25Z")

</div>

Hi @pdeman - I’m sure we can sort this out - I don’t have much experience with OCT, but I agree with Andras we should be able to make a custom DICOMPlugin that handles the specifics of this data.

The existing ScalarVolume plugin delegates to ITK for dicom reading, since there are a lot of legacy issues handled by the dcmtk and gdcm readers, but they don’t handle OCT well either. Best is to write a new reader with pydicom that is aware of the needs of this use case.

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [September 12, 2019, 2:34pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/23 "2019-09-12T14:34:23Z")

</div>

> [@pdeman](#):
>
> how can I know which sop class uid are managed by slicer ?

I think this is a good point. You cannot. I think we should have a resource that lists which SOP class UIDs are supported, and which extensions are needed when this capability is not available in the main application.

---

<div class="post-metadata">

### Author: ![pdeman](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@pdeman](https://discourse.slicer.org/u/pdeman)
#### Post date: [September 16, 2019, 7:13am UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/24 "2019-09-16T07:13:40Z")

</div>

but in dicomscalarplugin,  
if the geometry from the dicom header read in self.targetCorners is correct,  
but different from the geometry in self.originalCorners isn’t it possible to “force” to use the geometry read in self.targetCorners?

---

<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 16, 2019, 2:59pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/25 "2019-09-16T14:59:28Z")

</div>

Hi -

I don’t know the OCT use case, but the geometry correction code is used for missing slices or sheared slice planes. Do either of these come up in OCT? I still think the best bet is to put the data in a preferred dicom instance and then write a slicer dicom plugin to handle it directly.

---

<div class="post-metadata">

### Author: ![pdeman](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@pdeman](https://discourse.slicer.org/u/pdeman)
#### Post date: [September 17, 2019, 8:24am UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/26 "2019-09-17T08:24:28Z")

</div>

no it doesn’t occur in OCT. at least I have never seen that.  
I don’t think that modifying the dicom sop class uid one generated dicom, especially to put an sop class uid which is not the correct one, is a good idea.

---

<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 17, 2019, 4:15pm UTC](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338/27 "2019-09-17T16:15:49Z")

</div>

> [@pdeman](#):
>
> I don’t think that modifying the dicom sop class uid one generated dicom, especially to put an sop class uid which is not the correct one, is a good idea.

Hmm, I don’t think we’re communicating well. I’m suggesting you find the correct DICOM encoding of your data and then we figure out the best way to read that in Slicer (probably through a custom plugin that understands that SOP class). Is there a standard SOP class for the data you have?

[Previous page](https://discourse.slicer.org/t/cant-load-dicom-images-generated-by-dcmtk/7338.md?page=1)
