diff --git a/brainglobe_workflows/brainmapper/main.py b/brainglobe_workflows/brainmapper/main.py index ad82ecde..df344fdb 100644 --- a/brainglobe_workflows/brainmapper/main.py +++ b/brainglobe_workflows/brainmapper/main.py @@ -105,7 +105,7 @@ def run_all(args, what_to_run, atlas): from cellfinder.core.classify import classify from cellfinder.core.detect import detect from cellfinder.core.tools import prep - from cellfinder.core.tools.IO import read_with_dask + from cellfinder.core.tools.IO import read_z_stack from brainglobe_workflows.brainmapper import analyse from brainglobe_workflows.brainmapper.prep import ( @@ -120,7 +120,7 @@ def run_all(args, what_to_run, atlas): if what_to_run.detect: logging.info("Detecting cell candidates") args = prep_candidate_detection(args) - signal_array = read_with_dask( + signal_array = read_z_stack( args.signal_planes_paths[args.signal_channel] ) @@ -165,11 +165,11 @@ def run_all(args, what_to_run, atlas): if points is None: points = get_cells(args.paths.detected_points) if signal_array is None: - signal_array = read_with_dask( + signal_array = read_z_stack( args.signal_planes_paths[args.signal_channel] ) logging.info("Running cell classification") - background_array = read_with_dask(args.background_planes_path[0]) + background_array = read_z_stack(args.background_planes_path[0]) points = classify.main( points, diff --git a/brainglobe_workflows/cellfinder/cellfinder.py b/brainglobe_workflows/cellfinder/cellfinder.py index 6a0789c5..62852a90 100644 --- a/brainglobe_workflows/cellfinder/cellfinder.py +++ b/brainglobe_workflows/cellfinder/cellfinder.py @@ -26,7 +26,7 @@ import pooch from brainglobe_utils.IO.cells import save_cells from cellfinder.core.main import main as cellfinder_run -from cellfinder.core.tools.IO import read_with_dask +from cellfinder.core.tools.IO import read_z_stack from cellfinder.core.train.train_yml import depth_type from brainglobe_workflows.utils import ( @@ -352,8 +352,8 @@ def run_workflow_from_cellfinder_run(cfg: CellfinderConfig): The steps are: 1. Read the input signal and background data as two separate - Dask arrays. - 2. Run the main cellfinder pipeline on the input Dask arrays, + Dask arrays (or in-memory numpy arrays if single file tiff stack). + 2. Run the main cellfinder pipeline on the input arrays, with the parameters defined in the input configuration (cfg). 3. Save the detected cells as an xml file to the location specified in the input configuration (cfg). @@ -364,9 +364,9 @@ def run_workflow_from_cellfinder_run(cfg: CellfinderConfig): a class with the required setup methods and parameters for the cellfinder workflow """ - # Read input data as Dask arrays - signal_array = read_with_dask(str(cfg._signal_dir_path)) - background_array = read_with_dask(str(cfg._background_dir_path)) + # Read input data as Dask or numpy arrays + signal_array = read_z_stack(str(cfg._signal_dir_path)) + background_array = read_z_stack(str(cfg._background_dir_path)) # Run main analysis using `cellfinder_run` detected_cells = cellfinder_run(