Absolute volume DVHs differ between MIM and dicompyler

68 views
Skip to first unread message

Isak Wahlstedt

unread,
Jan 13, 2021, 10:46:27 AM1/13/21
to dicompyler
Dear all,

I have accumulated doses using MIM and Velocity. 

When I plot the GTV DVHs in MIM using the same structure set for the doses accumulated in MIM and Velocity I get the DVHs below. As seen, both GTVs has an absolute volume of 2.82 ml.Velocity and MIM in MIM.png

When I calculate the DVHs using the same strucure set and the same dose files using dvhcalc in dicompyler the absolute volumes of the structures differ (see below). 
Velocity vs MIM in dicompyler.png

I am wondering if someone can explain why I get different absolute volumes for the strcutures in the DVHs created in dicompyler compared to MIM?

Kind regards
Isak 

Dan Cutright

unread,
Jan 13, 2021, 10:55:15 AM1/13/21
to dicom...@googlegroups.com
Looks like a small volume.  Have you tried using the interpolation features in dicompyler (interpolation_resolution and interpolation_segments_between_planes)?

We're still looking into a small fix here too:


--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en
---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dicompyler/931eb9b8-76cb-4075-9dca-363f6d1c41f6n%40googlegroups.com.

Aditya Panchal

unread,
Jan 13, 2021, 11:00:27 AM1/13/21
to dicom...@googlegroups.com
Hi Isak,

Dan is correct. If you try re-calculating with interpolation, you should get a closer result. Also on your DVH plot (and statistics) did you mean the orange GTV MIM is the DVH curve generated by dicompyler-core?

Kind regards,

Adit

Isak Wahlstedt

unread,
Jan 13, 2021, 2:51:38 PM1/13/21
to dicompyler
Dear Dan and Adit, 

Thank you very much for your quick and informative reply! I very much appreciate your help!

A clarification to my initial question: In the DVH plots with white background both DVHs are plotted with dicompyler-core. The blue and orange curves represent the GTV DVHs for doses accumulated with Velocity and MIM, respectively. The DVHs on black background are DVHs for the same doses and structures but plotted in MIM.

I just tried adjusting interpolation_segments_between_planes with the results below.
Segment interpolation.png
Thus, as seen in the figure above, this seems to make the GTV volume for the dose accumulated in MIM a bit smaller.

However, when I try to change the interpolation_resolution I get the error below.
Error with interpolation resolution.png

I cannot completely understand this error since I provided the value 1.63042/2

Do you know why I get this error?

Kind regards
Isak

Isak Wahlstedt

unread,
Jan 14, 2021, 3:07:40 AM1/14/21
to dicompyler
Dear all,

A small addition to my previous post; it seems like I provided an incorrect input value of 0.543473 for the  interpolation_resolution. I just corrected this and got the same error message (see below).

Error with interpolation resolution 2.png  

Kind regards
Isak

Adit Panchal

unread,
Jan 14, 2021, 9:22:34 AM1/14/21
to dicom...@googlegroups.com
I wonder what is the pixel spacing for the RT Dose file?
Is it square or rectangularly shaped pixels?
If it's square, 0.81521 should work.


On Jan 14, 2021, at 02:07, Isak Wahlstedt <isak.wa...@gmail.com> wrote:

Dear all,

A small addition to my previous post; it seems like I provided an incorrect input value of 0.543473 for the  interpolation_resolution. I just corrected this and got the same error message (see below).

Dan Cutright

unread,
Jan 14, 2021, 1:04:08 PM1/14/21
to dicompyler
Hi Isak,

If it helps, here is how I implemented dicompyler-core interpolation:

where self.dvh_high_resolution_factor is a power of 2.

If you're still having issues, I'd be happy to run an anonymized DICOM file set through my code.

Dan

if dvh.volume < self.dvh_small_volume_threshold:
    try:
        kwargs["interpolation_resolution"] = (
            self.rt_data["dose"].PixelSpacing[0]
            / self.dvh_high_resolution_factor,
            self.rt_data["dose"].PixelSpacing[1]
            / self.dvh_high_resolution_factor,
        )
        if dicompylercore_version == "0.5.5":
            kwargs["interpolation_resolution"] = kwargs[
                "interpolation_resolution"
            ][0]

        kwargs[
            "interpolation_segments_between_planes"
        ] = self.dvh_high_resolution_segments_between

        try:
            dvh_new = dvhcalc.get_dvh(**kwargs)
        except MemoryError:
            kwargs["memmap_rtdose"] = True
            # dicompyler-core needs to re-parse the dose file
            dvh_new = dvhcalc.get_dvh(**kwargs)
        dvh = dvh_new
    except Exception as e:
        msg = (
            "Small volume calculation failed, "
            "using default calculation"
        )
        push_to_log(e, msg=msg)

 


Isak Wahlstedt

unread,
Jan 15, 2021, 4:14:49 AM1/15/21
to dicompyler
Dear Aditya and Dan,

Thank you so much for your help. I really appreciate it.

Some of the software I am using provides dose files with square pixels while others provide rectangular pixels. The code below works for square pixel dose files but fails for rectangular. In the code below, n is an integer provided as input.

Non-working code.png

I get the error below for rectangular pixels. Do you know why?
Error with interpolation resolution 3.png
Kind regards
Isak

Dan Cutright

unread,
Jan 15, 2021, 8:30:37 AM1/15/21
to dicompyler
Which version of dicompyler-core are you on?  Rectangular pixels aren't supported prior to 0.5.6.

Isak Wahlstedt

unread,
Jan 15, 2021, 9:26:48 AM1/15/21
to dicompyler
Dear Dan,

I am on version 0.5.5 so this might be the issue. Can I update to 0.5.6 using a pip command?

Kind regards
Isak

Dan Cutright

unread,
Jan 15, 2021, 9:29:12 AM1/15/21
to dicompyler
dicompyler-core 0.5.6 hasn't been pushed to PyPI yet, but you can pull from GitHub:

pip install git+https://github.com/dicompyler/dicompyler-core.git

Isak Wahlstedt

unread,
Jan 20, 2021, 8:11:00 AM1/20/21
to dicompyler
Dear Dan,
Thank you very much for this. It works splendidly!
Kind regards
Isak

Reply all
Reply to author
Forward
0 new messages