Add acdc-data CLI for BioIO metadata, convert, and restructure.#1108
Closed
keejkrej wants to merge 1 commit into
Closed
Add acdc-data CLI for BioIO metadata, convert, and restructure.#1108keejkrej wants to merge 1 commit into
keejkrej wants to merge 1 commit 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.
Adds a new headless acdc-data command-line interface for metadata extraction, raw microscopy conversion to ACDC structure, and restructuring pre-processed image files, alongside docs and unit tests.
Changes:
- Introduce
cellacdc/data_cli.pyimplementingmetadata,convert, andrestructuresubcommands. - Register the
acdc-dataconsole entry point and wire the CLI into existing_run/kernel infrastructure. - Add getting-started documentation and unit tests for key parsing/state helpers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_data_cli.py | Adds pytest coverage for core helpers in the new data CLI module. |
| pyproject.toml | Registers acdc-data entry point. |
| cellacdc/docs/source/getting-started.rst | Documents new headless data commands and common usage patterns. |
| cellacdc/data_cli.py | Implements the new headless data CLI and conversion/restructure logic. |
| cellacdc/cli.py | Adds workflow kernels that invoke the new data CLI operations. |
| cellacdc/_run.py | Adds runner functions for acdc-data commands with logging setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+948
to
+949
| for p, filename in enumerate(raw_filenames): | ||
| pos_n = p + start_pos_n |
Comment on lines
+953
to
+969
| if raw_data_struct == 0: | ||
| num_pos = state.size_s | ||
| num_pos_digits = len(str(num_pos)) | ||
| for in_file_p in range(state.size_s): | ||
| _save_to_pos_folder( | ||
| state, raw_src_path, exp_dst_path, filename, | ||
| in_file_p, pos_n, num_pos_digits, raw_data_struct, | ||
| overwrite_pos, create_new, lazy_load, | ||
| logger_func=logger_func, | ||
| ) | ||
| elif raw_data_struct == 1: | ||
| num_pos = len(raw_filenames) | ||
| num_pos_digits = len(str(num_pos)) | ||
| _save_to_pos_folder( | ||
| state, raw_src_path, exp_dst_path, filename, | ||
| 0, pos_n, num_pos_digits, raw_data_struct, | ||
| overwrite_pos, create_new, lazy_load, |
| images_path = os.path.join(dst_path, f'Position_{p + 1}', 'Images') | ||
| os.makedirs(images_path, exist_ok=True) | ||
|
|
||
| video_data = None |
Comment on lines
+1116
to
+1127
| for frame_i, file_info in enumerate(sorted_files_list): | ||
| file, _ = file_info | ||
| src_img_file_path = os.path.join(src_path, file) | ||
| try: | ||
| img = load.imread(src_img_file_path) | ||
| if video_data is None: | ||
| video_data = np.zeros((size_t, *img.shape), dtype=img.dtype) | ||
| video_data[frame_i] = img | ||
| frame_number_match = re.findall(frame_name_pattern, file)[0][1] | ||
| frame_numbers.append(int(frame_number_match)) | ||
| except Exception: | ||
| continue |
Comment on lines
+1176
to
+1178
| for frame_number, img in zip(frame_numbers, video_data): | ||
| frame_i = frame_number - min_frame_number | ||
| padded_video_data[frame_i] = img |
Comment on lines
+953
to
+957
| if raw_data_struct == 0: | ||
| num_pos = state.size_s | ||
| num_pos_digits = len(str(num_pos)) | ||
| for in_file_p in range(state.size_s): | ||
| _save_to_pos_folder( |
Comment on lines
+963
to
+966
| elif raw_data_struct == 1: | ||
| num_pos = len(raw_filenames) | ||
| num_pos_digits = len(str(num_pos)) | ||
| _save_to_pos_folder( |
| ) | ||
|
|
||
|
|
||
| def restructure_multi_timepoint( |
| src_segm_paths = [''] * size_t | ||
| frame_numbers = [] | ||
| size_z = 1 | ||
| for frame_i, file_info in enumerate(sorted_files_list): |
| frame_numbers = img_data_info['frameNumbers'] | ||
| padded_shape = (max_size_t, *video_data.shape[1:]) | ||
| padded_video_data = np.zeros(padded_shape, dtype=video_data.dtype) | ||
| for frame_number, img in zip(frame_numbers, video_data): |
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