# Compute co-occurrence matrix from DICOM

**URL:** <https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539>\
**Category:** Development\
**Created:** [June 1, 2024, 12:05pm UTC](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539 "2024-06-01T12:05:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajad\_amiri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sajad_amiri/32/78661_2.png) [@sajad\_amiri](https://discourse.slicer.org/u/sajad_amiri)\
**Post date:** [June 1, 2024, 12:05pm UTC](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539/1 "2024-06-01T12:05:45Z")

</div>

Hello friends, I want to know how we can extract the matrices themselves from our DICOM. for example, I want to have a Co-occurrence matrix . to produce new features from this matrix. how can I extract the matrix?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [June 3, 2024, 11:48am UTC](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539/2 "2024-06-03T11:48:43Z")

</div>

To clarify: do you want to get matrices that are stored in DICOM tags?

If you use C++ there are examples for this in the SlicerRT extension code. Otherwise I think you can use pydicom.

---

<div class="post-metadata">

**Author:** ![sajad\_amiri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sajad_amiri/32/78661_2.png) [@sajad\_amiri](https://discourse.slicer.org/u/sajad_amiri)\
**Post date:** [June 3, 2024, 11:55am UTC](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539/3 "2024-06-03T11:55:15Z")

</div>

yes. I want matrices, I do not have experience with c++ . I will try pydicom . thanks too much

‫‪Csaba Pinter via 3D Slicer Community‬‏ \<‪[notifications@slicer.discoursemail.com](mailto:notifications@slicer.discoursemail.com)‬‏\> در تاریخ دوشنبه ۳ ژوئن ۲۰۲۴ ساعت ۴:۴۸ نوشت:‬
