campaslab / napari-stress

Interactive surface analysis in napari for bio-mechanical stress measurement
https://campaslab.github.io/napari-stress/
BSD 3-Clause "New" or "Revised" License
17 stars 4 forks source link

Feedback on reconstruction quality confocal vs spinning disc imaging #317

Open elena-scarpa opened 1 year ago

elena-scarpa commented 1 year ago

Hello Johannes,

separately from the data visualisation issue I'd like some feedback on the reconstruction quality I get. I have been using a sigma smoothing of 2, 10 iterations for all droplets. Point resampling length of 2, trace length 30, sampling distance 1, linear interpolation and I set the outlier tolerance to the minimum allowed so 1.

I have 2 datasets, an older one (which we tested together) were images were acquired on a spinning disc so it does have quite a lot of haze above and below the droplet. The I'm showing you are test droplets in agarose so should be perfectly spherical in theory. if the droplet is very bright and pixels are saturated this gives some issues on the reconstruction that becomes pear shaped : 3D_agarose ctrl1_0 5

if acquisition settings were not saturated reconstructions can look OK 3D_agarose ctrl5_0 5 these are reconstructions from actual embryos: 3D_droplet reconstruction_refined points

So I tried with a new batch of oil that Claudia sent me to inject again and image on a confocal instead where I shouldn't get off target haze and these are the results: droplet_1_3Drefined points this second droplet looked wrinkled on one side and possibly was touching the glass bottom of the dish droplet_2_3Drefined points this is in a real embryo: e1_droplet1_ss5

What do you think? I haven't gone yet to the next step of measuring forces as I can't see the histograms in napari (as per my previous issue) , but I thought it would be good to have your feedback on the reconstruction in the meantime. thanks Elena

elena-scarpa commented 1 year ago

Looking at the summary I just sent you I wanted to add that the resolutions are slightly different : spinning disc images have a 0.37um voxel size while the confocal ones are 0.45 um.

jo-mueller commented 5 months ago

Hi @elena-scarpa ,

I realize I haven't answered here in a while - did you try the newer version? Current version is 3.3 and the pointcloud reconstructions should be MUCH more smooth now :)

elena-scarpa commented 5 months ago

Hi Johannes,

thanks! I am working on droplets pretty much full time this week as I am hoping to meet Otger in Heidelberg next week and this has become a priority. Are you going to the Mechanics of life meeting by any chance?

So should I

pip install napari-stress 3.0

and which version of matplotlib should I use? because I still can't visualise histograms and in the plugins>matplotlib> I don't have the feature histograms option, only "histograms" somehow (though I can export the results as csvs)?

elena-scarpa commented 5 months ago

Hi Johannes,

I hope you had a good Easter break!

So, I am working on the droplets full time this week. I also sent you a message on the 317 issue, but basically, which is the last version of napari-stress and of matplolib I should use, and what commands to I need to type into the terminal to install those?

