pyLQT 1.0.dev4__tar.gz → 1.0.dev6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pylqt-1.0.dev4/src/pyLQT.egg-info → pylqt-1.0.dev6}/PKG-INFO +1 -1
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/pyproject.toml +1 -1
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/cli.py +1 -1
- {pylqt-1.0.dev4/src/pyLQT/lesion_metrics/gray_matter → pylqt-1.0.dev6/src/pyLQT/lesion_metrics/grey_matter}/metrics.py +5 -4
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/utils/downloads.py +1 -1
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/pipeline.py +22 -1
- {pylqt-1.0.dev4 → pylqt-1.0.dev6/src/pyLQT.egg-info}/PKG-INFO +1 -1
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT.egg-info/SOURCES.txt +3 -3
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/LICENSE +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/README.md +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/setup.cfg +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/__init__.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/__init__.py +0 -0
- {pylqt-1.0.dev4/src/pyLQT/lesion_metrics/gray_matter → pylqt-1.0.dev6/src/pyLQT/lesion_metrics/grey_matter}/__init__.py +0 -0
- {pylqt-1.0.dev4/src/pyLQT/lesion_metrics/gray_matter → pylqt-1.0.dev6/src/pyLQT/lesion_metrics/grey_matter}/utils.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/network/__init__.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/network/metrics.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/network/utils.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/utils/__init__.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/utils/configs.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/utils/registration.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/white_matter/__init__.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/white_matter/metrics.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT/lesion_metrics/white_matter/utils.py +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT.egg-info/dependency_links.txt +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT.egg-info/entry_points.txt +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT.egg-info/requires.txt +0 -0
- {pylqt-1.0.dev4 → pylqt-1.0.dev6}/src/pyLQT.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyLQT
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.dev6
|
|
4
4
|
Summary: Python version of LQT from Griffis et al. 2021 (https://www.sciencedirect.com/science/article/pii/S2213158221000838)
|
|
5
5
|
Author-email: Antonin HUDRY <hudryantoninm@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -12,6 +12,7 @@ def get_parcel_damage(
|
|
|
12
12
|
parcel_column,
|
|
13
13
|
out_path = None
|
|
14
14
|
):
|
|
15
|
+
|
|
15
16
|
"""Compute lesion damage for each parcel of an atlas.
|
|
16
17
|
|
|
17
18
|
The lesion is resampled to the atlas grid, and the proportion of
|
|
@@ -39,7 +40,7 @@ def get_parcel_damage(
|
|
|
39
40
|
Returns
|
|
40
41
|
-------
|
|
41
42
|
pandas.DataFrame
|
|
42
|
-
Copy of ``atlas_labels`` with an additional ``
|
|
43
|
+
Copy of ``atlas_labels`` with an additional ``Damage``
|
|
43
44
|
column containing the proportion of each parcel affected by the
|
|
44
45
|
lesion.
|
|
45
46
|
"""
|
|
@@ -56,10 +57,10 @@ def get_parcel_damage(
|
|
|
56
57
|
|
|
57
58
|
for parcel in atlas_labels[parcel_column]:
|
|
58
59
|
parcel_volume = atlas_volume == parcel
|
|
59
|
-
parcel_damage = compute_parcel_damage(parcel_volume, lesion_volume)
|
|
60
|
+
parcel_damage = np.round(compute_parcel_damage(parcel_volume, lesion_volume), 5)
|
|
60
61
|
|
|
61
62
|
parcel_damages.append(parcel_damage)
|
|
62
|
-
parcel_damage_map[parcel_volume] =
|
|
63
|
+
parcel_damage_map[parcel_volume] = parcel_damage
|
|
63
64
|
|
|
64
65
|
if out_path:
|
|
65
66
|
out_path.mkdir(parents=True, exist_ok=True)
|
|
@@ -70,7 +71,7 @@ def get_parcel_damage(
|
|
|
70
71
|
)
|
|
71
72
|
|
|
72
73
|
damage_frame = atlas_labels.copy(deep=True)
|
|
73
|
-
damage_frame["
|
|
74
|
+
damage_frame["Damage"] = parcel_damages
|
|
74
75
|
if out_path:
|
|
75
76
|
damage_frame.to_csv(out_path / 'parcel_damage_frame.csv', index=False)
|
|
76
77
|
|
|
@@ -189,7 +189,7 @@ def default_atlas_download(out_folder: Path):
|
|
|
189
189
|
config = {
|
|
190
190
|
"name": "glasser360",
|
|
191
191
|
"atlas": "glasser360_MNI152NLin2009cAsym.nii.gz",
|
|
192
|
-
"
|
|
192
|
+
"labels": "glasser360_labels.csv",
|
|
193
193
|
"space": "MNI152NLin2009cAsym"
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from pyLQT.lesion_metrics.white_matter.metrics import get_tracts_disconnections_severity, get_tracts_disconnections_map
|
|
2
2
|
from pyLQT.lesion_metrics.white_matter.utils import get_streamlines_disconnection, get_aggregated_tracts, clip_tractogram_to_grid
|
|
3
3
|
from pyLQT.lesion_metrics.network.metrics import get_sspl_increase, get_parcel_wise_disconnection_severity
|
|
4
|
-
from pyLQT.lesion_metrics.
|
|
4
|
+
from pyLQT.lesion_metrics.grey_matter.metrics import get_parcel_damage
|
|
5
5
|
from pyLQT.lesion_metrics.utils.configs import atlas_cfg_read, tracts_cfg_read, lesion_cfg_read
|
|
6
6
|
from pyLQT.lesion_metrics.utils.downloads import default_tracts_download, default_atlas_download, create_tract_list, uncompress_trk_gz, get_ref_space_tf
|
|
7
7
|
from pyLQT.lesion_metrics.utils.registration import register_affine, register_syn
|
|
@@ -83,7 +83,28 @@ def run_pyLQT(
|
|
|
83
83
|
tracts_ref_space = nib.load(tracts_space)
|
|
84
84
|
else:
|
|
85
85
|
tracts_ref_space = get_ref_space_tf(tracts_space)
|
|
86
|
+
|
|
87
|
+
#### TEST ####
|
|
88
|
+
import numpy as np
|
|
89
|
+
from nibabel.orientations import aff2axcodes
|
|
90
|
+
for lesion_path in lesion_folder.glob("*.nii*"):
|
|
91
|
+
lesion = nib.load(lesion_path)
|
|
92
|
+
|
|
93
|
+
print("Lesion shape:", lesion.shape)
|
|
94
|
+
print("Moving reference shape:", lesion_ref_space.shape)
|
|
86
95
|
|
|
96
|
+
print("Lesion affine:\n", lesion.affine)
|
|
97
|
+
print("Moving reference affine:\n", lesion_ref_space.affine)
|
|
98
|
+
|
|
99
|
+
print(
|
|
100
|
+
"Same grid:",
|
|
101
|
+
lesion.shape == lesion_ref_space.shape
|
|
102
|
+
and np.allclose(lesion.affine, lesion_ref_space.affine),
|
|
103
|
+
)
|
|
104
|
+
print("Lesion:", aff2axcodes(lesion.affine))
|
|
105
|
+
print("Moving reference:", aff2axcodes(lesion_ref_space.affine))
|
|
106
|
+
#### TEST ####
|
|
107
|
+
|
|
87
108
|
registrator = (register_affine if registration_type == "affine" else register_syn)
|
|
88
109
|
|
|
89
110
|
lesion_tracts_mapping = registrator(lesion_ref_space, tracts_ref_space)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyLQT
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.dev6
|
|
4
4
|
Summary: Python version of LQT from Griffis et al. 2021 (https://www.sciencedirect.com/science/article/pii/S2213158221000838)
|
|
5
5
|
Author-email: Antonin HUDRY <hudryantoninm@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -11,9 +11,9 @@ src/pyLQT.egg-info/entry_points.txt
|
|
|
11
11
|
src/pyLQT.egg-info/requires.txt
|
|
12
12
|
src/pyLQT.egg-info/top_level.txt
|
|
13
13
|
src/pyLQT/lesion_metrics/__init__.py
|
|
14
|
-
src/pyLQT/lesion_metrics/
|
|
15
|
-
src/pyLQT/lesion_metrics/
|
|
16
|
-
src/pyLQT/lesion_metrics/
|
|
14
|
+
src/pyLQT/lesion_metrics/grey_matter/__init__.py
|
|
15
|
+
src/pyLQT/lesion_metrics/grey_matter/metrics.py
|
|
16
|
+
src/pyLQT/lesion_metrics/grey_matter/utils.py
|
|
17
17
|
src/pyLQT/lesion_metrics/network/__init__.py
|
|
18
18
|
src/pyLQT/lesion_metrics/network/metrics.py
|
|
19
19
|
src/pyLQT/lesion_metrics/network/utils.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|