Skip to content

Commit

Permalink
Update dependency (imlib -> brainglobe-utils) (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamltyson authored Jul 7, 2023
1 parent d7d13ab commit 2330826
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 33 deletions.
4 changes: 2 additions & 2 deletions cellfinder/analyse/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import pandas as pd
import tifffile
from bg_atlasapi import BrainGlobeAtlas
from imlib.general.system import ensure_directory_exists
from imlib.pandas.misc import sanitise_df
from brainglobe_utils.general.system import ensure_directory_exists
from brainglobe_utils.pandas.misc import sanitise_df

from cellfinder.export.export import export_points

Expand Down
6 changes: 3 additions & 3 deletions cellfinder/extract/extract_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from math import floor

import numpy as np
from imlib.cells.cells import group_cells_by_z
from imlib.general.numerical import is_even
from imlib.general.system import get_num_processes
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 numpy.linalg.linalg import LinAlgError
from skimage import transform
from tifffile import tifffile
Expand Down
6 changes: 3 additions & 3 deletions cellfinder/figures/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import numpy as np
import pandas as pd
import tifffile
from imlib.general.system import ensure_directory_exists
from imlib.image.masking import mask_image_threshold
from imlib.image.scale import scale_and_convert_to_16_bits
from brainglobe_utils.general.system import ensure_directory_exists
from brainglobe_utils.image.masking import mask_image_threshold
from brainglobe_utils.image.scale import scale_and_convert_to_16_bits
from skimage.filters import gaussian


Expand Down
6 changes: 3 additions & 3 deletions cellfinder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import bg_space as bgs
import tifffile
from brainglobe_utils.cells.cells import MissingCellsError
from brainglobe_utils.general.system import ensure_directory_exists
from brainglobe_utils.IO.cells import get_cells, save_cells
from cellfinder_core.main import suppress_tf_logging, tf_suppress_log_messages
from imlib.cells.cells import MissingCellsError
from imlib.general.system import ensure_directory_exists
from imlib.IO.cells import get_cells, save_cells

BRAINREG_PRE_PROCESSING_ARGS = None

Expand Down
2 changes: 1 addition & 1 deletion cellfinder/tools/image_processing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from imlib.general.numerical import is_even
from brainglobe_utils.general.numerical import is_even


def crop_center_2d(img, crop_x=None, crop_y=None):
Expand Down
5 changes: 4 additions & 1 deletion cellfinder/tools/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
ArgumentTypeError,
)

from brainglobe_utils.general.numerical import (
check_positive_float,
check_positive_int,
)
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 (
download_directory_parser,
model_parser,
)
from cellfinder_core.tools.source_files import source_custom_config_cellfinder
from imlib.general.numerical import check_positive_float, check_positive_int

from cellfinder import __version__

Expand Down
4 changes: 2 additions & 2 deletions cellfinder/tools/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from pathlib import PurePath

from bg_atlasapi import BrainGlobeAtlas
from brainglobe_utils.general.exceptions import CommandLineInputError
from brainglobe_utils.general.system import ensure_directory_exists
from brainreg.paths import Paths as BrainRegPaths
from fancylog import fancylog
from imlib.general.exceptions import CommandLineInputError
from imlib.general.system import ensure_directory_exists

import cellfinder as program_for_log
import cellfinder.tools.parser as parser
Expand Down
2 changes: 1 addition & 1 deletion cellfinder/tools/system.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from imlib.general.exceptions import CommandLineInputError
from brainglobe_utils.general.exceptions import CommandLineInputError


def get_subdirectories(directory, names_only=False):
Expand Down
6 changes: 3 additions & 3 deletions cellfinder/train/curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import napari
import numpy as np
from bg_atlasapi import BrainGlobeAtlas
from brainglobe_utils.cells.cells import Cell
from brainglobe_utils.general.system import get_sorted_file_paths
from brainglobe_utils.IO.cells import save_cells
from brainreg.paths import Paths as BrainregPaths
from brainreg_segment.layout.gui_elements import add_button
from imlib.cells.cells import Cell
from imlib.general.system import get_sorted_file_paths
from imlib.IO.cells import save_cells
from napari.utils.io import magic_imread
from napari_cellfinder.cellfinder import get_cell_arrays
from qtpy import QtCore
Expand Down
13 changes: 8 additions & 5 deletions cellfinder/train/curation_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@

import napari
import numpy as np
from imlib.cells.cells import Cell
from imlib.general.list import unique_elements_lists
from imlib.general.system import ensure_directory_exists, get_sorted_file_paths
from imlib.IO.cells import cells_xml_to_df, get_cells, save_cells
from imlib.IO.yaml import save_yaml
from brainglobe_utils.cells.cells import Cell
from brainglobe_utils.general.list import unique_elements_lists
from brainglobe_utils.general.system import (
ensure_directory_exists,
get_sorted_file_paths,
)
from brainglobe_utils.IO.cells import cells_xml_to_df, get_cells, save_cells
from brainglobe_utils.IO.yaml import save_yaml
from napari.utils.io import magic_imread
from qtpy.QtWidgets import QApplication

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"configobj",
"fancylog>=0.0.7",
"imio",
"imlib>=0.0.26",
"brainglobe-utils",
"multiprocessing-logging>=0.3.4",
"natsort",
"numpy",
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import sys

import pytest
from brainglobe_utils.general.config import get_config_obj
from cellfinder_core.download.cli import main as cellfinder_download
from imlib.general.config import get_config_obj

test_data_dir = pathlib.Path(__file__) / ".." / ".." / "data"
data_dir = test_data_dir / "brain"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_integration/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from math import isclose

import imlib.IO.cells as cell_io
import brainglobe_utils.IO.cells as cell_io
import pytest

from cellfinder.main import main as cellfinder_run
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/test_integration/test_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import imio
import numpy as np
import pytest
from imlib.cells.cells import Cell
from imlib.general.system import (
from brainglobe_utils.cells.cells import Cell
from brainglobe_utils.general.system import (
delete_directory_contents,
get_sorted_file_paths,
)
from imlib.IO.cells import get_cells
from brainglobe_utils.IO.cells import get_cells
from tifffile import tifffile

import cellfinder.extract.extract_cubes as extract_cubes
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_unit/test_tools/test_prep.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import pytest
from imlib.general.exceptions import CommandLineInputError
from brainglobe_utils.general.exceptions import CommandLineInputError

from cellfinder.tools import prep

Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test_unit/test_tools/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path

import pytest
from imlib.general.exceptions import CommandLineInputError
from imlib.general.system import ensure_directory_exists
from brainglobe_utils.general.exceptions import CommandLineInputError
from brainglobe_utils.general.system import ensure_directory_exists

import cellfinder.tools.system as system

Expand Down

0 comments on commit 2330826

Please sign in to comment.