mobie / mobie.github.io

1 stars 3 forks source link

BlendingMode #26

Closed tischi closed 3 years ago

tischi commented 3 years ago

@martinschorb @K-Meech @constantinpape We should add a field blendingMode to the imageDisplay. These are the current choices:

    public static final String PROJECTION_MODE_SUM = "Sum";
    public static final String PROJECTION_MODE_AVG = "Average";
    public static final String PROJECTION_MODE_OCCLUDING = "Occluding";

I will add myself to the current test data set manually to explore it.

tischi commented 3 years ago

It works! This is code that I wrote a long time ago for bdv-playground.

Amazingly beautiful, imho:

image

let's add the optional field: "blendingMode" (with "sum", "average", "occluding" ). in my code it will default to "sum".

constantinpape commented 3 years ago

That looks awesome! Which blending mode is it in the image you show?

I will add it to the spec later.

martinschorb commented 3 years ago

Is this compatible with the current BDV-PG implementation? Would it also support the additional XML fields that define channel/LUT, contrast settings etc.?

Also, I just learned of BetaSeg a segmentation overlay for BDV which includes amazing features. Have you chatted with Deborah about that? There is a lot of intersection with the MoBIE way of showing segmentations, but it also includes interactive features that we might want to look into...

tischi commented 3 years ago

This is average mode.

@martinschorb @NicoKiaru

I was looking at the code in the playground and I think actually the choices are:

Avg
AvgOccluding
Sum
SumOccluding
tischi commented 3 years ago

Is this compatible with the current BDV-PG implementation? Would it also support the additional XML fields that define channel/LUT, contrast settings etc.?

It is the same implementation, but we read the fields from our JSON specs. Currently there are sill two ways of specifying this (the playground XML and the MoBIE JSON). We could think of writing a converter between the xml and the JSON; @martinschorb maybe you'd be interested?

Also, I just learned of BetaSeg a segmentation overlay for BDV which includes amazing features. Have you chatted with Deborah about that? There is a lot of intersection with the MoBIE way of showing segmentations, but it also includes interactive features that we might want to look into...

Unfortunately the communication there is not as good as I would wish. We chatted about it at one hackathon and agreed to join efforts, but then nothing happened after that. Probably a lot of code duplication by now.

tischi commented 3 years ago

We chatted about it at one hackathon and agreed to join efforts, but then nothing happened after that. Probably a lot of code duplication by now.

In fact, a better way of saying this is that probably they caught up in the last 2-3 years, because I did not change much on my side on that part of the code. If their stuff is good, we should probably use it. Something to look at later this year.

martinschorb commented 3 years ago

Their UI frontend looks really cool. I saw a video in a presentation where you can switch on and off individual objects based on properties (distances, size,...) right from the viewer.

martinschorb commented 3 years ago

We could think of writing a converter between the xml and the JSON; @martinschorb maybe you'd be interested?

@constantinpape can you point me to the code that does the JSON? I have these properties in a dict, so conversion should be easy.

tischi commented 3 years ago

Their UI frontend looks really cool. I saw a video in a presentation where you can switch on and off individual objects based on properties (distances, size,...) right from the viewer.

Great, then we can think about this (in a few months I would say :) But this is not what this issue is about :)

@martinschorb Could you please comment on the blending modes?

Avg
AvgOccluding
Sum
SumOccluding

Are those the ones that we should have?

giuliamizzon commented 3 years ago

Oh wow! That looks really a nice way to see the tomogram and segmentation within the larger context! (Just for displaying purposes though that one cell has the cell wall detaching, the neighboring ones look better 😅)

martinschorb commented 3 years ago

Are those the ones that we should have?

I don't know the exact difference between the occluding types and if they could be combined or if maybe some layer concept would be better. But yes, that's what works nicely in BDV-PG.

martinschorb commented 3 years ago

In fact, a better way of saying this is that probably they caught up in the last 2-3 years, because I did not change much on my side on that part of the code. If their stuff is good, we should probably use it. Something to look at later this year.

I guess it is this... correct?

tischi commented 3 years ago

I guess it is this... correct?

Yes, but could we please have this discussion in a new issue. You could open one, about checking whether integration with this is feasible.

tischi commented 3 years ago

@constantinpape OK, let'd go for those ones for now:

avg
avgOccluding
sum
sumOccluding

Thanks!

yanschwab commented 3 years ago

It works! This is code that I wrote a long time ago for bdv-playground.

Amazingly beautiful, imho:

image

let's add the optional field: "blendingMode" (with "sum", "average", "occluding" ). in my code it will default to "sum".

Oh la la !!!! it's amazing!

martinschorb commented 3 years ago

@constantinpape can you point me to the code that does the JSON? I have these properties in a dict, so conversion should be easy.

I think I found it. My suggestion is to add a check in add_to_image_dict whether the XML contains these extra information and then write it into the image_dict. Or would you rather prefer to have it as a separate function that imports these things?

martinschorb commented 3 years ago

what colors are supported by MoBIE? I found these base colors, but there are some more apparently. Where are these defined? https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html

randomFromGlasbey is only used by MobIE (google finds nothing else...)

constantinpape commented 3 years ago

@tischi Do we need the blendingMode only for imageDisplay or also for segmentationDisplay?

@giuliamizzon

(Just for displaying purposes though that one cell has the cell wall detaching, the neighboring ones look better sweat_smile)

Yes, this is just a very quick segmentation I did for the example, so there are certainly a few errors in there.

@martinschorb I have made a separate issue for discussing the bdv playground things, see #27.

constantinpape commented 3 years ago

randomFromGlasbey is only used by MobIE (google finds nothing else...)

Yes, this is a special coloring mode for images, where the color map should be picked according to glasbey. (we introduced it for the prospr images in the platybrowser)

constantinpape commented 3 years ago

@tischi should we call it projectionMode to be consistent with playground? See https://github.com/mobie/mobie.github.io/issues/27#issuecomment-808239600

tischi commented 3 years ago

Do we need the blendingMode only for imageDisplay or also for segmentationDisplay?

Not sure yet, for now only add it to imageDisplay

should we call it projectionMode to be consistent with playground?

I am right now on it to change this in playground to also be blendingMode; I think that is better. @NicoKiaru do you agree? I think that's also how they call it in napari.

constantinpape commented 3 years ago

Ok, I have added blendingMode for imageDisplay now, see 257b97d7297e1dfaddf9a65d86a324322b54417a