# Export pixel values for specific segmentation in text file

**URL:** <https://discourse.slicer.org/t/export-pixel-values-for-specific-segmentation-in-text-file/5809>\
**Category:** Support\
**Tags:** dicom\
**Created:** [February 17, 2019, 6:32pm UTC](https://discourse.slicer.org/t/export-pixel-values-for-specific-segmentation-in-text-file/5809 "2019-02-17T18:32:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CostasP](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@CostasP](https://discourse.slicer.org/u/CostasP)\
**Post date:** [February 17, 2019, 6:32pm UTC](https://discourse.slicer.org/t/export-pixel-values-for-specific-segmentation-in-text-file/5809/1 "2019-02-17T18:32:54Z")

</div>

Operating system: Windows 10  
Slicer version: 4.10.0

Hello, I am a new user and currently segmenting a ct dicom file. I am trying to export a .txt file with the pixel values of the segmented volume, in order to define spatially varying material properties in simulations. I wonder if such a feature is available. It may be something quite simple but I have not managed to resolve it yet. Thanks in advance for your input.

---

<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:** [February 17, 2019, 6:51pm UTC](https://discourse.slicer.org/t/export-pixel-values-for-specific-segmentation-in-text-file/5809/2 "2019-02-17T18:51:07Z")

</div>

Reading voxel values from text file would be 10-100x slower than reading from a binary file. Why would you like to write to text file instead the current binary format? What software will read the file?

---

<div class="post-metadata">

**Author:** ![CostasP](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@CostasP](https://discourse.slicer.org/u/CostasP)\
**Post date:** [February 17, 2019, 9:32pm UTC](https://discourse.slicer.org/t/export-pixel-values-for-specific-segmentation-in-text-file/5809/3 "2019-02-17T21:32:33Z")

</div>

Thanks for the immediate response. I have segmented the CT data and exported the segmented volume in stl file. The stl was imported in comsol and now I need to define material properties as functions of spatial coordinates (within the same segment/domain). The property value for each spatial coordinate will be derived from the corresponding voxel value through a correlation function, so this is why I think that the text file is required. Of course maybe a better approach that I am not aware of is available.
