# Batch editing of 3DAngio CBCT slice thickness dicom tag

**URL:** <https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576>\
**Category:** Support\
**Created:** [June 3, 2024, 3:24pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576 "2024-06-03T15:24:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rruo](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rruo](https://discourse.slicer.org/u/rruo)\
**Post date:** [June 3, 2024, 3:24pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/1 "2024-06-03T15:24:26Z")

</div>

Hello, we have a cbct slices from a 3d angiography system but all the slices have the same slice location. Is there a way to batch process and edit the slice location in Slicer? there are 512 images and the location would be incremented by 0.3mm. Thank you for the information.

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

---

<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:** [June 3, 2024, 3:30pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/2 "2024-06-03T15:30:02Z")

</div>

There is no need to edit `slice thickness` or `slice location` tags. These tags must not be taken into account for reconstructing a 3D volume from slices. Only “image position patient” and “image orientation patient” tags matter.

If the tags are missing then it may be because the image is not intended for 3D reconstruction (you could have a look if tyou can export the image in a different way) or the image could have been corrupted by some post-processing (e.g., anonymization or processing in some other software; you can try skipping these steps to confirm that this is the issue).

---

<div class="post-metadata">

**Author:** ![rruo](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rruo](https://discourse.slicer.org/u/rruo)\
**Post date:** [June 4, 2024, 12:01pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/3 "2024-06-04T12:01:53Z")

</div>

> [@lassoan](#):
>
> image position patient

Thank you for the reply!

Yes we have both of the tags you mentioned

(0020,0032) Image Position Patient DS 3 String [0.0, 0.0, 0.0]  
(0020,0037) Image Orientation Patient DS 6 String [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]

The original files are taken from an older 3d angio system. The current software version does not prepare 3d ct volumes which we would like to use for aiding with contouring in avm cases. It only puts out ‘photos’ or screencaptures of the 3d volume slices. But the manufacturer was able to give us the raw 512 image slice set.

But each individual slice/file has the exact same ‘location’ in the ‘z’ value. I thought this would be the issue for our TPS not being able to construct a 3d volume from the series.

Do you have any suggestion on how we would be able to produce a 3d ct set from these slices?

Thanks for any info you have.

---

<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:** [June 4, 2024, 1:44pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/4 "2024-06-04T13:44:54Z")

</div>

You can use the DICOM patcher in Slicer for setting Image Position Patient values if you know the spacing. You may be able to use the “Generate slice position for multi-frame volumes” rule or create a new rule similat to it:

> <https://github.com/Slicer/Slicer/blob/acf3dd47940665869765584564b38439f73ff1d5/Modules/Scripted/DICOMPatcher/DICOMPatcher.py#L410-L485>

---

<div class="post-metadata">

**Author:** ![rruo](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rruo](https://discourse.slicer.org/u/rruo)\
**Post date:** [June 10, 2024, 5:16pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/5 "2024-06-10T17:16:35Z")

</div>

Thank you, I will try this out.

---

<div class="post-metadata">

**Author:** ![rruo](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rruo](https://discourse.slicer.org/u/rruo)\
**Post date:** [June 13, 2024, 6:57pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/6 "2024-06-13T18:57:48Z")

</div>

Hello,

I ran the dicom patch and loaded my files into Slicer. But how do I batch edit the location or patient position? The slice thickness would 0.3mm. Is this possible with slicer?

Thanks for the help and info,  
Russell

---

<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:** [June 13, 2024, 7:16pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/7 "2024-06-13T19:16:23Z")

</div>

Yes, sure, it should be no problem to update slice positions in Slicer. You can see that there is already a rule that can update slice positions for certain images. You can slightly tune this rule or create a new rule to process your data. You can simply edit the DICOMPatcher.py file in a text editor and click “Reload” button in the module GUI.

---

<div class="post-metadata">

**Author:** ![rruo](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rruo](https://discourse.slicer.org/u/rruo)\
**Post date:** [June 13, 2024, 7:46pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/8 "2024-06-13T19:46:47Z")

</div>

Hi Andre,

Thanks for the help. Apologies for the silly questions… I’m an end user and not really a programmer so I’m not really sure where I can edit this in the code.

But would I be able to simply change this to 0.3mm here (red arrow)?

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

Thanks again,  
Russell

---

<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:** [June 13, 2024, 7:51pm UTC](https://discourse.slicer.org/t/batch-editing-of-3dangio-cbct-slice-thickness-dicom-tag/36576/9 "2024-06-13T19:51:54Z")

</div>

Yes, you need to set the desired slice spacing. There are a few other small things to check. For example, make sure that the plugin accepts your DICOM image (if not then you can edit the list of accepted SOPClassUIDs).

I would recommend to step through the code using a [Python debugger](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/python.html) so that you can make sure that it does what you want.
