Skip to content

Tckgen i fod1 fix max angle at seed#2325

Open
jdtournier wants to merge 2 commits intodevfrom
tckgen_iFOD1_fix_max_angle_at_seed
Open

Tckgen i fod1 fix max angle at seed#2325
jdtournier wants to merge 2 commits intodevfrom
tckgen_iFOD1_fix_max_angle_at_seed

Conversation

@jdtournier
Copy link
Copy Markdown
Member

Just got a report that when using iFOD1, the angle between track segments can be up to twice the stated max angle at the seed point. This was due to an interaction between iFOD1 and the way the track reversal is handled, which this PR hopefully fixes. More detail in commit 5237d46.

Note that I don't think this affects iFOD2 or other algorithms, though it would be worth double-checking, maybe by adding some tests to verify correct behaviour.

Mostly indentation changes, but also minor cleanup in handling of init()
method.
With iFOD1, the second half of a bidirectional streamline starts in the
opposite direction from the first half. The seed direction is determined
first, and then used as the initial direction of tracking for both
halves. But the actual direction of the first step is taken as a random
sample within the angular constraint about that seed direction, and
because this happens both ways, and with the same seed direction, it is
possible for the angle between the two line segments either side of the
seed point to be up to twice the max angle.

The solution here involves setting the initial direction of tracking for
the second half of the streamline to the (opposite of the) *actual*
direction of the first step of the first half, rather than the seed
direction initially determined. This ensures that the first step of the
second half of the streamline is taken within the max angle constraint
of what is effectively the incoming direction of tracking.

To achieve this, the reverse_track() method was extended to perform the
actual track reversal and set the position and initial direction of
tracking, and overridden in the iFOD1 method to set things
appropriately.
@jdtournier jdtournier added the bug label May 21, 2021
@jdtournier jdtournier added this to the 3.1.0 updates milestone May 21, 2021
@jdtournier jdtournier requested a review from a team May 21, 2021 14:22
@jdtournier jdtournier self-assigned this May 21, 2021
@Lestropie Lestropie force-pushed the tckgen_iFOD1_fix_max_angle_at_seed branch from 5237d46 to 1162afe Compare August 26, 2025 07:47
@Lestropie Lestropie force-pushed the dev branch 2 times, most recently from 70031c3 to 6bf4cec Compare August 26, 2025 08:11
@Lestropie Lestropie force-pushed the tckgen_iFOD1_fix_max_angle_at_seed branch from 1162afe to 5237d46 Compare August 29, 2025 07:01
@Lestropie
Copy link
Copy Markdown
Member

As a bug fix this should be rebased onto master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants