Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support single z-stack tif file for input #88

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions brainglobe_workflows/brainmapper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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]
)

Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions brainglobe_workflows/cellfinder_core/cellfinder_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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 (
Expand Down Expand Up @@ -356,7 +356,7 @@ def run_workflow_from_cellfinder_run(cfg: CellfinderConfig):

The steps are:
1. Read the input signal and background data as two separate
Dask arrays.
Dask (or memory if single file stack) arrays.
alessandrofelder marked this conversation as resolved.
Show resolved Hide resolved
2. Run the main cellfinder pipeline on the input Dask arrays,
alessandrofelder marked this conversation as resolved.
Show resolved Hide resolved
with the parameters defined in the input configuration (cfg).
3. Save the detected cells as an xml file to the location specified in
Expand All @@ -369,8 +369,8 @@ def run_workflow_from_cellfinder_run(cfg: CellfinderConfig):
the cellfinder workflow
"""
# Read input data as Dask arrays
alessandrofelder marked this conversation as resolved.
Show resolved Hide resolved
signal_array = read_with_dask(str(cfg._signal_dir_path))
background_array = read_with_dask(str(cfg._background_dir_path))
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(
Expand Down
Loading