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

When loading data for train allow to read data that has channel on first position #94

Merged
merged 11 commits into from
Sep 21, 2022

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented Sep 20, 2022

Add heuristics to allow to channel ais into being the first axis.
For better compatibility with preview data in napari, for example.

@constantinpape
Copy link
Owner

Thanks for starting to work on this @Czaki. I should have time to have a look at this later in the evening or tomorrow.

@Czaki
Copy link
Contributor Author

Czaki commented Sep 20, 2022

In this PR, currently, there is no metadata parsing. Only guessing based on the size of the array.

Copy link
Owner

@constantinpape constantinpape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! This is good to go once the tests pass (currently just missing a tempfile import.)

test/data/test_image_collection_dataset.py Show resolved Hide resolved
@@ -102,17 +102,23 @@ def _get_sample(self, index):

shape = raw.shape
# we assume images are loaded with channel last!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update this comment since we now decide on channel last vs. channel first based on the image shape.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you check the current version?

torch_em/data/image_collection_dataset.py Show resolved Hide resolved
@Czaki Czaki changed the title When loading data for train allow to read data that has hannel on first position When loading data for train allow to read data that has channel on first position Sep 21, 2022
Copy link
Owner

@constantinpape constantinpape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@constantinpape constantinpape merged commit b9db670 into constantinpape:main Sep 21, 2022
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.

None yet

2 participants