Then I should be able to proceed myself (but do expect me to bother you some more 😊 Thanks a lot !

Best wishes Elena

Dr Elena Scarpa (she/her) Dorothy Hodgkin Research Fellow

Department of Physiology, Development and Neuroscience Anatomy Building, Downing Street Cambridge CB2 3DY @.***

From: Johannes Soltwedel @.> Date: Monday, 8 April 2024 at 10:14 To: campaslab/napari-stress @.> Cc: Elena Scarpa @.>, Mention @.> Subject: Re: [campaslab/napari-stress] Feedback on reconstruction quality confocal vs spinning disc imaging (Issue #317)

Hi @elena-scarpahttps://github.com/elena-scarpa ,

I realize I haven't answered here in a while - did you try the newer version? Current version is 3.3 and the pointcloud reconstructions should be MUCH more smooth now :)

— Reply to this email directly, view it on GitHubhttps://github.com/campaslab/napari-stress/issues/317#issuecomment-2042256070, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6L777H5FHCR2LSPXQUZT43Y4JNYZAVCNFSM6AAAAAA2VOC2R2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGI2TMMBXGA. You are receiving this because you were mentioned.Message ID: @.***>

elena-scarpa commented 5 months ago

Hi Johannes,

Another question I have is how do I save my reconstructions once I am -lets say- happy with them so that I can go back to do more analysis later? At the moment I am keeping a record of the parameters I am using but then it looks like I can save only “screenshots” of the visualisation layers, but I don’t know how to save the analysis file so that it can be re-opened again later without running the analysis on the droplet from scratch, do you understand what I mean?

I think for publication sake, journals now tend to want the raw images and analysis datasets so this could be also valuable to have to meet open access requirements. Best wishes Elena

Dr Elena Scarpa (she/her) Dorothy Hodgkin Research Fellow

Department of Physiology, Development and Neuroscience Anatomy Building, Downing Street Cambridge CB2 3DY @.***

From: Elena Scarpa @.> Date: Monday, 8 April 2024 at 10:34 To: campaslab/napari-stress @.>, campaslab/napari-stress @.> Cc: Mention @.>, Johannes Richard Soltwedel @.***> Subject: Re: [campaslab/napari-stress] Feedback on reconstruction quality confocal vs spinning disc imaging (Issue #317) Hi Johannes,

I hope you had a good Easter break!

So, I am working on the droplets full time this week. I also sent you a message on the 317 issue, but basically, which is the last version of napari-stress and of matplolib I should use, and what commands to I need to type into the terminal to install those?

Then I should be able to proceed myself (but do expect me to bother you some more 😊 Thanks a lot !

Best wishes Elena

Dr Elena Scarpa (she/her) Dorothy Hodgkin Research Fellow

Department of Physiology, Development and Neuroscience Anatomy Building, Downing Street Cambridge CB2 3DY @.***

From: Johannes Soltwedel @.> Date: Monday, 8 April 2024 at 10:14 To: campaslab/napari-stress @.> Cc: Elena Scarpa @.>, Mention @.> Subject: Re: [campaslab/napari-stress] Feedback on reconstruction quality confocal vs spinning disc imaging (Issue #317)

Hi @elena-scarpahttps://github.com/elena-scarpa ,

I realize I haven't answered here in a while - did you try the newer version? Current version is 3.3 and the pointcloud reconstructions should be MUCH more smooth now :)

— Reply to this email directly, view it on GitHubhttps://github.com/campaslab/napari-stress/issues/317#issuecomment-2042256070, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6L777H5FHCR2LSPXQUZT43Y4JNYZAVCNFSM6AAAAAA2VOC2R2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGI2TMMBXGA. You are receiving this because you were mentioned.Message ID: @.***>

elena-scarpa commented 5 months ago

So I have some droplets which are deep in tissue and have quite a bit of haze above and below (obviously these are the drops I am interested in, else life would be too easy!) whilst other drops acquired at the same time reconstruct pretty well, these don't.

relatively good droplet, same embryo, different location e4drop2_t1_refined points

bad droplet: e4drop3_t1_refined points_sigma2

I used now a smoothing sigma of 3, 99 iterations (not sure the n of iterations make a difference) and removed manually the off target points. e4drop3_t1_refined points_sigma3_99iterations_corrected

I now have a droplet with a hole though, which makes some strange artefacts once I try the stress measurements: e4drop3_t1_afterstressmeasurements_sigma3_99iterations_corrected

can I trust these measurements? I am not sure....

I also tried to preprocess the image using a background subtraction but it didn't help. do you have any filters you'd suggest I use in preprocessing (Fiji please :)) to remove the haze above and below my images? (see also similar issue in the thread above)

I could try imaging on a confocal alternatively, but it does slow down my acquisition approximately from 10 s to 30 minutes for the same size droplet.

Best wishes ELena

jo-mueller commented 5 months ago

Hi @elena-scarpa ,

I have seen the message, but I'd prefer to answer here if it's ok for you so that other people with the same problem can find the answer to the question as well.

Installation instructions

I have added some more details to the installation instructions on the documentation page. The latest version is always shown on the top (currently 0.3.3) and I would advise to always go with the latest one - there are still a few bugs left in the plugin and there are less in the later versions :) There are some more in-deppth hints in the FAW section there.

Reconstruction quality

Which version of the code were you using? As of 0.3.0, there is some more advanced smoothing in the code which could potentially fix some of the exploding droplets. Otherwise, increasing the smoothing sigma parameter would probably be my first advice to improve the outcome. The results of reconstructed droplets like in your last image you probably shouldn't trust.

Essentially, if the surface first guess in the results of the reconstruction looks good to you, there's only the refinement step to tweak (see docs). There are also a few ideas on how to tweak the parameters for better reconstruction and a short breakdown of what they mean.

Hope this helps!

Best, Johannes

elena-scarpa commented 5 months ago

Hi Johannes,

thanks for this! I have been playing around for a while with smoothing sigma, sampling distance, number of iterations, changing trace length and outliers cutoff, you name it. I now understand what effect the various parameters have, but some droplets are just hopeless, if they have haze on top and below the points first guess will look like a cylinder.

this below, I used a smoothing sigma of 4, 99 iterations, very short trace length (5) for the refined points, 0.8 of outlier removal, 0.6 sampling distance linear tracing (iterations of the surface tracing doesn't help) C2-e2_trunk_movie_drop1_refinedpoints+first guess

and this is I think because the original image has lots of scattering as we're in deep tissue, and there isn't much I can do about that...I can use a confocal, but even in my confocal stacks I do get the volcano effect to an extent.... any filters I could use for preprocessing? C2-e2_trunk_movie_drop1_originaltiff

jo-mueller commented 5 months ago

Hi @elena-scarpa ,

looking at the images I think there is really something missing in terms of image quality :/ In the example you posted above, I think I can (probably) make out the upper end of the droplet, but the lower end I could not in good conscience identify myself so it's not surprising to me that stress has a hard time doing so, too.

Is there a chance you good up the image quality a bit? The spatial sampling looks alright though (i.e., plenty of slices in the z-stack taken)