Add acdc-data CLI for BioIO metadata, convert, and restructure.#1109
Open
keejkrej wants to merge 3 commits into
Open
Add acdc-data CLI for BioIO metadata, convert, and restructure.#1109keejkrej wants to merge 3 commits into
keejkrej wants to merge 3 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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_cliimplementingmetadata,convert, andrestructuresubcommands. - Register the
acdc-dataconsole 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 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 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 on lines
+835
to
+836
| if not _should_save_position(state, series): | ||
| return |
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 on lines
+679
to
+682
| ch_metadata = [ | ||
| ch_name for c, ch_name in enumerate(state.channel_names) | ||
| if save_channels[c] | ||
| ] |
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 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 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 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, |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1107