Skip to content

Add acdc-data CLI for BioIO metadata, convert, and restructure.#1109

Open
keejkrej wants to merge 3 commits into
SchmollerLab:mainfrom
keejkrej:feat/acdc-data
Open

Add acdc-data CLI for BioIO metadata, convert, and restructure.#1109
keejkrej wants to merge 3 commits into
SchmollerLab:mainfrom
keejkrej:feat/acdc-data

Conversation

@keejkrej

Copy link
Copy Markdown
Contributor

Introduce a separate headless entry point with thin cli.py kernels so GUI-only modules like dataStruct stay untouched.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 25, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a new headless CLI (acdc-data) for metadata extraction, raw-to-ACDC conversion, and image restructure workflows, plus docs and initial unit tests.

Changes:

  • Add cellacdc.data_cli implementing metadata, convert, and restructure subcommands.
  • Register the acdc-data console entry point and add user documentation.
  • Add pytest coverage for several parsing/utility helpers used by the CLI.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/test_data_cli.py Adds unit tests for CLI helpers/state building.
pyproject.toml Registers the new acdc-data entry point.
cellacdc/docs/source/getting-started.rst Documents new headless data CLI usage and options.
cellacdc/data_cli.py Implements the new headless CLI commands and conversion/restructure logic.
cellacdc/cli.py Adds workflow kernels to run the new data CLI tasks with logging.
cellacdc/_run.py Wires new run targets (run_data_*) used by cellacdc.data_cli.run().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cellacdc/data_cli.py
Comment on lines +957 to +959
_save_to_pos_folder(
state, raw_src_path, exp_dst_path, filename,
in_file_p, pos_n, num_pos_digits, raw_data_struct,
Comment thread cellacdc/data_cli.py
Comment on lines +811 to +816
def _should_save_position(state: ConvertState, in_file_pos_idx: int) -> bool:
in_file_pos_name = f'Position_{in_file_pos_idx + 1}'
return (
'All Positions' in state.selected_pos
or in_file_pos_name in state.selected_pos
)
Comment thread cellacdc/data_cli.py
Comment on lines +835 to +836
if not _should_save_position(state, series):
return
Comment thread cellacdc/data_cli.py
Comment on lines +665 to +668
saved_size_t = state.time_range_end - state.time_range_start + 1
save_channels = state.save_channels or [True] * state.size_c
df = pd.DataFrame({
'LensNA': state.lens_na,
Comment thread cellacdc/data_cli.py
Comment on lines +679 to +682
ch_metadata = [
ch_name for c, ch_name in enumerate(state.channel_names)
if save_channels[c]
]
Comment thread cellacdc/data_cli.py
Comment on lines +42 to +59
def get_frame_num_and_pattern(filename):
matching_frame_name_pattern = r'^\.+'
frame_number = None
for frame_name_pattern in FRAME_NAME_PATTERNS:
try:
frame_number = re.findall(frame_name_pattern, filename)[0][1]
matching_frame_name_pattern = frame_name_pattern
break
except Exception:
frame_number = None
return matching_frame_name_pattern, frame_number


def read_filename_pattern(file_name):
matching_frame_name_pattern, frame_number = get_frame_num_and_pattern(
file_name
)
s = re.sub(matching_frame_name_pattern, '', file_name)
Comment thread cellacdc/data_cli.py
Comment on lines +198 to +201
if ':' in time_range:
start, end = time_range.split(':', 1)
return int(start), int(end)
return 0, int(time_range)
Comment thread cellacdc/data_cli.py
Comment on lines +613 to +618
ch_name = "".join(
c if c.isalnum() or c == '_' or c == '' else '_' for c in image_name
)
while ch_name.endswith('_'):
ch_name = ch_name[:-1]
return ch_name
Comment thread cellacdc/data_cli.py
Comment on lines +957 to +959
_save_to_pos_folder(
state, raw_src_path, exp_dst_path, filename,
in_file_p, pos_n, num_pos_digits, raw_data_struct,
keejkrej and others added 2 commits May 25, 2026 17:17
Preserve time interval when metadata is serialized to disk and prevent CZI fallback mappers from overwriting parsed values with None.

Co-authored-by: Cursor <cursoragent@cursor.com>
…eaders.

Expose OME-style Channel node metadata so ACDC metadata parsing picks up per-channel wavelengths from patched bioio readers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants