Skip to content

Commit

Permalink
add seaborn dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
peterneher committed Oct 31, 2023
1 parent d61b0c1 commit f071d09
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "radtract"
version = "0.1.12"
version = "0.1.13"
authors = [
{ name="Peter Neher", email="[email protected]" },
]
Expand All @@ -32,6 +32,7 @@ dependencies = [
'pyradiomics',
'cmdint',
'fury',
'seaborn'
]
license = { file="LICENSES/Apache-2.0.txt" }
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion radtract/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.12"
__version__ = "0.1.13"
__author__ = 'Peter Neher'
__email__ = '[email protected]'
__copyright__ = "Copyright 2023, German Cancer Research Center (DKFZ), Division of Medical Image Computing"
Expand Down
15 changes: 14 additions & 1 deletion radtract/parcellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,20 @@ def parcellate_tract(streamlines: nib.streamlines.array_sequence.ArraySequence,
for i in range(1, num_parcels+1):
if i not in assigned_parcels:
print('WARNING: empty parcel ' + str(i) + 'in file ' + out_parcellation_filename)
print('Check input tract, empty parcels are often cause by broken tracts!')

# check if streamline start and end points have same label
oriented_streamlines_voxelspace = transform_streamlines(oriented_streamlines, np.linalg.inv(affine))
count = 0
for s in oriented_streamlines_voxelspace:
p1 = s[0]
p2 = s[-1]
p1 = np.round(p1).astype('int64')
p2 = np.round(p2).astype('int64')
if envelope_data[p1[0], p1[1], p1[2]] == envelope_data[p2[0], p2[1], p2[2]]:
count += 1
if float(count)/len(oriented_streamlines) > 5:
print('WARNING: ' + str(float(count)/len(oriented_streamlines)) + '%% of streamlines have the same start and end label. This is likely caused by a broken input tract.')

parcellation = nib.Nifti1Image(envelope_data, affine=binary_envelope.affine, dtype='uint8')
if out_parcellation_filename is not None:
Expand All @@ -531,7 +545,6 @@ def parcellate_tract(streamlines: nib.streamlines.array_sequence.ArraySequence,
if save_intermediate_files:
# create colors list
colors = []
oriented_streamlines_voxelspace = transform_streamlines(oriented_streamlines, np.linalg.inv(affine))
for s in oriented_streamlines_voxelspace:
num_points = len(s)
for j in range(num_points):
Expand Down

0 comments on commit f071d09

Please sign in to comment.