embl-cba / DNA-FISH

0 stars 0 forks source link

Spot position measurements #3

Open tischi opened 4 years ago

tischi commented 4 years ago

@Mava04

Currently, there are two outputs in the table for the spot position. One is based on a difference of gaussian (DoG), the other is based on a centre of mass (CoM). Should we keep both? Which of those were used by the people in the Lab? I think it would be better if there was only one of them to avoid confusion.

Mava04 commented 4 years ago

We use the centre of mass.

tischi commented 4 years ago

Ok, this is good to know!

Are you aware that entering a proper background value for each channel is very important for this measurement to be correct?

Mava04 commented 4 years ago

I usually adjust brightness and contrast settings to see the "good" points well (good = a spot that has the maximum area in a slice, and becomes smaller going up or down) and then check if they were recognized in the FISH plugin. In case, I would adjust the threshold. Do you have suggestions to do it better? Also, I remember that the distance is calculated between the nearest FISH spots, but I am not sure whether it gets only the pairs made of spots from 2 different channels or just any pair (even in the same channel)

tischi commented 4 years ago
  1. The brightness and contrast settings do not matter at all for the position measurement! Only the numbers that one enters in the UI below matter: image
  2. For each channel it finds the closest spot to where the users puts a cross. That means per channel there can be only one spot. Then it computes the pairwise distances between the spots.
  3. Could you find a nice and small region in an image where there are clear spots with obvious results in terms of their distances and then crop this region and paste it here. Something like this, but maybe with more relevant cases, like some very close spots and some very far spots? Such that we can test that everything works as expected!
tischi commented 4 years ago

For measuring the background in the FISH channels one should draw an ROI in one nucleus (maybe several) in regions where there are no spots and then measure the mean intensity (see for example below). Maybe we should enforce this step in the plugin to make sure that people actually do it?

image

Mava04 commented 4 years ago

I have to admit, I used just to mouse over the image to check the intensity of the spots and that of the background. For your example, what would you use as "spot background values" in the end? I think it is worth enforcing the step only if the threshold choice is not discretionary.

tischi commented 4 years ago

Mouse over also is OK! But measuring it in a region is better. I will try adding this step to enforce it! Did you see my request a bit higher up about finding a small nice test region? (not urgent just wanted to check whether you saw it at all :)

Mava04 commented 4 years ago

Sure, I saw it. I was hoping to send it to you soon but I had to sort out other things before. I'll have a look now

Mava04 commented 4 years ago

@tischi I'm back on track! Here is the test region, let me now if you can download it and what you think. In case it does not look convincing to you, I still have plenty of embryos.

https://github.com/Mava04/fish/blob/master/Series002_decon_selection.tif

tischi commented 4 years ago

Looks interesting! Would you agree that we could use those two regions as test cases for spots that are "far" apart and "close" together?

image

Mava04 commented 4 years ago

@tischi Yes, it's a good choice!

tischi commented 4 years ago

Could you play a bit with this?

Measure the distances of these two pairs of spots:

  1. Manually
  2. Using the DoG
  3. Using the CoM (with a correct background subtracted)
  4. Using the CoM (with a too low background subtracted, by placing the background regions somewhere outside of the nuclei)

If we have these numbers I would add them to the documentation for reference (and for new users to see what they should expect). For example, new users should first download the test data and reproduce the numbers to make sure that they use the plugin correctly, what do you think?

Mava04 commented 4 years ago

@tischi Here is the table with the measurements. I tested what you suggested and I tried both the segmentation methods and two different types of wrong background (so that users would know what to expect, and out of curiosity) and I added some notes on how it behaves. With respect to the manual measurement, it seems that selecting a nuclear background greatly increses the distance of close points. Is this expected?

Series002_testImage_measure.xlsx

Mava04 commented 4 years ago

@tischi I also noticed that, as you said, the CoM is extremely sensitive. Maybe it's worth remarking it in the documentation, and explaining what is the advantage of each distance and what it is most suitable for.

tischi commented 4 years ago

With respect to the manual measurement, it seems that selecting a nuclear background greatly increases the distance of close points. Is this expected?

How did you do the manual measurement?

Mava04 commented 4 years ago

I just drew a line from the center of spot 1 to the center of spot 2 in the same plane, and then did Analyze > Measure. The scale was already set. The centers were between slice 15 and 16, so I just took one slice (that with the highest signal). Or should I compute the exact position of the centers (even if it is in between 2 slices)?

tischi commented 4 years ago

Yes, you should measure the distance in 3D, please. d = sqrt( dx^2 + dy^2 +dz^2 ), with everything in calibrated units.

Mava04 commented 4 years ago

@tischi Sorry, I realized I am not sure how to get the z coordinate of the centers if they are in between the planes. The intensity peak, checked by "Plot Z-axis profile", is always in slice 15.

tischi commented 4 years ago

I think you would have to manually compute it. For example, if it is between slice 14 and 15 and your voxel spacing in z is 0.8 um then the position would be: 0.8 * (0.5 * 15 + 0.5 * 14) If it is a closer to 15 you could give the 15 more weight (0.8): 0.8 * (0.8 * 15 + 0.2 * 14) This is called linear interpolation.

Another way is to fit a Gaussian to the line profile:

You can do this in all three dimensions to get the locations. Could you try this? Let me know if you need help! (e.g., on Thursday 10:00 - 12:00 there is the bioimage analysis drop-in session, see bio-it.embl.de, we could discuss more there).

Mava04 commented 4 years ago

@tischi I used the Gaussian fir directly, it seems more reproducible. The results do not change much: 0.323 μm for the far spots, 0.145 μm for the close ones. I updated the file and wrote how to do the measurements. I used rectangles instead of lines to take into account the intensity of the whole spot.

Series002_testImage_measure.xlsx