Negative connectivity?

I have run Purifiy & all my other metrics (Tb.Th, Tb.Sp., etc) all look fine but values for Connectivity Density come out negative.

Any idea why this should be?

Usually this is due to noise. Are you able to share an image?


Purify is good for removing tiny specs of noise, but if your image actually consists of multiple particles (pieces of bone) then that alone can make connectivity and thus connectivity density negative.

Best regards,

What Purify does is to remove all but the largest particle in both foreground and background phases.

Our use case was trabecular bone, which is a single connected network. The biggest single particle should normally be the foreground pixels representing the trabecular bone and the biggest background particle is the marrow space. Other bits of foreground are noise, cutting swarf, etc. Other bits of background are noise within the trabecular bone phase that appear to be cavities.

One possibility is that you have your phases mixed up so that your phase of interest is in the background, and the pore space/matrix relation is reversed. Normally we do it so that bone is represented by 255 (foreground) and marrow is 0 (background). It might look to the algorithm that your structure is not a branching object but a cavity. (This is where things get weird because you can think of, let’s say, a table as being a ‘cavity’ contained within the air phase - it all depends on what you call ‘foreground’ and ‘background’).

1 Like

Hi thanks for the responses.

I have used Purify on many image stacks & never had this problem before.

I’ve attached 2 images, one before I ran Purify & the other after.


Original image: tif

Original image: tif

Images aren’t shown. Could you make some TIFF stacks available online to download?

The uploaded images were in TIF format already (which is why some browsers do not display them). I replaced the images in the post above by png versions for display, and linked the originals below.

@DrBwts the two images look the same to me. Are you sure you processed them correctly?

@mdoube I explained how to fix this sort of posts in another discussion:

They are slightly different, which you can see with a subtraction operation.

Thanks for this. @DrBwts could you make stacks available? Connectivity is inherently a 3D operation.

1 Like

Unfortunately not. I had to do some negotiating just to get those 2 posted. These are TIFFs, I’m guessing the forum doesnt support them?

It’s a bit tricky to diagnose with 2D image slices, however:

  • You have the phases the right way around (bone = 255, background = 0)
  • Purify results in the bone phase getting segmented further (connected in 3D, probably, but in 2D, disconnected)
  • Connectivity is negative on the unpurified image and positive on the purified image
  • Connectivity is a bit different depending on whether you pad the slice with empty slices top and bottom because the connections that hit the sides are not counted if you pad the image

Some other observations:

  1. If you want the connectivity of trabecular bone, you had better get rid of all the cortical bone, or at least fill the small holes in it. This image has lots of little noisy pixels that will artifically increase connectivity. Running something like dilate dilate erode erode (all 3D versions) should help.
  2. Conn.D is calculated using the volume of the whole image stack, because it assumes that the stack is completely filled with trabeculae. If that is not the case, you will need to calculate it yourself using a volume measurement of the bone piece that does not include lots of outside space, or alternatively generate a substack that is completely filled with trabeculae.