Spatial analysis 2D/3D

plugin
Tags: #<Tag:0x00007fd6a00dc1f8>

#1

Hi,
Does anyone has experience using the spatial analysis 2D/3D plugin? I have tried to use it on randomly distributed objects and on well defined clusters but in both cases I get SDI equal 1 (using F and G functions). I would really appreciate your help

Thanks,
Reinat


#2

@Reinat

Are you referring to this Spatial Statistics 2D/3D plugin by @ThomasBoudier and Philippe Andrey (just invited to this thread)?

eta


#3

Yes by ThomasBoudier and Philippe Andrey


#4

Dear @Reinat,

Can you please provide the image you are testing? Perhaps that way we’ll manage to help you a bit faster.

Best

Oli


#5

Thanks for your help
The black mask represent the area, I have also attached two example of masks, one is almost random where as the other one has two clusters.
Thanks,
Reinat


#6

So the first thing is that your images should have the mask and spots be white on a black background. At least for me. Otherwise the mask is going to be the whole image minus your area.

I tried with both images. And I get an F value of 0.0 and of 1.0 as expected, as the two cases you gave me are extreme.

// Clustered Spots
Segmenting image...
mask not calibrated, calibrating ...
Computing spatial statistics, please wait ...
Nb Spot=84
Volume mask=38933.0
Density=0.002157552718773277
--- F Function ---
SDI F=1.0
--- G Function ---
SDI G=1.0

// Almost Random
Segmenting image...
mask not calibrated, calibrating ...
Computing spatial statistics, please wait ...
Nb Spot=189
Volume mask=38933.0
Density=0.0048544936172398735
--- F Function ---
SDI F=0.0
--- G Function ---
SDI G=1.0

So try inverting the images you have and try again. Let me know if that works!

Oli


#7

Dear Oburri,

Frankly I am confused. Yes when using the jpeg files I had to invert the images as you have suggested but in those images I do not get the correct number of spots as you got. When using my original TIF files, which I do not need to invert I get the correct number of spots but bot the F and the G functions (in both random and cluster) are zero.

Thanks for your help,
Reinat


#8

Hi again.
Odd indeed. Might i suggest you share the exact files (tifs) you are using for the test. Perhaps through Dropbox or in a zip file here if they’re not too big.

Best


#9

Dear Oburri

Here is a dropbox link:

Thanks again,
Reinat


#10

Dear Reinat,

Sorry I did not notice your post earlier. It did not show up on my updates. If you want to make sure that your correspondent gets a notification, add an @ before the user name like @oburri, that way I will receive a message.

I think I have it figured out. It would appear that for some reason having a set scale is causing issues. with the calculation of the F

\\ With Calibration, almost random spots
Segmenting image...
Computing spatial statistics, please wait ...
Nb Spot=84
Volume mask=147627.6222443798
Density=5.689992070789305E-4
--- F Function ---
SDI F=1.0
--- G Function ---
SDI G=1.0

\\ Without Calibration, almost random spots
Segmenting image...
Computing spatial statistics, please wait ...
Nb Spot=189
Volume mask=147627.6222443798
Density=0.0012802482159275938
--- F Function ---
SDI F=1.0
--- G Function ---
SDI G=1.0
Segmenting image...
mask not calibrated, calibrating ...
Computing spatial statistics, please wait ...
Nb Spot=189
Volume mask=38933.0
Density=0.0048544936172398735
--- F Function ---
SDI F=0.0
--- G Function ---
SDI G=1.0

It seems that the mask volume is in pixels, but the density calculation takes the pixel size into consideration, so perhaps that is what is screwing with the SDI calculation.

So the easiest is to remove your calibration before running the plugin… worked for me.
go to Image > Properties… and set the unit to pixel and all values to 1.0
image

Hopefully @ThomasBoudier can update the code, or somehow make it available so someone can fix this.

Again sorry for the delay


#11

Hi @Reinat and @oburri,

Note that your data must be correctly labelled, meaning that the background should have a value of 0. In your case the background is white but its value is 0, because your are using an inverted lut visualisation.

In your case the particles are quite big in diameter so an important parameter to take into account is the hard core distance. This distance refers to the minimal distance between two particles. In your experiment a value of 8 seems appropriate.

I will look into the problem of calibrated distances and hope to come back to you soon.

Best,

Thomas


#12

Hi @oburri @ThomasBoudier

THANK YOU!!!
The scaling did solve the problem. Thank you both for all the suggestions, this is really really helpful!!!
Have a great day,
Reinat


#13

Hi @Reinat,

The calibration problem should be fixed in latest version in Fiji.

Best,

Thomas


#14

@ThomasBoudier

Great, Thanks!