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
How to work with single bands of a multiband image? #626
Comments
How about this way? idx = which(labels == "Water")
image_st[[1]][,,idx] = image_st[[1]][,,idx] * scale |
Yes, that was also my first thought: use the fact that image_spl = split(image_st)
image_spl[["Water"]] = image_spl[["Water"]] * scale and if needed merge again by merge(image_spl) This works at the same level: |
But I'd agree it would be nice if this would work with single brackets! |
Thanks, @edzer, works! |
This allows for image_spl["Water"] = image_spl["Water"] * scale and does some checking of the dimensions. |
Hi @edzer, the quandary between [ ] and [[ ]] is an inherent problem in R. Maybe the only suggestion I would give is to provide some examples in the documentation. |
Great idea! |
Hi @edzer
I have a multiband image and I am trying to process each band independently. However, I am at a loss to find out how to do so.
Please see the following MWE
The following command, which processes all pixels of all bands, works fine.
I can acess the an image subset, but not process it. The following commands work.
My problem is that I want to process each band independently and the following command does not work.
What is the correct way to process individual bands in a
stars
image?Many thanks,
Gilberto
The text was updated successfully, but these errors were encountered: