How to convert dicom series to vti file using vtk.js

I’m using readDICOMSeries to read a series .dcm image, but it’s very slow to load 500 .dcm image on https://kitware.github.io/itk-vtk-viewer/app/
So that I want to convert series .dcm image to .vti
Thanks in advance for any help from everyone.

Did you try ParaView to create that vti file?

1 Like

I’m not sure if .vti file can store image axis directions. A few years ago (when vtkImageData did not support orientation yet), it surely was not able to store it. Without knowing axis directions, you cannot convert between physical (LPS) <-> voxel (IJK) positions.

For medical images, I would recommend to use nrrd, metaimage, or nifti file format instead, which can all store image direction.

I’m not sure how robust ParaView’s DICOM importer is and if it supports image directions. It is probably a safer choice to use medical imaging applications, such as 3D Slicer, MITK, ITK-Snap, etc. to load the DICOM image and then save it in your preferred format.

1 Like

Thanks for your answer. I need convert step by step not tool. I need to resolve it.

Thanks for your recommend to use nrrd. I’ll research for that. If you have any document, please send for me!!!

Hi Sebastien,
Do you have example of how to convert dcm to vti file using paraview / vtk ?

If ParaView works for you, load your file(s) and save it using the vti format. If you use the trace ParaView should give you the scripting equivalent to perform that operation so you could automate it later on using pvpython.

Hi Sebastien,
I am not quite understanding how to run ParaView, I download Paraview from this page
https://www.paraview.org/download/ .
And binary files are located here. And I dont find any file to run Paraview application

#( 08/13/21@ 1:23AM )( phongtd@nguyenth ):~/workingspace/ParaView-5.9.1-1476-gf2172c1-osmesa-MPI-Linux-Python3.9-x86_64/bin
ll
total 4860
drwxr-xr-x 2 phongtd phongtd 4096 Thg 8 8 12:53 ./
drwxrwxr-x 5 phongtd phongtd 4096 Thg 8 9 10:06 …/
-rwxr-xr-x 1 phongtd phongtd 2204808 Thg 8 8 12:54 hydra_pmi_proxy*
-rwxr-xr-x 1 phongtd phongtd 2476600 Thg 8 8 12:53 mpiexec*
-rwxr-xr-x 1 phongtd phongtd 13328 Thg 8 8 12:52 ospray_mpi_worker*
-rw-r–r-- 1 phongtd phongtd 49 Thg 8 8 12:46 paraview.conf
-rwxr-xr-x 1 phongtd phongtd 24848 Thg 8 8 12:52 pvbatch*
-rwxr-xr-x 1 phongtd phongtd 25432 Thg 8 8 12:52 pvbatch-real*
-rwxr-xr-x 1 phongtd phongtd 24848 Thg 8 8 12:52 pvdataserver*
-rwxr-xr-x 1 phongtd phongtd 19216 Thg 8 8 12:52 pvdataserver-real*
-rwxr-xr-x 1 phongtd phongtd 24848 Thg 8 8 12:52 pvpython*
-rwxr-xr-x 1 phongtd phongtd 25432 Thg 8 8 12:52 pvpython-real*
-rwxr-xr-x 1 phongtd phongtd 24848 Thg 8 8 12:52 pvrenderserver*
-rwxr-xr-x 1 phongtd phongtd 19216 Thg 8 8 12:52 pvrenderserver-real*
-rwxr-xr-x 1 phongtd phongtd 24848 Thg 8 8 12:52 pvserver*
-rwxr-xr-x 1 phongtd phongtd 19208 Thg 8 8 12:52 pvserver-real*

The ParaView that you’ve downloaded is for headless server with no GPU (slow rendering). So there is no Qt (desktop UI) client to start. You need to download the full package in the ParaView section rather than ParaView Server for Headless Machines.