Skip to content
Snippets Groups Projects
Commit ca709159 authored by Kimberly Isobel Meechan's avatar Kimberly Isobel Meechan
Browse files

Changed to shape_pixelsize, no n_pixels in table

parent 46268e2c
No related branches found
No related tags found
1 merge request!9Morphology
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
from datetime import datetime from datetime import datetime
#TODO - uncomment this part
# this is a task called by multiple processes, # this is a task called by multiple processes,
# so we need to restrict the number of threads used by numpy # so we need to restrict the number of threads used by numpy
from cluster_tools.utils.numpy_utils import set_numpy_threads #from cluster_tools.utils.numpy_utils import set_numpy_threads
set_numpy_threads(1) #set_numpy_threads(1)
import numpy as np import numpy as np
import h5py import h5py
...@@ -31,11 +32,12 @@ def get_scale_factor(path, key_full, key, resolution): ...@@ -31,11 +32,12 @@ def get_scale_factor(path, key_full, key, resolution):
return scale_factor return scale_factor
# changed to shape_pixel_size, is the plan to go to n_pixels in future?
def filter_table(table, min_size, max_size): def filter_table(table, min_size, max_size):
if max_size is None: if max_size is None:
table = table.loc[table['n_pixels'] >= min_size, :] table = table.loc[table['shape_pixelsize'] >= min_size, :]
else: else:
criteria = np.logical_and(table['n_pixels'] > min_size, table['n_pixels'] < max_size) criteria = np.logical_and(table['shape_pixelsize'] > min_size, table['shape_pixelsize'] < max_size)
table = table.loc[criteria, :] table = table.loc[criteria, :]
return table return table
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment