Page 1 of 1

DICOM RTSS to .ctgr conversion

Posted: Thu Mar 07, 2024 2:57 am
by fdekerme
Hello,
I would like to know if there is a code for converting DICOM RTSS into a .ctgr file that can be read by SimVascular. RTSS is a .dcm file used in radiotherapy containing the contours of different organs. These contours are stored in the form of points (x, y, z coordinates).

The problem seems to be quite similar to this one: viewtopicPhpbb.php?f=188&t=15296&p=44489&start=0&view=
If I've understood correctly, there are 2 possibilities:
  • Either I convert the RTSS file into a .ctgr, but in this case I also have to generate the centreline.
  • Or I create a surface from the point cloud using the VTK vtkSurfaceReconstructionFilter class.
Thanks for your reply!
fdekerme

Re: DICOM RTSS to .ctgr conversion

Posted: Fri Mar 08, 2024 10:51 am
by davep
Hi fdekerme,

There is no code that I am aware of to convert DICOM RTSS into a .ctgr file.

If you convert the RTSS file into a .ctgr then you can read it in to SV and modify the segmentations but you need to be able to read in imaging data.

Creating a surface from the point cloud might be the best option. You could then read it is to SV in the Modeling Tool.

Cheers,
Dave

Re: DICOM RTSS to .ctgr conversion

Posted: Sun Mar 10, 2024 8:05 am
by fdekerme
Thanks for your reply! I'm going to convert to .ctgr rather than surface, so that I can edit the contours in SV.
What do you mean by "but you need to be able to read in imaging data"? I've checked and it's possible to open a .ctgr file in SV without the associated image.

One other thing. Is the .ctgr file sufficient to continue the simulation (create the surface, meshing simulation ...) or is the .pth path necessary?

Thank you!
fdekerme

Re: DICOM RTSS to .ctgr conversion

Posted: Mon Mar 11, 2024 12:55 pm
by davep
Hi fdekerme,

The SV Segmentations Tool works by segmenting 2D slices from 3D image data. When you move the slice plane or select a contour then it will try to extract a 2D slice. I guess if an image does not exist then it just does nothing.

Cheers,
Dave

Re: DICOM RTSS to .ctgr conversion

Posted: Tue Apr 23, 2024 5:28 am
by fdekerme
Hello :D ,
Following this post I have developed a small code to convert DICOM (.dcm) RTStrucutre files into Simvascular readable .pth and .ctgr files: https://github.com/fdekerme/rtss2sv

The creation of the .pth file uses the Simvascular API and works well.

However, the Simvascular API does not contain a constructor for the sv.segmentation.Series() structure (1). The .ctgr files were therefore created by hand as .xml files.

The code works, but there are still some artifacts we can't resolve (2).
I think the problem lies in the file header, which contains some erroneous information, but we can't really work out what.

Merci !
fdekerm

(1) viewtopicPhpbb.php?f=188&t=17705&p=49313&start=0&view=
(2) viewtopicPhpbb.php?f=188&t=17821&p=0&st ... 16619c42da

Re: DICOM RTSS to .ctgr conversion

Posted: Tue Apr 23, 2024 11:35 am
by davep
HI fdekerm,

A GitHub repository with README, very nice!

What exactly is wrong with the .pth files?

Note that you will not be able to use the .pth files to segment an image.

Cheers,
Dave

Re: DICOM RTSS to .ctgr conversion

Posted: Wed Apr 24, 2024 12:55 am
by fdekerme
The .pth works fine, it's the .ctgr that has a problem, which my colleague describes here: viewtopicPhpbb.php?f=188&t=17821&p=0&st ... 16619c42da.

The .ctgr file that the code generates looks a lot like a vanilla .ctgr file generated by SimVascular. However, when we load our .ctgr into SimVascular, the first 2 points (control points and contour points) of each contour are modified, which creates artifacts (see screenshots in the post quoted).
Note that you will not be able to use the .pth files to segment an image.
Why? Even if we have the associated image?

thanks !
fdekerm

Re: DICOM RTSS to .ctgr conversion

Posted: Wed Apr 24, 2024 11:13 am
by davep
Hi fdekerm,

Note that you will not be able to use the .pth files to segment an image.

What I meant was that you will not be able to segment the DICOM RT files I think because they are not volumetric image data.

However, I've never tried to read in DICOM RT files into SV so I don't know how this might work.

Cheers,
Dave