Skip to content

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

Closed
keejkrej wants to merge 1 commit into
SchmollerLab:mainfrom
keejkrej:cursor/99204775
Closed

Add acdc-data CLI for BioIO metadata, convert, and restructure.#1108
keejkrej wants to merge 1 commit into
SchmollerLab:mainfrom
keejkrej:cursor/99204775

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 11:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

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.py implementing metadata, convert, and restructure subcommands.
  • Register the acdc-data console 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 thread cellacdc/data_cli.py
Comment on lines +948 to +949
for p, filename in enumerate(raw_filenames):
pos_n = p + start_pos_n
Comment thread cellacdc/data_cli.py
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,
Comment thread cellacdc/data_cli.py
images_path = os.path.join(dst_path, f'Position_{p + 1}', 'Images')
os.makedirs(images_path, exist_ok=True)

video_data = None
Comment thread cellacdc/data_cli.py
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 thread cellacdc/data_cli.py
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 thread cellacdc/data_cli.py
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 thread cellacdc/data_cli.py
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(
Comment thread cellacdc/data_cli.py
)


def restructure_multi_timepoint(
Comment thread cellacdc/data_cli.py
src_segm_paths = [''] * size_t
frame_numbers = []
size_z = 1
for frame_i, file_info in enumerate(sorted_files_list):
Comment thread cellacdc/data_cli.py
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):
@keejkrej keejkrej closed this May 25, 2026
@keejkrej keejkrej deleted the cursor/99204775 branch May 25, 2026 14:59
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