Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fractional labelmap support in segmentations #52

Open
cpinter opened this issue Sep 17, 2017 · 1 comment
Open

Add fractional labelmap support in segmentations #52

cpinter opened this issue Sep 17, 2017 · 1 comment

Comments

@cpinter
Copy link
Member

cpinter commented Sep 17, 2017

PolyDataToLabelmap

  • Create a float volume
  • Do a smooth (make it an option in the algorithm class)

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 cpinter added this to the Student projects milestone Sep 17, 2017
@cpinter
Copy link
Member Author

cpinter commented Sep 17, 2017

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:

  • Around fractional labelmap summation.
  • Around cached intersection modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant