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

Allow other types into append #39

Open
arokem opened this issue Sep 27, 2022 · 1 comment
Open

Allow other types into append #39

arokem opened this issue Sep 27, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@arokem
Copy link
Collaborator

arokem commented Sep 27, 2022

Right now, append only takes a TRX as input:

def append(self, trx: Type["TrxFile"], extra_buffer: int = 0) -> None:

For practical purposes, it would be useful to be allowed to append SFT and other types (ArraySequence, LazyTractogram) into an existing TRX.

@arokem
Copy link
Collaborator Author

arokem commented Sep 27, 2022

For now, the pattern is:

  1. Initialize an empty TRX (optionally preallocate, if you know how large this will be)
  2. Create a LazyTractogram out of a batch of streamlines.
  3. Create a small TRX out of that.
  4. Append to the empty TRX you created in step 0
  5. Delete the LazyTractogram.
  6. Repeat steps 1-4 until done.
  7. Optional: Resize if you preallocated (a lot more efficient if this thing is going to be big enough).

But this should eventually be superseded by resolving this issue.

@arokem arokem added the good first issue Good for newcomers label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant