fusion-tools 2.3.2__tar.gz → 2.3.3__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.
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/PKG-INFO +1 -1
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/setup.py +1 -1
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/feature_extraction.py +15 -15
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/PKG-INFO +1 -1
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_feature_extraction.py +4 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/LICENSE +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/README.md +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/pyproject.toml +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/setup.cfg +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/__init__.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/__init__.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/maps.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/segmentation.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/tools.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/dataset.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/handler.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/tileserver.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/__init__.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/omics.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/shapes.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/stats.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/__init__.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/components.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/vis_utils.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/SOURCES.txt +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/dependency_links.txt +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/requires.txt +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/top_level.txt +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_classification_model.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_custom_component.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_dataset_classes.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_extract_nested_prop.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_feature_annotation.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_generate_property_dict.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_get_gene_info.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_hra_viewer.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_image_overlay.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_model_train.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_multiframe_rgb.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_multiframeslidemap.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_property_plotter.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_read_anndata.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_remote_slide_annotations.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_remote_tileserver.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_segmentation.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_slide_annotations.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_spatial_aggregation.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_tile_server.py +0 -0
- {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_visualization_component.py +0 -0
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="fusion-tools",
|
|
8
|
-
version="2.3.
|
|
8
|
+
version="2.3.3",
|
|
9
9
|
author="Sam Border",
|
|
10
10
|
author_email="sam.border2256@gmail.com",
|
|
11
11
|
description="Modular visualization and analysis dashboard creation for high-resolution microscopy images",
|
|
@@ -97,7 +97,7 @@ class ParallelFeatureExtractor:
|
|
|
97
97
|
if not self.mask_names is None:
|
|
98
98
|
convert_key = {f'Mask {float(idx+1)}': i for idx,i in enumerate(self.mask_names)}
|
|
99
99
|
if not self.channel_names is None:
|
|
100
|
-
convert_key = convert_key | {f'Channel {
|
|
100
|
+
convert_key = convert_key | {f'Channel {idx}': i for idx,i in enumerate(self.channel_names)}
|
|
101
101
|
|
|
102
102
|
def convert_dict_key(pre_convert):
|
|
103
103
|
if pre_convert in convert_key:
|
|
@@ -308,10 +308,10 @@ def color_features(image:np.ndarray, mask: np.ndarray, coords:list)->dict:
|
|
|
308
308
|
mask_regions = (mask==m)
|
|
309
309
|
masked_channels = image[mask_regions>0]
|
|
310
310
|
|
|
311
|
-
mean_vals = np.nanmean(masked_channels,axis=0).tolist()
|
|
312
|
-
median_vals = np.nanmedian(masked_channels,axis=0).tolist()
|
|
313
|
-
max_vals = np.nanmedian(masked_channels,axis=0).tolist()
|
|
314
|
-
std_vals = np.nanstd(masked_channels,axis=0).tolist()
|
|
311
|
+
mean_vals = np.nanmean(masked_channels,axis=0).astype(float).tolist()
|
|
312
|
+
median_vals = np.nanmedian(masked_channels,axis=0).astype(float).tolist()
|
|
313
|
+
max_vals = np.nanmedian(masked_channels,axis=0).astype(float).tolist()
|
|
314
|
+
std_vals = np.nanstd(masked_channels,axis=0).astype(float).tolist()
|
|
315
315
|
|
|
316
316
|
feature_values[f'Mask {m}'] = {}
|
|
317
317
|
for c_idx,(m1,m2,m3,s) in enumerate(zip(mean_vals, median_vals, max_vals, std_vals)):
|
|
@@ -350,7 +350,7 @@ def texture_features(image:np.ndarray, mask:np.ndarray, coords: list)->dict:
|
|
|
350
350
|
for t in texture_features:
|
|
351
351
|
t_value = graycoprops(texture_matrix,t.lower())[0][0]
|
|
352
352
|
|
|
353
|
-
feature_values[f'Mask {m}'][f'Channel {c}'][t] = t_value
|
|
353
|
+
feature_values[f'Mask {m}'][f'Channel {c}'][t] = float(t_value)
|
|
354
354
|
|
|
355
355
|
return feature_values
|
|
356
356
|
|
|
@@ -383,10 +383,10 @@ def morphological_features(image:np.ndarray,mask:np.ndarray,coords:list)->dict:
|
|
|
383
383
|
feature_values[f'Mask {m}'] = {'Count': props.shape[0]}
|
|
384
384
|
for p in props.columns.tolist():
|
|
385
385
|
feature_values[f'Mask {m}'][p] = {
|
|
386
|
-
'Mean': props[p].mean(),
|
|
387
|
-
'Median': props[p].median(),
|
|
388
|
-
'Max': props[p].max(),
|
|
389
|
-
'Min': props[p].min()
|
|
386
|
+
'Mean': float(props[p].mean()),
|
|
387
|
+
'Median': float(props[p].median()),
|
|
388
|
+
'Max': float(props[p].max()),
|
|
389
|
+
'Min': float(props[p].min())
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
return feature_values
|
|
@@ -413,11 +413,11 @@ def relative_distance(input_shapes:dict, other_shapes:Union[dict,list])->list:
|
|
|
413
413
|
all_dist.extend(other_fc.distance(shape(f['geometry'])))
|
|
414
414
|
|
|
415
415
|
distance_stats.append({
|
|
416
|
-
'Min': np.min(all_dist),
|
|
417
|
-
'Max': np.max(all_dist),
|
|
418
|
-
'Mean': np.mean(all_dist),
|
|
419
|
-
'Median': np.median(all_dist),
|
|
420
|
-
'Std': np.std(all_dist)
|
|
416
|
+
'Min': float(np.min(all_dist)),
|
|
417
|
+
'Max': float(np.max(all_dist)),
|
|
418
|
+
'Mean': float(np.mean(all_dist)),
|
|
419
|
+
'Median': float(np.median(all_dist)),
|
|
420
|
+
'Std': float(np.std(all_dist))
|
|
421
421
|
})
|
|
422
422
|
|
|
423
423
|
return distance_stats
|
|
@@ -151,6 +151,8 @@ def main():
|
|
|
151
151
|
],
|
|
152
152
|
preprocess = None,
|
|
153
153
|
sub_mask = lambda image,mask: stain_mask(image,mask),
|
|
154
|
+
mask_names = ['Nuclei','Eosinophilic','Luminal Space'],
|
|
155
|
+
channel_names = ['Red','Green','Blue'],
|
|
154
156
|
n_jobs = 4,
|
|
155
157
|
verbose = True
|
|
156
158
|
)
|
|
@@ -158,6 +160,8 @@ def main():
|
|
|
158
160
|
feature_df = feature_extractor.start(annotations[0]['features'])
|
|
159
161
|
|
|
160
162
|
print(feature_df)
|
|
163
|
+
import json
|
|
164
|
+
print(json.dumps(feature_df.to_dict('records'),indent=4))
|
|
161
165
|
feature_df.to_csv('.\\tests\\test_features.csv')
|
|
162
166
|
|
|
163
167
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|