dbdicom 0.2.0__py3-none-any.whl → 0.3.16__py3-none-any.whl
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.
- dbdicom/__init__.py +3 -25
- dbdicom/api.py +496 -0
- dbdicom/const.py +144 -0
- dbdicom/database.py +133 -0
- dbdicom/dataset.py +471 -0
- dbdicom/dbd.py +1290 -0
- dbdicom/external/__pycache__/__init__.cpython-311.pyc +0 -0
- dbdicom/external/dcm4che/__pycache__/__init__.cpython-311.pyc +0 -0
- dbdicom/external/dcm4che/bin/__pycache__/__init__.cpython-311.pyc +0 -0
- dbdicom/external/dcm4che/bin/emf2sf +57 -57
- dbdicom/register.py +402 -0
- dbdicom/{ds/types → sop_classes}/ct_image.py +2 -16
- dbdicom/{ds/types → sop_classes}/enhanced_mr_image.py +206 -160
- dbdicom/sop_classes/mr_image.py +338 -0
- dbdicom/sop_classes/parametric_map.py +381 -0
- dbdicom/sop_classes/secondary_capture.py +140 -0
- dbdicom/sop_classes/segmentation.py +311 -0
- dbdicom/{ds/types → sop_classes}/ultrasound_multiframe_image.py +1 -15
- dbdicom/{ds/types → sop_classes}/xray_angiographic_image.py +2 -17
- dbdicom/utils/arrays.py +142 -0
- dbdicom/utils/files.py +0 -20
- dbdicom/utils/image.py +43 -466
- dbdicom/utils/pydicom_dataset.py +386 -0
- dbdicom-0.3.16.dist-info/METADATA +26 -0
- dbdicom-0.3.16.dist-info/RECORD +54 -0
- {dbdicom-0.2.0.dist-info → dbdicom-0.3.16.dist-info}/WHEEL +1 -1
- dbdicom/create.py +0 -450
- dbdicom/ds/__init__.py +0 -10
- dbdicom/ds/create.py +0 -63
- dbdicom/ds/dataset.py +0 -841
- dbdicom/ds/dictionaries.py +0 -620
- dbdicom/ds/types/mr_image.py +0 -267
- dbdicom/ds/types/parametric_map.py +0 -226
- dbdicom/external/__pycache__/__init__.cpython-310.pyc +0 -0
- dbdicom/external/__pycache__/__init__.cpython-37.pyc +0 -0
- dbdicom/external/dcm4che/__pycache__/__init__.cpython-310.pyc +0 -0
- dbdicom/external/dcm4che/__pycache__/__init__.cpython-37.pyc +0 -0
- dbdicom/external/dcm4che/bin/__pycache__/__init__.cpython-310.pyc +0 -0
- dbdicom/external/dcm4che/bin/__pycache__/__init__.cpython-37.pyc +0 -0
- dbdicom/external/dcm4che/lib/linux-x86/libclib_jiio.so +0 -0
- dbdicom/external/dcm4che/lib/linux-x86-64/libclib_jiio.so +0 -0
- dbdicom/external/dcm4che/lib/linux-x86-64/libopencv_java.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparc/libclib_jiio.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparc/libclib_jiio_vis.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparc/libclib_jiio_vis2.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparcv9/libclib_jiio.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparcv9/libclib_jiio_vis.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-sparcv9/libclib_jiio_vis2.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-x86/libclib_jiio.so +0 -0
- dbdicom/external/dcm4che/lib/solaris-x86-64/libclib_jiio.so +0 -0
- dbdicom/manager.py +0 -2077
- dbdicom/message.py +0 -119
- dbdicom/record.py +0 -1526
- dbdicom/types/database.py +0 -107
- dbdicom/types/instance.py +0 -184
- dbdicom/types/patient.py +0 -40
- dbdicom/types/series.py +0 -816
- dbdicom/types/study.py +0 -58
- dbdicom/utils/variables.py +0 -155
- dbdicom/utils/vreg.py +0 -2626
- dbdicom/wrappers/__init__.py +0 -7
- dbdicom/wrappers/dipy.py +0 -462
- dbdicom/wrappers/elastix.py +0 -855
- dbdicom/wrappers/numpy.py +0 -119
- dbdicom/wrappers/scipy.py +0 -1413
- dbdicom/wrappers/skimage.py +0 -1030
- dbdicom/wrappers/sklearn.py +0 -151
- dbdicom/wrappers/vreg.py +0 -273
- dbdicom-0.2.0.dist-info/METADATA +0 -276
- dbdicom-0.2.0.dist-info/RECORD +0 -81
- {dbdicom-0.2.0.dist-info → dbdicom-0.3.16.dist-info/licenses}/LICENSE +0 -0
- {dbdicom-0.2.0.dist-info → dbdicom-0.3.16.dist-info}/top_level.txt +0 -0
dbdicom/wrappers/numpy.py
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Functions for a new (sub)package dbimage inside dbdicom
|
|
3
|
-
|
|
4
|
-
A set of dbdicom wrappers for numpy
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def mean_intensity_projection(series):
|
|
11
|
-
"""
|
|
12
|
-
Segment by thresholding
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
series: dbdicom series (4D: slice + time)
|
|
17
|
-
|
|
18
|
-
Returns
|
|
19
|
-
-------
|
|
20
|
-
mean : dbdicom series (3D)
|
|
21
|
-
|
|
22
|
-
Example:
|
|
23
|
-
|
|
24
|
-
mean_series = mean(series, axis=-1)
|
|
25
|
-
"""
|
|
26
|
-
# Get numpy array with dimensions (slice, time, x, y)
|
|
27
|
-
# array = series.array('SliceLocation')
|
|
28
|
-
|
|
29
|
-
# Get numpy array with dimensions (x, y, slice, time)
|
|
30
|
-
array, headers = series.array('SliceLocation', pixels_first=True)
|
|
31
|
-
array = np.mean(array, axis=-1)
|
|
32
|
-
desc = series.instance().SeriesDescription + ' [Mean Intensity Projection]'
|
|
33
|
-
new_series = series.new_sibling(SeriesDescription=desc)
|
|
34
|
-
new_series.set_array(array, headers[:,0], pixels_first=True)
|
|
35
|
-
return new_series
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def maximum_intensity_projection(series):
|
|
39
|
-
"""
|
|
40
|
-
Segment by thresholding
|
|
41
|
-
|
|
42
|
-
Parameters
|
|
43
|
-
----------
|
|
44
|
-
series: dbdicom series (4D: slice + time)
|
|
45
|
-
|
|
46
|
-
Returns
|
|
47
|
-
-------
|
|
48
|
-
mean : dbdicom series (3D)
|
|
49
|
-
|
|
50
|
-
Example:
|
|
51
|
-
|
|
52
|
-
mean_series = mean(series, axis=-1)
|
|
53
|
-
"""
|
|
54
|
-
# Get numpy array with dimensions (slice, time, x, y)
|
|
55
|
-
# array = series.array('SliceLocation')
|
|
56
|
-
|
|
57
|
-
# Get numpy array with dimensions (x, y, slice, time)
|
|
58
|
-
array, headers = series.array('SliceLocation', pixels_first=True)
|
|
59
|
-
array = np.amax(array, axis=-1)
|
|
60
|
-
desc = series.instance().SeriesDescription + ' [Maximum Intensity Projection]'
|
|
61
|
-
new_series = series.new_sibling(SeriesDescription=desc)
|
|
62
|
-
new_series.set_array(array, headers[:,0], pixels_first=True)
|
|
63
|
-
return new_series
|
|
64
|
-
|
|
65
|
-
def norm_projection(series, ord=None):
|
|
66
|
-
array, headers = series.array('SliceLocation', pixels_first=True)
|
|
67
|
-
array = np.linalg.norm(array, ord=ord, axis=-1)
|
|
68
|
-
desc = series.instance().SeriesDescription + ' [Norm projection]'
|
|
69
|
-
new_series = series.new_sibling(SeriesDescription=desc)
|
|
70
|
-
new_series.set_array(array, headers[:,0], pixels_first=True)
|
|
71
|
-
return new_series
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def threshold(input, low_threshold=0, high_threshold=1, method='absolute'):
|
|
76
|
-
"""
|
|
77
|
-
Segment by thresholding
|
|
78
|
-
|
|
79
|
-
Parameters
|
|
80
|
-
----------
|
|
81
|
-
input: dbdicom series
|
|
82
|
-
|
|
83
|
-
Returns
|
|
84
|
-
-------
|
|
85
|
-
filtered : dbdicom series
|
|
86
|
-
"""
|
|
87
|
-
suffix = ' [Threshold segmentation]'
|
|
88
|
-
desc = input.instance().SeriesDescription
|
|
89
|
-
filtered = input.copy(SeriesDescription = desc+suffix)
|
|
90
|
-
#images = filtered.instances()
|
|
91
|
-
images = filtered.images()
|
|
92
|
-
for i, image in enumerate(images):
|
|
93
|
-
input.status.progress(i+1, len(images), 'Filtering ' + desc)
|
|
94
|
-
image.read()
|
|
95
|
-
array = image.array()
|
|
96
|
-
if method == 'quantiles':
|
|
97
|
-
range = np.quantile(array, [low_threshold, high_threshold])
|
|
98
|
-
elif method == 'range':
|
|
99
|
-
min, max = np.amin(array), np.amax(array)
|
|
100
|
-
range = [min+low_threshold*(max-min), min+high_threshold*(max-min)]
|
|
101
|
-
else:
|
|
102
|
-
range = [low_threshold, high_threshold]
|
|
103
|
-
array = np.logical_and(array > range[0], array < range[1])
|
|
104
|
-
image.set_array(array)
|
|
105
|
-
array = array.astype(np.ubyte)
|
|
106
|
-
_reset_window(image, array)
|
|
107
|
-
image.clear()
|
|
108
|
-
input.status.hide()
|
|
109
|
-
return filtered
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
# Helper functions
|
|
114
|
-
|
|
115
|
-
def _reset_window(image, array):
|
|
116
|
-
min = np.amin(array)
|
|
117
|
-
max = np.amax(array)
|
|
118
|
-
image.WindowCenter= (max+min)/2
|
|
119
|
-
image.WindowWidth = 0.9*(max-min)
|