If you can upload the non-compressed images from the visualization next time, that would be better. There is some loss of detail in these small file-size images, but it works for today.
Overall this looks like a great improvement. Most boutons that were either too far away or inside the outline have been eliminated.
Here are some comments on cell 1:
Boutons 9 + 10 -- I can see the problem (two small swellings in the axon on z-planes 6 + 7), but don't know if it can be fixed. The left-most little swelling (#9) on z6 is part of the larger bouton further to the left (my bouton #7, but uncounted on yours because of the top-of-the-cell issue), but there is a region of dark pixels separating it from the bouton on this z-plane. The right one (#10) is too small to be a bouton in my experience, but it's probably supra-threshold, so it gets masked + ID'ed. This just may be a limit that we will encounter... Some sort of min distance thing could be worth a try, but I think it would be tricky to make it robust to all of the different types of real-world scenarios we may see.
Boutons 8 + 26 -- similar thing from above is going on here, with respect to my bouton #7 + your bouton #10. In this case, your bouton #8 is legit (it's my #47), but there is a small dark line on z12 about 1/4 of the way from the bottom of this bouton, which must be infra-threshold, meaning that it gets ID'ed as a unique structure. I guess two things could be tried. One is to only call things boutons when they are present on 2 consecutive z-planes, although I think this would be over aggressive and may lead us to miss many of the smaller/smallest boutons, since even by eye there can only be 1 plane that is really bright, with dimmer / very dim pixels just above and below on adjacent z-planes. Another idea is a variation on the min distance idea, to force this sort of constraint especially for boutons that exist only on 1 z-plane; maybe the local neighborhood of these small boutons and/or single-plane boutons could be searched to see if there is a larger bouton that they could legitimately be a part of, in effect expanding the de-duping idea to XY in select cases.
I think boutons 41 + 42 have the same thing going on.
Boutons 53 + 58, too
Boutons 103 + 106, too
101 + 114, too
15 + 66, too
78 + 79, too
the cluster around my boutons #34 + 53 is another example (on z-planes 24-28, bottom corner of the cell body); lots of little islands of things there that get broken up, likely due to thresholding issues
*But, an example of a single-plane bouton that we want to keep is your #65, which is my #43. I would say there are actually bouton fragments that should all be supra-threshold on z19-21, but it looks like the algorithm only detects what's on z21 as being so.
So yeah, some sort of min distance thing is worth a try, I'd say, to see how it improves the accuracy metrics. Another idea I just thought of, I'm not sure I can explain well by email but I'll try, is to try some sort of 2 threshold idea. First, you would have this relatively high threshold that appears to be in use now, which risks over-segmentation. Then, you would have a second, slightly lower threshold that would probably result in too many things being lumped together into the same mask in a given area. The idea would then be to look at the high-threshold image first to ID boutons, then to switch to the lower-threshold space to see if there is a reasonable chance that the "islands" poking out above the background in the high-threshold version are actually part of the same bouton. For example, think about the shape of the capital letter U, pretending that the y dimension is intensity. If the threshold is high, you only see the tops of the vertical parts of the letter (i.e., 2 dots), while if it's lower you see more of the vertical parts (i.e., 2 lines rather than just two dots), and if it's really low you see the whole thing (see attachment). The idea would be to progressively lower the threshold in a local area and come up with some sort of cost function to see how expensive it is to link the two points. ... Actually, maybe it would be easier to just look back to the original image. As an actual example, you would take the centroids for 2 boutons (i.e., # 8 + 26, mentioned above) and draw a line between then, retrieving the fluorescence profile connecting those two points. See slide 2 of attachment. The overall cost function would be written to include parameters such as distance, but critically would include information about this fluorescence profile from a line connecting two centroids, taking into account the magnitude of the drop in fluorescence between the two points. In this case, it's cheap, but if the image values somehow dropped to much lower along that same line, that would be more expensive. You could start with a hard-coded "acceptable drop in fluorescence" along the line, as say 70-80% of the lesser of the two maxima -- in this example, if fluorescence along the line of a smoothed (i.e., Gaussian filtered) image drops no less than 70% of the lesser maxima (~620 is lesser maxima, so 70% of this is ~430), then the 2 boutons originally identified in the high-threshold image are determined to be parts of a whole.
I think something like this may be our best bet for getting around these thresholding difficulties. Let me know if it makes sense, and if not, I can come by and try to explain what I mean either mid-afternoon on Thursday or on Friday around 11:15/11:30 briefly or after 4:30/4:45.
Hmm, can't attach ppt so will just email to you both.
@jsniff
If you can upload the non-compressed images from the visualization next time, that would be better. There is some loss of detail in these small file-size images, but it works for today.
Overall this looks like a great improvement. Most boutons that were either too far away or inside the outline have been eliminated.
Here are some comments on cell 1:
So yeah, some sort of min distance thing is worth a try, I'd say, to see how it improves the accuracy metrics. Another idea I just thought of, I'm not sure I can explain well by email but I'll try, is to try some sort of 2 threshold idea. First, you would have this relatively high threshold that appears to be in use now, which risks over-segmentation. Then, you would have a second, slightly lower threshold that would probably result in too many things being lumped together into the same mask in a given area. The idea would then be to look at the high-threshold image first to ID boutons, then to switch to the lower-threshold space to see if there is a reasonable chance that the "islands" poking out above the background in the high-threshold version are actually part of the same bouton. For example, think about the shape of the capital letter U, pretending that the y dimension is intensity. If the threshold is high, you only see the tops of the vertical parts of the letter (i.e., 2 dots), while if it's lower you see more of the vertical parts (i.e., 2 lines rather than just two dots), and if it's really low you see the whole thing (see attachment). The idea would be to progressively lower the threshold in a local area and come up with some sort of cost function to see how expensive it is to link the two points. ... Actually, maybe it would be easier to just look back to the original image. As an actual example, you would take the centroids for 2 boutons (i.e., # 8 + 26, mentioned above) and draw a line between then, retrieving the fluorescence profile connecting those two points. See slide 2 of attachment. The overall cost function would be written to include parameters such as distance, but critically would include information about this fluorescence profile from a line connecting two centroids, taking into account the magnitude of the drop in fluorescence between the two points. In this case, it's cheap, but if the image values somehow dropped to much lower along that same line, that would be more expensive. You could start with a hard-coded "acceptable drop in fluorescence" along the line, as say 70-80% of the lesser of the two maxima -- in this example, if fluorescence along the line of a smoothed (i.e., Gaussian filtered) image drops no less than 70% of the lesser maxima (~620 is lesser maxima, so 70% of this is ~430), then the 2 boutons originally identified in the high-threshold image are determined to be parts of a whole.
I think something like this may be our best bet for getting around these thresholding difficulties. Let me know if it makes sense, and if not, I can come by and try to explain what I mean either mid-afternoon on Thursday or on Friday around 11:15/11:30 briefly or after 4:30/4:45.
Hmm, can't attach ppt so will just email to you both.