mirror of
https://github.com/13hannes11/situr.git
synced 2024-09-03 20:50:58 +02:00
add showing peaks with scatterplot
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
setup.py
1
setup.py
@@ -10,6 +10,7 @@ setup(name='situr',
|
||||
packages=find_namespace_packages(include=['situr.*']),
|
||||
install_requires=[
|
||||
'numpy>=1.21.0',
|
||||
'matplotlib>=3.4.0',
|
||||
'open3d>=0.13.0',
|
||||
'Pillow>=8.3.1',
|
||||
'scikit-image>=0.18.2',
|
||||
|
||||
@@ -3,6 +3,7 @@ from PIL import Image, ImageDraw
|
||||
from skimage import img_as_float
|
||||
from skimage.feature import blob_dog
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
from situr.image.situ_image import SituImage
|
||||
|
||||
@@ -30,6 +31,18 @@ class PeakFinder:
|
||||
"""
|
||||
return self.find_peaks(img.get_data()[channel, focus_level, :, :])
|
||||
|
||||
def scatterplot_channel_peaks(self,
|
||||
img: SituImage,
|
||||
channel: int,
|
||||
focus_level: int = 0,
|
||||
color='b'):
|
||||
peaks = self.get_channel_peaks(img, channel, focus_level)
|
||||
|
||||
# TODO: test with non square image if right coordinates
|
||||
plt.xlim(0, img.get_focus_level(0, 0).shape[1])
|
||||
plt.ylim(0, img.get_focus_level(0, 0).shape[0])
|
||||
plt.scatter(peaks[:, 0], peaks[:, 1], color=color)
|
||||
|
||||
def show_channel_peaks(self,
|
||||
img: SituImage,
|
||||
channel: int,
|
||||
|
||||
Reference in New Issue
Block a user