Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scilpy import SCILPY_HOME
from scilpy.io.fetcher import fetch_data, get_testing_files_dict
from scilpy.io.streamlines import load_tractogram_with_reference

# If they already exist, this only takes 5 seconds (check md5sum)
fetch_data(get_testing_files_dict(), keys=['connectivity.zip'])
Expand All @@ -31,3 +32,8 @@ def test_execution_connectivity(script_runner, monkeypatch):
'--save_final', '--out_dir',
os.path.join(tmp_dir.name, 'out_bundles')])
assert ret.success
# Ensure self-connections (i, i) are not duplicated (raw 314, not 628)
sft_9_9 = load_tractogram_with_reference(
None, None,
os.path.join(tmp_dir.name, 'out_bundles', 'final_connections', '9_9.trk'))
assert len(sft_9_9) == 314
2 changes: 1 addition & 1 deletion src/scilpy/tractanalysis/connectivity_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def construct_hdf5_from_connectivity(
pair_info = []
if out_label in con_info[in_label]:
pair_info.extend(con_info[in_label][out_label])
if in_label in con_info[out_label]:
if in_label != out_label and in_label in con_info[out_label]:
pair_info.extend(con_info[out_label][in_label])
if len(pair_info) == 0:
logging.debug("No streamlines found for this connection: not "
Expand Down
Loading