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.
Files changed (49) hide show
  1. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/PKG-INFO +1 -1
  2. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/setup.py +1 -1
  3. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/feature_extraction.py +15 -15
  4. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/PKG-INFO +1 -1
  5. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_feature_extraction.py +4 -0
  6. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/LICENSE +0 -0
  7. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/README.md +0 -0
  8. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/pyproject.toml +0 -0
  9. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/setup.cfg +0 -0
  10. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/__init__.py +0 -0
  11. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/__init__.py +0 -0
  12. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/maps.py +0 -0
  13. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/segmentation.py +0 -0
  14. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/components/tools.py +0 -0
  15. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/dataset.py +0 -0
  16. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/handler.py +0 -0
  17. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/tileserver.py +0 -0
  18. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/__init__.py +0 -0
  19. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/omics.py +0 -0
  20. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/shapes.py +0 -0
  21. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/utils/stats.py +0 -0
  22. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/__init__.py +0 -0
  23. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/components.py +0 -0
  24. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools/visualization/vis_utils.py +0 -0
  25. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/SOURCES.txt +0 -0
  26. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/dependency_links.txt +0 -0
  27. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/requires.txt +0 -0
  28. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/src/fusion_tools.egg-info/top_level.txt +0 -0
  29. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_classification_model.py +0 -0
  30. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_custom_component.py +0 -0
  31. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_dataset_classes.py +0 -0
  32. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_extract_nested_prop.py +0 -0
  33. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_feature_annotation.py +0 -0
  34. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_generate_property_dict.py +0 -0
  35. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_get_gene_info.py +0 -0
  36. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_hra_viewer.py +0 -0
  37. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_image_overlay.py +0 -0
  38. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_model_train.py +0 -0
  39. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_multiframe_rgb.py +0 -0
  40. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_multiframeslidemap.py +0 -0
  41. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_property_plotter.py +0 -0
  42. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_read_anndata.py +0 -0
  43. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_remote_slide_annotations.py +0 -0
  44. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_remote_tileserver.py +0 -0
  45. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_segmentation.py +0 -0
  46. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_slide_annotations.py +0 -0
  47. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_spatial_aggregation.py +0 -0
  48. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_tile_server.py +0 -0
  49. {fusion_tools-2.3.2 → fusion_tools-2.3.3}/tests/test_visualization_component.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fusion-tools
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: Modular visualization and analysis dashboard creation for high-resolution microscopy images
5
5
  Home-page: https://github.com/spborder/fusion-tools
6
6
  Author: Sam Border
@@ -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.2",
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 {float(idx+1)}': i for idx,i in enumerate(self.channel_names)}
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fusion-tools
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: Modular visualization and analysis dashboard creation for high-resolution microscopy images
5
5
  Home-page: https://github.com/spborder/fusion-tools
6
6
  Author: Sam Border
@@ -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