Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Split image along axes" tool #141

Merged
merged 6 commits into from
Mar 7, 2025
Merged

Conversation

kostrykin
Copy link
Member

Add "Split image along axes" tool that splits an image along a specific axis (e.g., channels) into a collection of separate images. This is useful, for example, to preprocess images for tools that require single-channel images.


FOR THE CONTRIBUTOR — Please fill out if applicable

Please make sure you have read the CONTRIBUTING.md document (last updated: 2024/04/23).

  • License permits unrestricted use (educational + commercial).

If this PR adds or updates a tool or tool collection:

@kostrykin kostrykin marked this pull request as ready for review March 2, 2025 18:32
@kostrykin kostrykin requested a review from Copilot March 6, 2025 18:56
Copy link

@Copilot 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.

PR Overview

This pull request adds a new tool, "Split image along axes", that splits an image along a specified axis (e.g., channels) and outputs separate images.

  • Introduces a Python script that reads an image, processes axis-based splitting, and saves the outputs.
  • Adds a .shed.yml file for tool metadata and updates the README.md to include the new tool.

Reviewed Changes

File Description
tools/split_image/split.py Implements image splitting with axis-based processing
tools/split_image/.shed.yml Provides tool metadata for distribution
README.md Updates tool list to include the new "Split image along axes" tool

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tools/split_image/split.py:36

  • [nitpick] The variable 'axis_pos' in the list comprehension shadows an existing variable; consider renaming it (e.g., to 'ax_idx') to avoid potential confusion.
s = [axis_pos for axis_pos in range(len(img_in.axes)) if img.shape[axis_pos] == 1 and img_in.axes[axis_pos] not in 'YX']

@kostrykin kostrykin merged commit f105236 into BMCV:master Mar 7, 2025
10 checks passed
@kostrykin kostrykin deleted the dev/split-image branch March 7, 2025 08:08
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.

1 participant