Skip to content

[ENH] Optimize TRX output#34

Merged
36000 merged 3 commits intodipy:masterfrom
36000:trx_updates
Feb 24, 2026
Merged

[ENH] Optimize TRX output#34
36000 merged 3 commits intodipy:masterfrom
36000:trx_updates

Conversation

@36000
Copy link
Collaborator

@36000 36000 commented Feb 24, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 24, 2026 08:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to optimize TRX generation in the CUDA tractography pipeline by adjusting batching defaults and TRX preallocation/output dtypes.

Changes:

  • Reduce the default chunk_size (seeds processed per chunk per GPU) from 100000 to 25000 and document it in the class docstring.
  • Increase TRX preallocation heuristic sl_per_seed_guess from 3 to 4.
  • Cast TRX streamline storage arrays to float32 (points) and uint64 (offsets).
Comments suppressed due to low confidence (1)

cuslines/cuda_python/cu_tractography.py:52

  • Changing the default chunk_size from 100000 to 25000 is a behavioral change for callers that rely on defaults (it can increase kernel launch/host overhead and alter memory/perf characteristics). If this is intended, consider documenting it as a breaking/behavioral change (e.g., in release notes/README) or keeping the previous default and adjusting it only in the CLI/config path that needs it.
        chunk_size: int = 25000,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@36000 36000 requested a review from Copilot February 24, 2026 08:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

cuslines/cuda_python/cu_tractography.py:258

  • The TODO comment about outputting in VOX space directly was removed, but the code on line 290 still calls tractogram.to_world(), which suggests the conversion is still happening. If the TODO was meant to be addressed by this PR, the conversion should be removed or modified. If the TODO is not being addressed, it should remain in the code.
    def generate_trx(self, seeds, ref_img):

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@36000 36000 merged commit f7bf5f7 into dipy:master Feb 24, 2026
1 check failed
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 this pull request may close these issues.

2 participants