Feature/c5/pr over truncated domain y watertight falsealarm conti01 rebased#7
Open
tai271828 wants to merge 4 commits into
Conversation
The refactoring keeps the same business logic based on the below reasons: PEP 8: "For sequences, (strings, lists, tuples), use the fact that empty sequences are false" PEP 428: make paths stay portable across OSes. PEP 498: "F-strings provide a concise, readable way to include the value of Python expressions inside strings."
The domain along the Y-axis could occasionally be over-truncated. This commit detects the condition and fixes it by padding the Y dimension of the voxel domain with an additional voxel layer. Resolves: gzavo#6
tai271828
commented
Apr 30, 2026
| isInRange = True | ||
| for i in range(3): | ||
| isInRange = (isInRange and inRange(value3D[i], rangeValue3D[i], distance) ) | ||
Author
There was a problem hiding this comment.
Trivial update: removing trailing spaces by linter automatically.
tai271828
commented
Apr 30, 2026
| haveStent = True | ||
|
|
||
|
|
||
| stent_folder = confData.get("stent_folder", "") |
Author
There was a problem hiding this comment.
The change is not just more pythonic, but also prevents from the error caused by missing stentGeomFile on purpose. Sometimes we don't want to input stent files.
tai271828
commented
Apr 30, 2026
| # Fix the issue of water tight false alarm due to over-truncated domain along Y | ||
| LHS_inequality = (vox_scale*ds[1]) % 1 | ||
| RHS_inequality = ds[1]/ds[0]*((vox_scale*ds[0]) % 1) | ||
| if LHS_inequality > RHS_inequality: |
Author
There was a problem hiding this comment.
This is the core part of the change from this PR. See issue #6 for the elaboration of this inequality.
tai271828
commented
Apr 30, 2026
| print(f"Warning: Truncation bug detected (See Issue: #6): Inequality LHS {LHS_inequality} is larger than RHS {RHS_inequality}. It means potential truncation bug!!") | ||
| final_scaled_bound_y = scale[1] * ds[1] | ||
| print(f"Current scaled bound along Y is {final_scaled_bound_y}, while domain[1] is {domain[1]}") | ||
| if final_scaled_bound_y > domain[1]: |
Author
There was a problem hiding this comment.
Only apply the fix for Issue #6 when necessary so we can keep backward-compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The domain along the Y-axis could occasionally be over-truncated. This pull request detects the condition and fixes it by padding the Y dimension of the voxel domain with an additional voxel layer.
Resolves: #6
Some bonus minor (style/refactoring) commits are shipped in this pull request too. See the inline comments.
Verification