# Need help on changing dicom modality

**URL:** <https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212>\
**Category:** Support\
**Tags:** dicom\
**Created:** [January 22, 2025, 9:26am UTC](https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212 "2025-01-22T09:26:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alientex](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@alientex](https://discourse.slicer.org/u/alientex)\
**Post date:** [January 22, 2025, 9:26am UTC](https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212/1 "2025-01-22T09:26:22Z")

</div>

**Hello,**

As per my use case, I want to change the modality of DICOM data when importing a DICOM directory, so that when viewing the DICOM metadata, it reflects the changes I made.

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

Can anyone please help me achieve 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:** [January 22, 2025, 7:02pm UTC](https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212/2 "2025-01-22T19:02:11Z")

</div>

You can write a simple pydicom script to do this, but it’s not avalable in the GUI of Slicer.

---

<div class="post-metadata">

**Author:** ![alientex](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@alientex](https://discourse.slicer.org/u/alientex)\
**Post date:** [January 23, 2025, 3:57am UTC](https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212/3 "2025-01-23T03:57:34Z")

</div>

@pieper @lassoan

Could you please show me how to directly change it through the code during the import operation? Also, I want to perform this in C++. Could you please guide me in which file should I make changes?

Thanks for any help.

---

<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:** [January 23, 2025, 1:29pm UTC](https://discourse.slicer.org/t/need-help-on-changing-dicom-modality/41212/4 "2025-01-23T13:29:06Z")

</div>

Chaning the modality is a very unusual action. Can you describe why you need to do it?

I would suggest doing this in a separate pass, not part of the dicom import operation. You can find lots of examples in C++ using dcmtk, gdcm, or other toolkits. But python would be a lot easier.
