NF - Pft accepts any directiongetter#12
Conversation
3209d35 to
6abf3f3
Compare
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Inefficient Point Operations ▹ view | ||
| Infinite Loop in ENDPOINT Handling ▹ view | ||
| Redundant PVE Calculations ▹ view |
Files scanned
| File Path | Reviewed |
|---|---|
| dipy/tracking/local_tracking.py | ✅ |
| dipy/tracking/localtrack.pyx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
| i += i_sub-1 | ||
| copy_point(&streamline[i-1,0], point) | ||
| # update max_wm_pve | ||
| for j in range(i_sub): |
There was a problem hiding this comment.
Can you add a check here, and only do the for loop if
max_wm_pve < min_wm_pve_before_stopping.
i.e. once we reached the wm, we don't need to update this variable.
| # update the current point with the PFT results | ||
| copy_point(&streamline[i-1, 0], point) | ||
| copy_point(&directions[i-1, 0], &direction[0]) | ||
| # copy_point(&directions[i-1, 0], &direction[0]) |
There was a problem hiding this comment.
The variable direction is not used, no? If this is correct, could you remove the direction variable completely, and rename direction_calc to direction
| break | ||
| # Update the point and prev_point variables and get the direction of the last step | ||
| stream_status_1 = stream_status[0] | ||
| if i>1: |
There was a problem hiding this comment.
Could you re-organize the code to start the loop with the call to dg.generate_streamline. This if i>1 and the i_sub = 2 seems unnecessary if you re-order the logic.
Description by Korbit AI
What change is being made?
Refactor the particle filter tracking (PFT) process to remove the use of the
particle_dirsanddirectionsarrays, allowing the algorithm to accept anyDirectionGetterimplementation for direction determination.Why are these changes being made?
The removal of the
directionsandparticle_dirsarrays streamlines PFT by leveraging the direction calculations provided directly by theDirectionGetter, reducing redundancy and simplifying the overall code structure. This enhances flexibility, allowing for variousDirectionGetterstrategies to be used without being tied to predefined direction arrays, promoting modularity and code reusability within the dipy tracking framework.