-
Notifications
You must be signed in to change notification settings - Fork 60
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
Connectivity: compute_matrices script #1031
base: master
Are you sure you want to change the base?
Conversation
90a8de5
to
6cff089
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1031 +/- ##
==========================================
+ Coverage 68.89% 68.99% +0.09%
==========================================
Files 434 435 +1
Lines 22646 22662 +16
Branches 3078 3077 -1
==========================================
+ Hits 15603 15635 +32
+ Misses 5727 5710 -17
- Partials 1316 1317 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the new script on older data to compare before vs after.
My command was scil_connectivity_compute_matrices.py Transform_Data/sub-001_ses-1__decompose_warped_mni.h5 Transform_Data/sub-001_ses-1__labels_warped_mni_int16.nii.gz --volume vol.npy --streamline_count sc.npy --length len.npy --metrics Transform_Metrics/sub-001_ses-1__fa_mni.nii.gz fa.npy --include_dps dps -f
(works with the master)
This is my error:
Traceback (most recent call last):
File "/home/rhef1902/VirtualEnvs/basic_scilpy_3_10/bin/scil_connectivity_compute_matrices.py", line 33, in <module>
sys.exit(load_entry_point('scilpy', 'console_scripts', 'scil_connectivity_compute_matrices.py')())
File "/home/rhef1902/Libraries/scilpy/scripts/scil_connectivity_compute_matrices.py", line 260, in main
outputs.append(compute_connectivity_matrices_from_hdf5(
File "/home/rhef1902/Libraries/scilpy/scilpy/connectivity/connectivity.py", line 188, in compute_connectivity_matrices_from_hdf5
for dps_key in hdf5_file[key].keys():
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/rhef1902/VirtualEnvs/basic_scilpy_3_10/lib/python3.10/site-packages/h5py/_hl/group.py", line 357, in __getitem__
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5o.pyx", line 189, in h5py.h5o.open
KeyError: 'Unable to synchronously open object (invalid identifier type to function)'
I am one Python 3.10.12 (and I got the same error in Python 3.11.6)
Could you please send me your data? Thanks! |
8b80520
to
a112c4f
Compare
Refactored the scil_connectivity_compute_matrices.py script:
connectivity.connectivity
fileconnectivity.connectivity_tools
toconnectivity.matrix_too0
ls)scil_connectivity_compute_simple_matrix.py
, which does not exist, but in the end I think that this PR is big enough. Will add it soon in another PR.--maps
option, as discussed with François and Arnaud offline.-len(label_list)
could end up in a negative number of total_elem if some diagonal values were not found.In short, the code is simplified a lot, but the result should be exactly the same, if you want to test with some data!