# Best Way to Convert Structured Points Vtk File into DICOM?

**URL:** https://discourse.vtk.org/t/best-way-to-convert-structured-points-vtk-file-into-dicom/5483
**Category:** Support
**Created:** [April 1, 2021, 11:43pm UTC](https://discourse.vtk.org/t/best-way-to-convert-structured-points-vtk-file-into-dicom/5483 "2021-04-01T23:43:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![searica](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@searica](https://discourse.vtk.org/u/searica)
#### Post date: [April 1, 2021, 11:43pm UTC](https://discourse.vtk.org/t/best-way-to-convert-structured-points-vtk-file-into-dicom/5483/1 "2021-04-01T23:43:27Z")

</div>

I’ve got a structured points file I made with Houndsfield values for each point and I would like to convert into into a DICOM file that can be read imported into Mimics or 3D Slicer. I found this [GDCM Wiki](http://gdcm.sourceforge.net/wiki/index.php/Main_Page) which seems like it may work, and I have also considering using pydicom. Anyone have experience with this or advice on the easiest approach?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 2, 2021, 3:24pm UTC](https://discourse.vtk.org/t/best-way-to-convert-structured-points-vtk-file-into-dicom/5483/2 "2021-04-02T15:24:32Z")

</div>

I think the simplest approach is to save your image in NIFTI format, and then convert the NIFTI file to DICOM with [niftitodicom](https://github.com/dgobbi/vtk-dicom/wiki/niftitodicom). If you are using ubuntu, you can get niftitodicom with `apt install vtk-dicom-tools`, but if not, you can download the binaries [here](https://github.com/dgobbi/vtk-dicom/releases).

```auto
mkdir my_dicom_folder
niftitodicom --modality CT -o my_dicom_folder/ image.nii.gz

```

There is also a vtkDICOMWriter for VTK, but to use it you have to build VTK from source and enable `VTK_MODULE_ENABLE_VTK_vtkDICOM` in the configuration.

You can also use pydicom (I use pydicom a lot, myself), but with pydicom you are responsible for adding all the attributes to the file that make it a standards-compliant DICOM CT file. So I don’t recommend it unless you have read the relevant portions of the DICOM standard.
