-
Notifications
You must be signed in to change notification settings - Fork 409
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
API discussion: provide channels separately rather than using number key #275
Comments
Following up on this. I found that setting |
I fully agree on this and since I found this issue through a Google search I thought I might ask here. I don't understand how to use the channels. Images are not colored per se. If I have a 2D image (suppose 512x512, DAPI staining) of the nuclei and another 2D image for the cytoplasm staining they are both gray scale images. What does it mean that they are red or green? Do I need to construct an array with shape (3,512,512) or (512,512,3)? And what do I put on the non used channel? Can I build a (2,512,512) array and pass channel=[0, 1] even though the cytoplasm staining used a green staining? Thank you very much! |
Another +1 here.
I think implementing the suggestions by @jni would be great, but at this stage would break many applications that build on the existing API. |
@VolkerH the suggestions can all be implemented in a backward-compatible way. The old API would still work, but if |
I was also very confused about how channel indexing worked. TL;DR: You need to consider your image channels to be one indexed, and if you pass Here's why I think that happens:
So I think passing
If you pass values greater than 0, i.e.
@carsen-stringer maybe a small clarification in the docs would resolve a lot of this confusion. |
Hello Team, First of all, thank you for the Cellpose tool and the documentation! I’d like to revisit this API discussion thread as I still have some queries about using different channel combinations and the results they produce. For context, in my preprocessing script for creating a multi-channel stacked image, I pass two single-channel images: the first is a DAPI stain, which is assigned to the 0th index in the stacked image, and the second is a PolyT stain, assigned to the 1st index. Previously, I passed the combination The results between the two combinations are quite different, and I’d appreciate some clarification on how the channel array should be used. Thank you in advance for your help! |
The documentation on channel choosing is available here: https://cellpose.readthedocs.io/en/latest/settings.html#channels 0 in the first channel input means grayscale, and 0 in the second channel input means to use zeros for the nuclear channel |
Hello Team, I also found the API for Thank you for all the great work you are doing and for any help in advance! |
Working through the docs, I found the API for working with channels confusing:
https://cellpose.readthedocs.io/en/latest/settings.html#channels
My issues with this:
channels=[0, 0]
for an image with no channels.channels=[2, 3]
when the channel indices in the array are actually [1, 2].I have two alternate proposals:
channel_axis=None
for a grayscale (no channels) image,channel_axis=-1
for an image having the channels in the last axis,channel_axis=0
for an image having the channels in the 1st axis (might match acquisition), etc. Then, in the case ofchannel_axis is not None
, specifycytoplasm_channel=<int>
andnucleus_channel=<int>
.cytoplasm=
andnucleus=
input arrays. Users can specify one or the other or both.Both of these methods can be made backwards compatible, which is nice. =)
The text was updated successfully, but these errors were encountered: