Skip to content

Commit

Permalink
Update imports (#89)
Browse files Browse the repository at this point in the history
* add gitter info

* readme typo

* update coverage dependency

* deploy to linux and windows

* update coverage dependency

* add six dependency

* travis revert

* update travis

* speed up test

* change cibuildtools syntax

* docker deploy

* update travis

* update travis

* update travis

* docker into jobs

* name deplot stage

* change deploy

* update testing script

* update coverage dependency

* new curation interface

* update stages

* remove matrix

* update jobs

* update python versions

* update wheelbuilding

* remove script and add os

* update travis

* formatting check with black

* update wheelbuilding

* ls before deployment

* remove install from deployment job

* move install to script

* conditional deployment

* update conditions

* update conditions

* twine upload

* install twine

* install twine

* update travis

* change twine upload

* update testing

* retry twine upload

* retry twine upload

* bump

* full deploy test

* update manifest

* update travis

* full deployment

* fix typo in travis.yml

* tag

* edit conditional deployment

* remove sudo

* update travis

* update travis

* update travis

* remove wheelbuilding

* update conditions

* Update conditions

* tag condition

* update conditions

* add branch to condition

* remove branch

* update conditions

* add branch to conditions

* add repo to conditions

* add repo to conditions

* reorder conditions

* reorder conditions

* add condition

* add matrix

* revert travis

* update tests

* more job detail

* more job detail

* full test and deploy

* bump

* update coverage

* remove unneeded line in travis

* remove unneeded line in travis

* test coveralls

* pin coveralls version

* update coveralls

* windows tests

* Upgrade setuptools

* upgrade setuptools

* bump

* update coverage call

* update coveralls depedency

* update coveralls depedency

* fix documentation

* fix import statement

* fix conflicts

* update napari points api usage

* update docs

* update amap api useage

* fix imlib source_files import errors

* bump

* bump

* update docs

* update imports

* removed commented code
  • Loading branch information
adamltyson authored Apr 21, 2020
1 parent c60650a commit 6e2f7dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
10 changes: 3 additions & 7 deletions cellfinder/summarise/count_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
from imlib.image.metadata import define_pixel_sizes
from imlib.general.config import get_config_obj
from imlib.IO.structures import load_structures_as_df

from imlib.source.source_files import get_structures_path
from imlib.anatomy.structures.structures_tree import (
atlas_value_to_structure_id,
CellCountMissingCellsException,
UnknownAtlasValue,
)

from neuro.atlas_tools.misc import get_atlas_pixel_sizes

import cellfinder.tools.parser as cellfinder_parse
from cellfinder.tools.prep import prep_atlas_conf, Paths
from imlib.source.source_files import get_structures_path

LEFT_HEMISPHERE = 2
RIGHT_HEMISPHERE = 1
Expand All @@ -34,7 +35,6 @@ def region_summary_cli_parser():
)
parser = cli_parse(parser)
parser = cellfinder_parse.count_summary_parse(parser)
# parser = cellfinder_parse.atlas_parse(parser)
parser = cellfinder_parse.pixel_parser(parser)
return parser

Expand Down Expand Up @@ -208,17 +208,13 @@ def get_structure_from_coordinates(
def analysis_run(args, file_name="summary_cell_counts.csv"):
args = prep_atlas_conf(args)

# if args.structures_file_path is None:
# args.structures_file_path = get_structures_path()

atlas = brainio.load_any(args.paths.registered_atlas_path)
hemisphere = brainio.load_any(args.paths.hemispheres_atlas_path)

cells = get_cells_data(
args.paths.classification_out_file, cells_only=args.cells_only,
)
max_coords = get_max_coords(cells) # Useful for debugging dimensions
# structures_reference_df = load_structures_as_df(args.structures_file_path)
structures_reference_df = load_structures_as_df(get_structures_path())

atlas_pixel_sizes = get_atlas_pixel_sizes(args.atlas_config)
Expand Down
11 changes: 5 additions & 6 deletions cellfinder/utils/roi_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
)
from imlib.general.exceptions import RegistrationError
from imlib.source.source_files import source_custom_config_cellfinder
from imlib.source.niftyreg_binaries import get_niftyreg_binaries, get_binary
from neuro.atlas_tools.misc import get_atlas_pixel_sizes
from amap.config.atlas import Atlas
from amap.config.config import get_binary
from amap.tools.source_files import get_niftyreg_binaries
import cellfinder.summarise.count_summary as cells_regions

from imlib.source.niftyreg_binaries import get_binary


# TODO: get this from amap
Expand Down Expand Up @@ -311,9 +312,7 @@ def main():
atlas = brainio.load_nii(str(destination_image), as_array=False)
atlas_scale = atlas.header.get_zooms()

atlas_pixel_sizes = cells_regions.get_atlas_pixel_sizes(
args.registration_config
)
atlas_pixel_sizes = get_atlas_pixel_sizes(args.registration_config)

transformation_matrix = np.eye(4)
for i, axis in enumerate(("x", "y", "z")):
Expand Down
23 changes: 6 additions & 17 deletions cellfinder/utils/xml_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
from brainio import brainio
from imlib.general.numerical import check_positive_float, check_positive_int

import cellfinder.summarise.count_summary as cells_regions
from imlib.IO.cells import cells_to_xml
from cellfinder.tools.prep import prep_atlas_conf
from imlib.source.source_files import get_structures_path
from imlib.IO.structures import load_structures_as_df
from neuro.atlas_tools.misc import get_atlas_pixel_sizes

from cellfinder.tools.prep import prep_atlas_conf
import cellfinder.summarise.count_summary as cells_regions


def xml_crop(args, df_query="name"):
args = prep_atlas_conf(args)

# if args.reference_structures_file_path is None:
# args.reference_structures_file_path = get_structures_path()
if args.structures_file_path is None:
args.structures_file_path = get_structures_path()

# reference_struct_df = pd.read_csv(args.reference_structures_file_path)
reference_struct_df = pd.read_csv(get_structures_path())

curate_struct_df = pd.read_csv(args.structures_file_path)
Expand All @@ -34,12 +33,9 @@ def xml_crop(args, df_query="name"):
atlas = brainio.load_any(args.registered_atlas_path)
hemisphere = brainio.load_any(args.hemispheres_atlas_path)

# structures_reference_df = load_structures_as_df(
# args.reference_structures_file_path
# )
structures_reference_df = load_structures_as_df(get_structures_path())

atlas_pixel_sizes = cells_regions.get_atlas_pixel_sizes(args.atlas_config)
atlas_pixel_sizes = get_atlas_pixel_sizes(args.atlas_config)
sample_pixel_sizes = args.x_pixel_um, args.y_pixel_um, args.z_pixel_um

scales = cells_regions.get_scales(sample_pixel_sizes, atlas_pixel_sizes)
Expand Down Expand Up @@ -107,14 +103,7 @@ def get_parser():
type=str,
help="Curated csv structure list (as per the allen brain atlas csv",
)
# parser.add_argument(
# "--ref-structures-file",
# dest="reference_structures_file_path",
# type=str,
# help="The csv file containing the structures "
# "definition (if not using the default "
# "Allen brain atlas).",
# )

parser.add_argument(
"--hemisphere-query",
dest="hemisphere_query",
Expand Down

0 comments on commit 6e2f7dc

Please sign in to comment.