Harden transform on large segmentation hangs 3D Slicer

Hi

I am having some problems with 3D Slicer hanging when trying to perform ‘harden transform’ on large segmentations.

Specifically, I have some whole body PET/CT images with associated segmentations. If I create a simple linear transformation and apply it to the CT and PET volumes and segmentation, all is fine. When I use the harden transform button, everything goes as expected for the two volumes. However, when I click it with the segmentation selected, 3D Slicer hangs and eventually needs force quitting.

Is there any way that I can try and debug this to determine what the issue might be? I have tried using the python interface to harden the transform, but with the same result. I’m not sure how to get any more fine-grained knowledge of what is going on under the hood.

This is in 3D Slicer 4.10 and 4.10.1 on MacOS.

Please let me know if you need any further information.

Ben

Thanks for the report. Is there anything in the log? You can access application logs in About / Report an error.

If the log is not helpful then we’ll need an mrb scene file so that we can debug it.

You can get more insight by building Slicer in debug mode and breaking the execution during the long processing. It is probably simpler to share an anonymized sample data set where we can reproduce the issue.

Hi

I can recreate the issue with the segmentation file linked below. Instructions:

  • Load segmentation
  • Create new Linear Transform
  • Set LR shift of 5 mm (any shift causes the issue)
  • Apply the transform to the ‘13 RTSTRUCT PT_MidTreat’ node
  • Click ‘Harden Transform’ button

At this stage, I get the dreaded beach ball and 3D Slicer hangs. MacOS says the application is not responding and I need for Force Quit it.

I have also linked to the log I get from following the above instructions.

I came across the issue whilst trying to use the Segmentation Registration module. However, I managed to narrow it down to a problem with this step when applied to this segmentation (and similar ones from other patients).

Segmentation: https://unioxfordnexus-my.sharepoint.com/:u:/g/personal/donc0432_ox_ac_uk/EeaunYq4Sx9KgA1lpcNUSAUBnC8IB4brG2v0VhsJroMWlQ?e=7MoW7c

Log file: https://unioxfordnexus-my.sharepoint.com/:t:/g/personal/donc0432_ox_ac_uk/ER44kqRSRKpPp0uSOga5YokBXDKYzg28DCb-6PUT-C7lZQ?e=p9xpP0

Please let me know if you need any other information.

Ben

Thanks for the info Ben. One more thing you can try: since you are using a mac, you can open the Activity Monitor, select the Slicer process, and then choose the Sample Process action (from the gear shaped toolbar icon menu). That will tell what the application is doing.

Could you please also send the .vtp files of each segment? The attached .vtm file is just an index of which files store the segments.

Hi

Thanks for the quick reply. Below are links to:

  • the DICOM RTSTRUCT file form which the segmentations come from. I get the same issue if I load this file and try to apply a transformation.
  • A sample process output from MacOS activity monitor

RTSTRUCT: https://unioxfordnexus-my.sharepoint.com/:u:/g/personal/donc0432_ox_ac_uk/EWFRKBv6xYZLuHqmtEkvwR4Bn9vKHM0AJFlCh9wNLMHDsw?e=YQiLwa

Process sample: https://unioxfordnexus-my.sharepoint.com/:t:/g/personal/donc0432_ox_ac_uk/EfaYJcimSypKoCTDIPtZc-UBz6LFnVoR4P9pAmDbI4rbdQ?e=FyQFwy

Ben

Thank you, I could reproduce the issue with the data set that you provided.

On my computer (4-year-old desktop i7) it takes several minutes to apply a transform, but the operation completes successfully.

There is probably some things that are not optimized well, because if I go to Segmentations module, make “Closed surface” the master representation then transformations are immediately completed. You can use this as a workaround for now if you don’t want to wait several minutes each time you harden the transform. I’ve added a ticket to SlicerRT to track this issue: https://github.com/SlicerRt/SlicerRT/issues/102

Thanks for looking into this for me.

It seems that I just wasn’t patient enough! I just tried it again and waited longer and it does (eventually) complete. It to complete it takes 5-7 minutes on my MacBook Pro.

Making ‘closed surface’ the master also fixes this issue for me. What is going on behind the scenes when ‘closed surface’ is made the master? I’ve not looked into what this mean until now.

DICOM RTSTRUCT stores each segment as a set of planar contours. This representation is essentially useless for any further processing (the RT community is trying to move away from it, but there are lots of legacy systems out there, so it may take decades), so we convert it to closed surface for 3D visualization and binary labelmap for editing. All these different representations are automatically kept in sync.

The issue seems to be that during transformation of the planar contour representation the closed surface conversion is re-run many times. We should prevent these updates until the transformation is completed. @cpinter will probably fix this soon.

Indeed, I will fix this in a few days. Please hang on!

@Ben_George I fixed the problem. Please try tomorrow’s nightly