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

Erroneous output handling #81

Open
mauigna06 opened this issue Jul 15, 2024 · 3 comments · May be fixed by PerkLab/SlicerSandbox#33
Open

Erroneous output handling #81

mauigna06 opened this issue Jul 15, 2024 · 3 comments · May be fixed by PerkLab/SlicerSandbox#33

Comments

@mauigna06
Copy link

Hi Ronald, thanks a lot for your work on this great library

I'd like to propose to use this boolean table below to handle different results so they are always valid. I was going to implement this idea replacing current code in this link but after thinking about it, I think it would be better to have this table implemented inside vtkbool:

----------------------------------------------------------------------------------------------------
	result		|	touching		|	operation	|	do what?
----------------------------------------------------------------------------------------------------
	0		|	0			|	union		|	append
	0		|	1			|	union		|	retry
	1		|	0x			|	union		|	nothing else
	1		|	1x			|	union		|	nothing else
----------------------------------------------------------------------------------------------------
	0		|	0			|	intersect	|	nothing else
	0		|	1			|	intersect	|	retry
	1		|	0x			|	intersect	|	nothing else
	1		|	1x			|	intersect	|	nothing else
----------------------------------------------------------------------------------------------------
	0		|	0			|	diffA-B		|	result is A
	0		|	1			|	diffA-B		|	retry
	1		|	0x			|	diffA-B		|	nothing else
	1		|	1x			|	diffA-B		|	nothing else
----------------------------------------------------------------------------------------------------
	0		|	0			|	diffB-A		|	result is B
	0		|	1			|	diffB-A		|	retry
	1		|	0x			|	diffB-A		|	nothing else
	1		|	1x			|	diffB-A		|	nothing else
----------------------------------------------------------------------------------------------------


NOTES:

  • "result" says if the OutputPolydata of vtkPolyDataBooleanFilter has more than one point.
  • "touching" says if the OutputPolydata of vtkCollisionDetectionFilter (between the two input PolyDatas) has more than one point.
  • "operation" is the operationType of the vtkPolyDataBooleanFilter.
  • boolean variable "result" is truer than boolean variable "touching". E.g. values with an "x" on the right do not matter
  • "do what?" says the output definition.
  • "nothing else" means keep default output of the booleanFilter
  • "retry" means add a small random translation variation (1e-4mm) to one of the inputMeshes to make the result correct if there was an error, and update the vtkPolyDataBooleanFilter again

Please let me know your thoughts

@mauigna06
Copy link
Author

I can implement this if you would review it, please let me know Ronald :)
This would solve problems in the workflow of BoneReconstructionPlanner

@mauigna06
Copy link
Author

Hi @zippy84

It would be really useful if this "fix" could be pushed to vtkbool instead of having it on BoneReconstructionPlanner or Slicer. What do you think?

mauigna06 added a commit to mauigna06/SlicerSandbox that referenced this issue Aug 9, 2024
mauigna06 added a commit to mauigna06/SlicerSandbox that referenced this issue Aug 9, 2024
@mauigna06
Copy link
Author

Hi @zippy84 :)

I've implemented my proposal:
PerkLab/SlicerSandbox@b2252f5

Please review when you have time :)
It would be great if could make that PR part of vtkbool

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

Successfully merging a pull request may close this issue.

1 participant