Skip to content

Commit 9eca9c8

Browse files
committed
feat: modularize workflows
1 parent f1843a9 commit 9eca9c8

492 files changed

Lines changed: 86306 additions & 48713 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ prune publications
2626
prine notebooks
2727
prune FijiMacros
2828

29-
exclude cellacdc/models/YeastMate/detectron2
30-
exclude cellacdc/models/YeastMate/pycocotools
29+
exclude cellacdc/segmenters/YeastMate/detectron2
30+
exclude cellacdc/segmenters/YeastMate/pycocotools
3131

3232
exclude requirements.txt
3333
exclude not_installed_requirements.txt

cellacdc/__init__.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,19 +410,25 @@ def printl(*objects, pretty=False, is_decorator=False, idx=1, **kwargs):
410410

411411
parent_path = os.path.dirname(cellacdc_path)
412412
html_path = os.path.join(cellacdc_path, '_html')
413-
models_path = os.path.join(cellacdc_path, 'models')
414-
promptable_models_path = os.path.join(cellacdc_path, 'promptable_models')
413+
segmenters_path = os.path.join(cellacdc_path, 'segmenters')
414+
segmenters_promptable_path = os.path.join(cellacdc_path, 'segmenters_promptable')
415415
data_path = os.path.join(parent_path, 'data')
416416
resources_folderpath = os.path.join(cellacdc_path, 'resources')
417417
resources_filepath = os.path.join(cellacdc_path, 'resources_light.qrc')
418418
logs_path = os.path.join(user_profile_path, '.acdc-logs')
419419
acdc_fiji_path = os.path.join(user_profile_path, 'acdc-fiji')
420420
acdc_ffmpeg_path = os.path.join(user_profile_path, 'acdc-ffmpeg')
421421
resources_path = os.path.join(cellacdc_path, 'resources_light.qrc')
422-
models_list_file_path = os.path.join(settings_folderpath, 'custom_models_paths.ini')
423-
promptable_models_list_file_path = os.path.join(
422+
segmenters_list_file_path = os.path.join(
423+
settings_folderpath, 'custom_models_paths.ini'
424+
)
425+
segmenters_promptable_list_file_path = os.path.join(
424426
settings_folderpath, 'custom_promptable_models_paths.ini'
425427
)
428+
models_path = segmenters_path
429+
promptable_models_path = segmenters_promptable_path
430+
models_list_file_path = segmenters_list_file_path
431+
promptable_models_list_file_path = segmenters_promptable_list_file_path
426432
favourite_func_metrics_csv_path = os.path.join(
427433
settings_folderpath, 'favourite_func_metrics.csv'
428434
)
@@ -806,4 +812,30 @@ def inner_function(self, *args, **kwargs):
806812
single_pos_index_cols = (
807813
'experiment_folderpath',
808814
'Position_n'
809-
)
815+
)
816+
817+
# Public modular API (scripting entry points)
818+
from cellacdc.domain import ExperimentSession, PositionSession # noqa: E402
819+
820+
try:
821+
from cellacdc.api import ( # noqa: E402
822+
AnnotationViewer,
823+
current_viewer,
824+
imshow,
825+
open_session,
826+
run,
827+
view_intensity,
828+
view_labels,
829+
view_path,
830+
view_session,
831+
)
832+
except ImportError:
833+
AnnotationViewer = None # type: ignore
834+
current_viewer = None # type: ignore
835+
imshow = None # type: ignore
836+
open_session = None # type: ignore
837+
run = None # type: ignore
838+
view_intensity = None # type: ignore
839+
view_labels = None # type: ignore
840+
view_path = None # type: ignore
841+
view_session = None # type: ignore

cellacdc/_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def download_model_params():
369369
if parser_args['StarDistModelsDownload'] or parser_args['AllModelsDownload']:
370370
print('[INFO]: Downloading StarDist models...')
371371
try:
372-
from cellacdc.models import STARDIST_MODELS
372+
from cellacdc.segmenters import STARDIST_MODELS
373373
from stardist.models import StarDist2D, StarDist3D
374374
for model_type in [StarDist2D, StarDist3D]:
375375
for model_name in STARDIST_MODELS:

0 commit comments

Comments
 (0)