SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
128 stars 60 forks source link

Add fractional labelmap support in segmentations #52

Open cpinter opened 7 years ago

cpinter commented 7 years ago

PolyDataToLabelmap

This way the resampled volume will not be jagged. Then do a threshold just as now.

Migrated from https://app.assembla.com/spaces/slicerrt/tickets/301-add-fractional-labelmap-support-in-segmentations/details

cpinter commented 7 years ago

2013-10-15 16:20 Csaba Pinter Assigned to set to Jennifer Andrea

2014-02-19 15:23 Csaba Pinter Could be achieved by non-binary line drawing on the raster image (e.g. in vtkPolyDataToImageStencil.cxx::501)

Csaba Pinter Assigned to changed from Jennifer Andrea to -none-on 2014-04-02 11:35 Milestone changed from Future to SlicerRt 0.14on 2014-04-02 11:47

2014-04-02 11:48 Csaba Pinter The tolerance threshold investigated in #521 has a similar effect to this fuzzy approach. It cannot be applied for inter-plane interpolation, and the in-plane 'fuzzification' does not seem to be worth the effort, so I close this as invalid.

2014-04-28 13:26 Csaba Pinter Could be worth trying to use this existing implementation: http://www.vtkjournal.org/browse/publication/792

2014-12-22 14:15 Csaba Pinter This will be implemented as the fractional labelmap support in Segmentations

2016-08-17 13:02 Andras Lasso Why do you have "outline visible"? For fractional labelmaps the outline is the isosurface created at the threshold value (threshold value is 0 by default but we may make it adjustable by using another field data). The outline would be nicer than with binary labelmap but if it's not nice enough then maybe we could just add a hint that by default outline should be hidden.

I would suggest to put min/max values in one field, as it does not make sense to define only one and we also less fields is better. Making them double instead of string would allow us to get rid of a few conversions.

So, overall I would recommend these: ScalarRange - vtkDoubleArray [2] = { minimumValue, maximumValue } ImageInterpolationMethod - vtkStringArray [1], potential values "NEAREST_NEIGHBOR", "LINEAR", "CUBIC", ... (or "NearestNeighbor", "Linear", "Cubic")

2016-08-17 13:20 Kyle Sunderland @lassoan In my previous implementation, I disabled the outline since the fractional outline isn't correctly rendered (it seems to be rendering many outlines around every value between 1-216). I'll change it so that the outline is only created at the threshold value.

So this means that the fields will be: "ScalarRange" - vtkDoubleArray [2] = { minimumValue, maximumValue } "ThresholdValue" - vtkDoubleArray [1] = {thresholdValue} "ImageInterpolationMethod" - vtkIntArray [1] = VTK_CUBIC_INTERPOLATION, VTK_LINEAR_INTERPOLATION, VTK_NEAREST_INTERPOLATION

Does this seem acceptable?

2016-08-17 13:34 Andras Lasso Yes! Using VTK_..._INTERPOLATION constants is a very good idea. As these constants are called "InterpolationType" in VTK, let's call the field "InterpolationType", too.

"ScalarRange" - vtkDoubleArray [2] = { minimumValue, maximumValue } "ThresholdValue" - vtkDoubleArray [1] = {thresholdValue} "InterpolationType" - vtkIntArray [1] = VTK_CUBIC_INTERPOLATION, VTK_LINEAR_INTERPOLATION, VTK_NEAREST_INTERPOLATION

2016-08-26 21:35 Andras Lasso @Sunderlandkyl I've just realized that for 2D fill probably we should use the thresholding filter output. That way the displayed contour would be filled - the same way as it is done for binary labelmaps. The segment would have clear, smooth, but non-blocky boundaries. What do you think?

2016-08-26 21:51 Kyle Sunderland @lassoan That sounds like an good idea. I'll implement it and see how it looks.

2016-08-26 22:00 Csaba Pinter I also think it's a good idea. We could add an option to switch between the two. And even if the slice views show thresholded fill, the Data Probe can show the fractional values.

2017-07-19 14:57 Kyle Sunderland Note: multi-threading the current approach may still be possible. It would require mutex locks in at least two areas: