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

Update metadata #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tensorflow/tensorflow:latest-gpu
LABEL maintainer="[email protected]"
RUN pip install cellfinder
RUN pip install brainglobe-workflows
CMD ["bash"]
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ exclude *.yml
exclude Dockerfile
exclude *.ini

recursive-include cellfinder *.py
include cellfinder/config/*
recursive-include brainglobe-workflows *.py
include brainglobe-workflows/config/*

global-include *.pxd

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
[![Website](https://img.shields.io/website?up_message=online&url=https%3A%2F%2Fbrainglobe.info)](https://brainglobe.info/documentation/cellfinder/index.html)
[![Twitter](https://img.shields.io/twitter/follow/brain_globe?style=social)](https://twitter.com/brain_globe)

# Cellfinder
# Brainglobe Workflows

Whole-brain cell detection, registration and analysis.

**N.B. If you want to just use the cell detection part of cellfinder, please
Expand Down
7 changes: 7 additions & 0 deletions brainglobe-workflows/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from importlib.metadata import metadata

__version__ = metadata("brainglobe_workflows")["version"]
__author__ = metadata("brainglobe_workflows")["author-email"]
__license__ = metadata("brainglobe_workflows")["license"]

del metadata
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
from bg_atlasapi import BrainGlobeAtlas
from brainglobe_utils.general.system import ensure_directory_exists
from brainglobe_utils.pandas.misc import sanitise_df

from cellfinder.export.export import export_points
from brainglobe_workflows.export.export import export_points


class Point:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from cellfinder.export.abc4d import export_points as abc4d_export
from cellfinder.export.brainrender import export_points as brainrender_export
from brainglobe_workflows.export.abc4d import export_points as abc4d_export
from brainglobe_workflows.export.brainrender import (
export_points as brainrender_export,
)


def export_points(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
from brainglobe_utils.cells.cells import group_cells_by_z
from brainglobe_utils.general.numerical import is_even
from brainglobe_utils.general.system import get_num_processes
from brainglobe_workflows.tools import image_processing as img_tools
from brainglobe_workflows.tools import system
from numpy.linalg.linalg import LinAlgError
from skimage import transform
from tifffile import tifffile
from tqdm import tqdm

from cellfinder.tools import image_processing as img_tools
from cellfinder.tools import system


class StackSizeError(Exception):
pass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from cellfinder.figures import heatmap
from brainglobe_workflows.figures import heatmap


def run(args, atlas, downsampled_shape):
Expand Down
File renamed without changes.
16 changes: 7 additions & 9 deletions cellfinder/main.py → brainglobe-workflows/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def cells_exist(points_file):

def main():
suppress_tf_logging(tf_suppress_log_messages)
from brainglobe_workflows.tools import prep
from brainreg.main import main as register

from cellfinder.tools import prep

start_time = datetime.now()
args, arg_groups, what_to_run, atlas = prep.prep_cellfinder_general()

Expand Down Expand Up @@ -100,18 +99,17 @@ def main():


def run_all(args, what_to_run, atlas):
from brainglobe_workflows.analyse import analyse
from brainglobe_workflows.figures import figures
from brainglobe_workflows.tools.prep import (
prep_candidate_detection,
prep_channel_specific_general,
)
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.analyse import analyse
from cellfinder.figures import figures
from cellfinder.tools.prep import (
prep_candidate_detection,
prep_channel_specific_general,
)

points = None
signal_array = None
args, what_to_run = prep_channel_specific_general(args, what_to_run)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
check_positive_float,
check_positive_int,
)
from brainglobe_workflows import __version__
from brainreg.cli import atlas_parse, geometry_parser, niftyreg_parse
from brainreg.cli import backend_parse as brainreg_backend_parse
from cellfinder_core.download.cli import (
Expand All @@ -24,8 +25,6 @@
)
from cellfinder_core.tools.source_files import source_custom_config_cellfinder

from cellfinder import __version__

# TODO: Gradually move all paths as strings to Path objects

models = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
from argparse import Namespace
from pathlib import PurePath

import brainglobe_workflows as program_for_log
import brainglobe_workflows.tools.parser as parser
from bg_atlasapi import BrainGlobeAtlas
from brainglobe_utils.general.exceptions import CommandLineInputError
from brainglobe_utils.general.system import ensure_directory_exists
from brainglobe_workflows.tools import system, tools
from brainglobe_workflows.tools.parser import cellfinder_parser
from brainreg.paths import Paths as BrainRegPaths
from fancylog import fancylog

import cellfinder as program_for_log
import cellfinder.tools.parser as parser
from cellfinder.tools import system, tools
from cellfinder.tools.parser import cellfinder_parser


def get_arg_groups(args, parser):
arg_groups = {}
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions cellfinder/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: cellfinder
name: brainglobe-workflows
dependencies:
- python=3.10
- cudatoolkit
- cudnn
- pip:
- cellfinder
- brainglobe-workflows
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "cellfinder"
name = "brainglobe-workflows"
description = "Automated 3D cell detection and registration of whole-brain images"
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -40,7 +40,7 @@ dependencies = [
dynamic = ["version"]

[project.scripts]
cellfinder = "cellfinder.main:main"
cellfinder = "brainglobe_workflows.main:main"

[project.optional-dependencies]
dev = [
Expand All @@ -55,8 +55,8 @@ dev = [
napari = ["napari[pyside2]", "brainglobe-napari-io", "cellfinder-napari"]

[project.urls]
source = "https://github.com/brainglobe/cellfinder"
bug_tracker = "https://github.com/brainglobe/cellfinder/issues"
source = "https://github.com/brainglobe/brainglobe-workflows"
bug_tracker = "https://github.com/brainglobe/brainglobe-workflows/issues"
homepage = "https://brainglobe.info"
documentation = "https://brainglobe.info/documentation/cellfinder"
[build-system]
Expand All @@ -82,7 +82,7 @@ include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
include = ["cellfinder"]
include = ["brainglobe-workflows"]
exclude = ["tests", "resources"]

[tool.setuptools_scm]
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
addopts = --cov=cellfinder
addopts = --cov=brainglobe-workflows
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
serial
3 changes: 1 addition & 2 deletions tests/tests/test_integration/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import brainglobe_utils.IO.cells as cell_io
import pytest

from cellfinder.main import main as cellfinder_run
from brainglobe_workflows.main import main as cellfinder_run

data_dir = os.path.join(
os.getcwd(), "tests", "data", "integration", "detection"
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_integration/test_extract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os

import brainglobe_workflows.extract.extract_cubes as extract_cubes
import imio
import numpy as np
import pytest
Expand All @@ -11,8 +12,6 @@
from brainglobe_utils.IO.cells import get_cells
from tifffile import tifffile

import cellfinder.extract.extract_cubes as extract_cubes

data_dir = os.path.join("tests", "data")

signal_data_dir = os.path.join(data_dir, "signal")
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_integration/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import numpy as np
import pandas as pd
import pytest
from brainglobe_workflows.main import main as cellfinder_run
from imio.load import load_any

from cellfinder.main import main as cellfinder_run

data_dir = os.path.join(
os.getcwd(),
"tests",
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_unit/test_tools/test_image_processing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import random

import numpy as np

from cellfinder.tools import image_processing as img_tools
from brainglobe_workflows.tools import image_processing as img_tools


def test_crop_center_2d():
Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_unit/test_tools/test_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import pytest
from brainglobe_utils.general.exceptions import CommandLineInputError

from cellfinder.tools import prep
from brainglobe_workflows.tools import prep

# import shutil

Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_unit/test_tools/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
from math import isclose
from pathlib import Path

import brainglobe_workflows.tools.system as system
import pytest
from brainglobe_utils.general.exceptions import CommandLineInputError
from brainglobe_utils.general.system import ensure_directory_exists

import cellfinder.tools.system as system

data_dir = Path("tests", "data")
background_im_dir = os.path.join(data_dir, "background")

Expand Down
3 changes: 1 addition & 2 deletions tests/tests/test_unit/test_tools/test_tools_general.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import random

import brainglobe_workflows.tools.tools as tools
import numpy as np
import pytest

import cellfinder.tools.tools as tools

a = [1, "a", 10, 30]
b = [30, 10, "c", "d"]

Expand Down
Loading