Skip to content

Conversation

@EmmaRenauld
Copy link
Contributor

@EmmaRenauld EmmaRenauld commented Oct 31, 2024

Quick description

Moved a script that I was using in dwi_ml.

To create a (streamline count) connectivity matrix directly from tractogram, without going through the whole connectivity flow process with hdf5.

Type of change

Check the relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Provide data, screenshots, command line to test (if relevant)

...

Checklist

  • My code follows the style guidelines of this project (run autopep8)
  • I added relevant citations to scripts, modules and functions docstrings and descriptions
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I moved all functions from the script file (except the argparser and main) to scilpy modules
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pep8speaks
Copy link

pep8speaks commented Oct 31, 2024

Hello @EmmaRenauld, Thank you for updating !

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-28 17:26:41 UTC

Copy link
Member

@frheault frheault left a comment

Choose a reason for hiding this comment

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

I like it ! Very useful to finally have something simpler than the other one.

@codecov
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 81.25000% with 24 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@4d7f52c). Learn more about missing BASE report.
Report is 25 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1045   +/-   ##
=========================================
  Coverage          ?   69.40%           
=========================================
  Files             ?      447           
  Lines             ?    24045           
  Branches          ?     3280           
=========================================
  Hits              ?    16688           
  Misses            ?     5961           
  Partials          ?     1396           
Components Coverage Δ
Scripts 70.26% <87.05%> (?)
Library 68.25% <69.76%> (?)

Copy link
Contributor

@arnaudbore arnaudbore left a comment

Choose a reason for hiding this comment

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

A couple of comments but LGTM

@arnaudbore arnaudbore requested a review from frheault November 18, 2024 20:59
start_labels = []
end_labels = []

for s in streamlines:
Copy link
Member

Choose a reason for hiding this comment

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

I am 99% sure this can be done for all streamlines with map_coordinates with streamlines resamples to 2 points. I think this could be a new function 'map_endpoints'.

(sft with streamlines resamples to 2 points)
data = map_coordinates(labels, sft.streamlines._data.T, order=0)
This will give an array where all the even position are starts and all the odds are ends.

(I believe it would be a lot faster)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, I agree, but I'm not very familiar with this. Can we merge and then I let you do it? (--insert praying emoji--)

Copy link
Member

Choose a reason for hiding this comment

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

That's fair, but add an issue to me (and @arnaudbore that can be on my hackathon list)

@arnaudbore arnaudbore merged commit e6775d5 into scilus:master Nov 28, 2024
2 checks passed
@EmmaRenauld EmmaRenauld deleted the simple_connectivity branch November 29, 2024 13:20
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.

4 participants