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 dimension re-ordering support to to_dataset() method #304

Open
elevans opened this issue May 10, 2024 · 1 comment
Open

Add dimension re-ordering support to to_dataset() method #304

elevans opened this issue May 10, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@elevans
Copy link
Member

elevans commented May 10, 2024

We can do better here and detect what the input image is and take the appropriate steps to re-order the dataset. If you try to re-order an imglib2 image with to_dataset(img, dim_order=['X', 'Y', 'Channel']) only the first two dimensions will be appropriately assigned. All other dimensions are discarded and unknown is assigned as the dimension label.

@elevans elevans added the enhancement New feature or request label May 10, 2024
@elevans elevans self-assigned this May 10, 2024
@ctrueden
Copy link
Member

To be clear: in the case of img being an Img, there is no "reordering" happening, but rather dimensional assignment to match the given dim_order. So this case should IMHO be easy to do. The trickier one is if you call to_dataset on something that is already an ImgPlus or Dataset—then what? Is the user expecting the dimensions to be swapped around? Or just relabeled? (When passing an xarray, what do we do? I forgot.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants