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 'in place' option for the rgb2hed function (and similar) #6631

Open
hwarden162 opened this issue Nov 24, 2022 · 5 comments
Open

Add 'in place' option for the rgb2hed function (and similar) #6631

hwarden162 opened this issue Nov 24, 2022 · 5 comments
Labels

Comments

@hwarden162
Copy link

Description:

In functions such as remove_small_holes there is the option to edit the matrix in place, that is to pass in a mask and have the same mask be edited by the function to save memory. I work on very large H-DAB and H&E images and currently I have to try and tile my image and pass it through a tile at a time to try and save memory. If I could run it in place it would resolve this memory issue for me and other people working with these large images.

Many thanks

@stefanv
Copy link
Member

stefanv commented Nov 25, 2022

We should do that. Are there any other rgb2 functions that can be adjusted to do the same?

@hwarden162
Copy link
Author

It would probably be useful to have it on any function in the skimage.color module that converts between color spaces (any that have a 2 in the name). Purely from personal experience rgb2hed and hed2rgb would be useful ones as those images tend to be quite large( the one I'm currently working on is 37632 x 65536 x 3). I don't know much about the uses of the other colour spaces but there are probably ones there that also are used for large images that would find it useful.

@hmaarrfk
Copy link
Member

Is an out parameter better than in place? Seems more generic but maybe comes at some performance loss?

@stefanv
Copy link
Member

stefanv commented Nov 25, 2022

For functions where input and output sizes are the same, and out argument makes sense. You can just use the input array as the output array then. This is the NumPy pattern.

@github-actions
Copy link

Hey, there hasn't been any activity on this issue for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! If you think that this issue is no longer relevant, you may close it by yourself; otherwise, we may do it at some point (either way, it will be done manually). In any case, thank you for your contributions so far!

@github-actions github-actions bot added the 😴 Dormant no recent activity label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants