diff --git a/bigstream/features.py b/bigstream/features.py index ed93633..66f7162 100644 --- a/bigstream/features.py +++ b/bigstream/features.py @@ -1,6 +1,8 @@ import numpy as np from fishspot.filter import white_tophat, apply_foreground_mask + # from fishspot.detect import detect_spots_log + from scipy.stats.mstats import winsorize import numpy as np @@ -43,9 +45,11 @@ def detect_spots_log( #return blob_log(image, **kwargs) return chunked_blob_log(image, **kwargs) + import numpy as np from skimage.feature import blob_log + def chunked_blob_log(image, **kwargs): #sigma_list, chunk_size=(128, 128, 128), overlap=(32, 32, 32)): chunk_size=(256, 256, 256) overlap=(64, 64, 64) @@ -91,8 +95,7 @@ def blob_detection( max_blob_radius : scalar float The largest size blob you want to find in voxel units **kwargs : any additional kwargs - Passed to fishspot.detect_spots_log - + Passed to fishspot.detect_spots_log∂ Returns ------- blob_coordinates_and_intensities : nd-array Nx4 diff --git a/bigstream/transform.py b/bigstream/transform.py index 89461ef..1100296 100644 --- a/bigstream/transform.py +++ b/bigstream/transform.py @@ -125,7 +125,7 @@ def apply_transform( # execute, return as numpy array resampled = resampler.Execute(mov) - return sitk.GetArrayViewFromImage(resampled).astype(dtype) + return np.nan_to_num(sitk.GetArrayViewFromImage(resampled),nan=0.0,posinf=0.0,neginf=0.0).astype(dtype) def apply_transform_to_coordinates(