Fill in Holes Format Problem


#1

I want to use the plugin “Fill Holes” but I keep getting the error message “8-bit binary (black and white) image required”. This seems like an easy fix, but going based off of other forum topics I still can’t find an answer.
I have tried:
Process-Binary-Options…EDM output: 8-bit
Image-Type- 8-bit
The original image and black and white image:
https://drive.google.com/open?id=1iJ6DfT-RIhCstEeqFT568QwYfep1Tr8z


#2

Good day Taylor,

this looks familiar to me.

Here is a macro snippet:

run("Make Binary");
run("Fill Holes");

Perhaps you’ve saved the file as JPEG or PNG which may have caused the trouble. In any case the provided image

  1. 5117 NewT2 6-14,15,21-17L_R 1-3u Loaded12-7-17UnCoat 4x200s Diaph.8h.tif

isn’t binary-valued.

Regards

Herbie


#3

Taylor,

here are the results from the original sample image you’ve provided

5117 NewT2 6-14,15,21-17L_R 1-3u Loaded12-7-17UnCoat 4x200s Diaph.8h.TIF

obtained with the macro provided here:
http://forum.imagej.net/t/looking-for-a-versatile-protocol-to-analyze-fused-particles/8399/13?u=herbie

run("Set Measurements...", "feret's redirect=None decimal=2");
run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
run("Median...", "radius=10");
run("Subtract Background...", "rolling=50 light separate sliding");
run("8-bit");
setAutoThreshold("Triangle");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Fill Holes");
run("Watershed");
run("Analyze Particles...", "size=10000-Infinity circularity=0.50-1.00 show=Outlines display exclude clear");

Not sure what the current problem is on your side.

Regards

Herbie


#4

Herbie,

Thank you for all your help. After all this time I have finally compiled a process that works consistently well.

Take care,

Taylor


#5

Nice Taylor!

I have finally compiled a process that works consistently well.

Does this mean that my macro doesn’t work?

And evidently (this thread) you seem to still have some trouble.
Please tell us if there are further problems.

Could you post your “process” in order to help others with similar problems.

Clueless

Herbie


#6

Just for completeness… the fill holes, as discussed is a binary image operation. However there is also a greyscale image hole filling procedure. In the Morphology collection there is such procedure available (Fill_Greyscale_Holes macro) that is based on 4-connected greyscale reconstruction.
The morphology collection is available via the Morphology Fiji update site, and also here:
http://www.mecourse.com/landinig/software/software.html


#7

Herbie,

For some reason your macro didn’t work well for the images with more beads included and my old protocol had been failing as well although it used to work perfectly. I’m not sure if an update messed things up or what but that’s why I came here in the first place. The macro I use now:

run("8-bit");
run("Pseudo flat field correction", "blurring=120");
close();		
run("Median...", "radius=6");
run("Unsharp Mask...", "radius=8 mask=0.70");
run("Auto Threshold", "method=Otsu");
run("Make Binary");
run("Fill Holes");	
run("Watershed", "tolerance=0.1"); 
run("EDM Binary Operations", "iterations=25 operation=open");  //change the iteration if smaller objects are eliminated
setOption("BlackBackground");	
run("Analyze Particles...", "size=5000-Infinity pixel display show=Outlines exclude add");

Hope this helpful for someone else as well. Thank you for all your help.

Taylor


#8

Taylor,

please post a link to an original image that isn’t processed acceptably by my macro and please use the macro posted by me earlier in this thread:
http://forum.imagej.net/t/fill-in-holes-format-problem/8473/3?u=herbie

Regards

Herbie

EDIT:
I’ve just compared the results obtained when applying your current macro and mine to your sample image

5117 NewT2 6-14,15,21-17L_R 1-3u Loaded12-7-17UnCoat 4x200s Diaph.8h.TIF

and doubtlessly there is a difference in favour of my approach.


#9

Herbie,

You can use the image I posted at the beginning of this post. It comes out as odd shapes instead of consistently rounded edges for each bead.

Taylor


#10

Taylor,

so you don’t like some odd shaped objects (from the sample image I get only one) but your macro misses three objects …

As far as I remember you are interested in the object diameters and if computed appropriately they are not influenced by what you call odd shapes.

I’ve added a final part to my macro that gives the diameter estimates as described in the earlier thread:

run("Set Measurements...", "feret's redirect=None decimal=2");
//run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
run("Median...", "radius=10");
run("Subtract Background...", "rolling=50 light separate sliding");
run("8-bit");
setAutoThreshold("Triangle");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Fill Holes");
run("Watershed");
//run("Analyze Particles...", "size=10000-Infinity circularity=0.50-1.00 show=Outlines display exclude clear");
run("Analyze Particles...", "size=10000-Infinity pixel circularity=0.50-1.00 show=Outlines display exclude clear");
for ( i=0; i < nResults; i++ ) { 
	feret = getResult( "Feret", i );
	miFrt = getResult( "MinFeret", i );
	if ( feret > 1.1 * miFrt ) {
		diam = miFrt;
	} else {
		diam = 0.5 * ( feret + miFrt );
	}
	setResult( "Diameter", i, diam );
}

The results are in inches now and the estimated diameters are listed in a separate column.

Please tell me if something is not as desired.

Regards

Herbie


#11

Herbie,

I haven’t had any trouble with missing objects in my macro. This is another reason why I think there is some sort of problem with my image j. I started having issues with my original protocol randomly two weeks ago and that’s when I decided to come here for help. The only explanation I can think of is some sort of issue with an update.

Best,

Taylor


#12

This sounds quite obscure.

Did you try my more recent macro and are the outputed diameters as expected?

Regards

Herbie


#13

Herbie,

I have tried going back in recent upgrades and using different macros but nothing has really been solved. I mainly was expected to use the protocol that others have been used in the past but it was developed by someone not as familiar with the system. It wasn’t given to me in macro form and each image would take several minutes to complete.
It’s hard to say what happened and why the original protocol was deemed acceptable.

Best,

Taylor


#14

Please Taylor,

could you answer my question or can’t you run my macro (for what reason)?

Regards

Herbie


#15

Herbie,

I can run your macro but it still gives me a few odd shapes for objects that come up as circular using the macro that consistently work well. I don’t see any reason to try new macros now that I have found one that works.

Best,

Taylor


#16

Ok fine Taylor and thanks!

Why do odd shapes pose what kind of problem?

What about the diameters, are they consitent with those gained by your approach?

Please understand that after all my investment I should like to know what’s going on.

Regards

Herbie


#17

Herbie,

The odd shapes are troublesome because I fear that they affect the major diameter reading. Our results appear to be different as well. https://drive.google.com/open?id=1VViO-sIlhcxXMevBM1LhbClRaF0ZQuX3

Best,

Taylor


#18

Thank you very much,

the difference of the numerical results most likely is due to

run("EDM Binary Operations", "iterations=25 operation=open");

in your code.

The general problem with these measurements is, how they are influenced by the previous processing. I’ve mentioned this problem in one of your earlier threads. In other words, yet we don’t know which diameter estimates come closer to the actual diameters. To answer this question requires the knowledge of the latter …

Thanks again and good luck

Herbie