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 compositing #331

Merged
merged 4 commits into from
Feb 7, 2023
Merged

Add compositing #331

merged 4 commits into from
Feb 7, 2023

Conversation

bruyeret
Copy link
Contributor

@bruyeret bruyeret commented Dec 12, 2022

Add compositing option when importing compatible a single nd2 file.
Change the UI.

Closes #244

Read position metadata of tiles from nd2 file

Closes #244
@bruyeret bruyeret requested a review from luciemac December 12, 2022 10:36
@arjunrajlab
Copy link
Collaborator

I think it would be better to put the compositing checkbox just to the right of the Positions (XY) UI as indicated below.
Also, I would change the text from "Enable compositing" to "Composite positions into single image".

image

@arjunrajlab
Copy link
Collaborator

I have noticed an issue with the file "normmedia_8well_col2_livecellgfp.nd2". If I upload it, it gets stuck on the "Variables" and "Assignments" screen and clicking "Submit" doesn't work. This problem appears to arise both when "Enable compositing" is checked or unchecked.

@arjunrajlab
Copy link
Collaborator

Can confirm this is also a problem for the OASL_SOX10_VGF.nd2 dataset.

@bruyeret
Copy link
Contributor Author

I have noticed an issue with the file "normmedia_8well_col2_livecellgfp.nd2". If I upload it, it gets stuck on the "Variables" and "Assignments" screen and clicking "Submit" doesn't work. This problem appears to arise both when "Enable compositing" is checked or unchecked.

I noticed that the submit button was slow, but it works for me, I have to wait 7/8 seconds after clicking
Does waiting work for you @arjunrajlab?

I found where the problem is
Uploading a multi-source file of 33536B takes 7.65s; 7059B takes 917ms
Uploading the multi-source file takes more time now because there is a "source" entry for each frame and it makes the file grow
The first file weights only 33kB but takes 7.65s to upload, which is very very slow (less than 5kB/s)
Do you have an idea about why @manthey?

@bruyeret bruyeret force-pushed the feat/tile-compositing/244 branch from 746e046 to b0912cb Compare December 12, 2022 16:57
@arjunrajlab
Copy link
Collaborator

Yes, I did notice that the interface did eventually go through. But when it did, it still seemed to have an error on the next page. Also, this slowdown was not there before, so it must have been something introduced with this new code.

@bruyeret
Copy link
Contributor Author

What is the error you get on the next page? I don't get any error
Yes the slow down has been introduced with this new code
As I said, this is beacause the size of the multi-source file has grown and its upload is very slow
I'm waiting for David's opinion on the topic

@arjunrajlab
Copy link
Collaborator

Also, in general, navigation is very slow through the file once uploaded now. It is qualitatively worse than before. I think something is wrong now with how things are specified.

@bruyeret
Copy link
Contributor Author

Yes I agree, I had a quick talk with David about that and he told me that

It will be slower to load a frame (it now has to load chunks from the file from lots of spots)

I don't know how we could make things faster, I'll discuss that with David

@manthey
Copy link
Collaborator

manthey commented Dec 12, 2022

Speed on composited images (and only composited image) will be slower on first load. They should eventually be cached and just as snappy as other files. To get, for instance, a thumbnail, we can't just read one section of a file, we have to read a bunch of sections to composite it.

@arjunrajlab
Copy link
Collaborator

@manthey It's actually slow even WITHOUT compositing, though, which is puzzling.

@arjunrajlab
Copy link
Collaborator

I think it would be fine if it is slower for composited files, but I think it should be the same for non-composited files, right?

@bruyeret
Copy link
Contributor Author

David will try to fix the problem on girder's side (it is something with file caching)
If it is too long or too hardto fix, I'll make it slow only for composited files

@arjunrajlab
Copy link
Collaborator

Sounds good, thanks!

@bruyeret bruyeret marked this pull request as draft December 13, 2022 09:17
@arjunrajlab
Copy link
Collaborator

Tried the file normmedia_8well_col2_livecellgfp.nd2 and still had problems. It was faster to process, but still quite slow to upload even if you do not check "composite". Once loaded, navigating the file (e.g. moving the XY slider) was much less responsive than before.

@arjunrajlab
Copy link
Collaborator

On the same file, composite doesn't seem to work…

@arjunrajlab
Copy link
Collaborator

Like, it doesn't show any image.

@bruyeret
Copy link
Contributor Author

I haven't bump David's changes into this branch yet, did you do it?

@arjunrajlab
Copy link
Collaborator

I didn't bump them in…

@bruyeret
Copy link
Contributor Author

I'll do it tomorrow, sorry for that!

Add comments, typescript, verbose variables
Tweak some logic
When generating the JSON, create a source object for each frame
Modify the UI
Add a checkbox and logic for compositing
Fix an error in getDataset when there is no image
@bruyeret bruyeret force-pushed the feat/tile-compositing/244 branch from b0912cb to a09d070 Compare December 23, 2022 10:54
@luciemac
Copy link
Collaborator

luciemac commented Jan 2, 2023

@bruyeret can you add / update tests ?

@luciemac luciemac closed this Jan 2, 2023
@luciemac luciemac reopened this Jan 2, 2023
@arjunrajlab
Copy link
Collaborator

Also, the updates from @manthey did lead to some speed up, but didn't solve the underlying problem of the order(s) of magnitude slowdown.

@arjunrajlab
Copy link
Collaborator

@manthey OK, I updated large_image to the latest version (19.*). I am still getting an issue with this file:
normmedia_8well_col2_livecellgfp
It seems to parse correctly, but the image just never shows up (see screenshot). Are you able to get this file to work for you?

image

@arjunrajlab
Copy link
Collaborator

I tested it and I think it is good!

@arjunrajlab
Copy link
Collaborator

Does this completely get rid of the JSON parsing if there is no compositing?

@arjunrajlab
Copy link
Collaborator

I tried checking "composite positions" for PMAIP1_NGFR_WNT5A.nd2" and no image showed up. But without checking that box, it was fine.

@arjunrajlab
Copy link
Collaborator

I added PMAIP1_NGFR_WNT5A.nd2 to the Dropbox: https://www.dropbox.com/sh/89axp9vwtt81o4v/AADHKe4Hon64InYWtnY9hRjFa?dl=0

@bruyeret bruyeret marked this pull request as ready for review February 3, 2023 16:16
@arjunrajlab
Copy link
Collaborator

OK, I think we can merge now!

@luciemac
Copy link
Collaborator

luciemac commented Feb 7, 2023

LGTM

@luciemac luciemac merged commit c223062 into master Feb 7, 2023
@luciemac luciemac deleted the feat/tile-compositing/244 branch February 7, 2023 09:08
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.

Tile compositing not working
4 participants