Removing Parts of the Image Below a Threshold Size

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Removing Parts of the Image Below a Threshold Size

Sinead Roberts
Dear All,

Is there any way to remove from the image 'bits' that are below a  
certain size, i.e. to do a size threshold (analogous to an intensity  
threshold?). I know you can do this when measuring particles, but I  
want to do it before this from a stack of images prior to creating a z-
projection from the image.

Thanks very much for your help,
Sinead Roberts
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

Gabriel Landini
On Tuesday 05 Jan 2010  15:06:37 you wrote:
> Is there any way to remove from the image 'bits' that are below a
> certain size, i.e. to do a size threshold (analogous to an intensity
> threshold?). I know you can do this when measuring particles, but I
> want to do it before this from a stack of images prior to creating a z-
> projection from the image.

That would take some time to do interactively as one has to process all the
thresholded areas each time there is a change of threshold.
However you can threshold first and then delete particles on the binary image,
based on their size.
Partilces8 and Particles4 can delete particles less and larger than certain
size in pixels.
These are in the Morphology collection here:
http://www.dentistry.bham.ac.uk/landinig/software/software.html

Cheers.
G.
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

Sinead Roberts
That is brilliant, thank you very much,

Sinead

On 5 Jan 2010, at 15:10, Gabriel Landini wrote:

> On Tuesday 05 Jan 2010  15:06:37 you wrote:
>> Is there any way to remove from the image 'bits' that are below a
>> certain size, i.e. to do a size threshold (analogous to an intensity
>> threshold?). I know you can do this when measuring particles, but I
>> want to do it before this from a stack of images prior to creating  
>> a z-
>> projection from the image.
>
> That would take some time to do interactively as one has to process  
> all the
> thresholded areas each time there is a change of threshold.
> However you can threshold first and then delete particles on the  
> binary image,
> based on their size.
> Partilces8 and Particles4 can delete particles less and larger than  
> certain
> size in pixels.
> These are in the Morphology collection here:
> http://www.dentistry.bham.ac.uk/landinig/software/software.html
>
> Cheers.
> G.
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

valenzul
Hello,
I know this is an old post. I have 8-bit gray scale LUT root scanned images that I'm trying to clean out of small "dots" "unshaped particles" (sawdust and soil particles). I just installed the latest version of Image J and download the morphology plug-ins and macros and unzipped them inside the plug-in folder as instructed on your web page. However, I have not had any success getting the macro to work. After I upload the image I run the macro "KeppparticlesInRange" and is giving me a message "Unrecognized command: "Particles8".  
I think where I'm confused is on the following statement/procedure "Partilces8 and Particles4 can delete particles less and larger than certain size in pixels". Do I'm missing a a step or another macro before trying to run the macro?
Will this procedure erase the "particles" from the image after? Would it be possible to save the image with the erased particles? I need to run the cleaned image on other software to measure root lengths.
I included an example of one of my images, all those dots are the particles I want to delete. I've been doing this manually using gimp but is taking a long time. I hope Image J can do that for me.
Thanks for your help,
Luis ValenzuelaExample scanned image
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

Gabriel Landini
On Tuesday 10 Nov 2015 10:12:12 valenzul wrote:
> Hello,
> I know this is an old post. I have 8-bit gray scale LUT root scanned images
> that I'm trying to clean out of small "dots" "unshaped particles" (sawdust
> and soil particles). I just installed the latest version of Image J and
> download the morphology plug-ins and macros and unzipped them inside the
> plug-in folder as instructed on your web page. However, I have not had any
> success getting the macro to work. After I upload the image I run the macro
> "KeppparticlesInRange" and is giving me a message "Unrecognized command:
> "Particles8".

Did you re-start ImageJ?

The morphology collection is at:
http://www.mecourse.com/landinig/software/software.html
the link to the file is
http://www.mecourse.com/landinig/software/morphology.zip

> I think where I'm confused is on the following statement/procedure
> "Partilces8 and Particles4 can delete particles less and larger than certain
> size in pixels". Do I'm missing a a step or another macro before trying to
> run the macro?

Those 2 plugins are in the package above.
Once you install them, can you see them in the Plugins>morphology folder?

They only work on binary images. Is your image binary?

> Would it be possible to save the image with the erased particles?

Yes, like any other image.

Cheers
Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

amoghj
In reply to this post by valenzul
Hi!
I was wondering if your main problem is to only get rid of all the small
particles.
If so, then you can threshold your image, and use the Analyze Particles
function under Analyze. You can then set the size cut-off (to exclude
smaller sized particles), and the circularity(to remove particles than are
'round'); and finally set the Show: option to Masks in the drop down menu,
and hit ok.
Now use the Image Calculator function under Process, and carry out the
operation AND. This should leave you with just the particles of your
interest.
PFA the recorded actions, the thresholded image and the final image with
just the areas of interest.

setAutoThreshold("Default");

//run("Threshold...");

run("Analyze Particles...", "size=60-Infinity circularity=0.00-0.60
show=Masks display clear summarize");

selectWindow("P#233-S59-(20-30)-01-274_progress_cropped.jpg");

resetThreshold();

imageCalculator("AND create", "Mask of
P#233-S59-(20-30)-01-274_progress_cropped.jpg","P#233-S59-(20-30)-01-274_progress_cropped.jpg");


Hope this helps!

Best,

Amogh

On Tue, Nov 10, 2015 at 1:12 PM, valenzul <[hidden email]> wrote:

> Hello,
> I know this is an old post. I have 8-bit gray scale LUT root scanned images
> that I'm trying to clean out of small "dots" "unshaped particles" (sawdust
> and soil particles). I just installed the latest version of Image J and
> download the morphology plug-ins and macros and unzipped them inside the
> plug-in folder as instructed on your web page. However, I have not had any
> success getting the macro to work. After I upload the image I run the macro
> "KeppparticlesInRange" and is giving me a message "Unrecognized command:
> "Particles8".
> I think where I'm confused is on the following statement/procedure
> "Partilces8 and Particles4 can delete particles less and larger than
> certain
> size in pixels". Do I'm missing a a step or another macro before trying to
> run the macro?
> Will this procedure erase the "particles" from the image after? Would it be
> possible to save the image with the erased particles? I need to run the
> cleaned image on other software to measure root lengths.
> I included an example of one of my images, all those dots are the particles
> I want to delete. I've been doing this manually using gimp but is taking a
> long time. I hope Image J can do that for me.
> Thanks for your help,
> Luis Valenzuela
> <
> http://imagej.1557.x6.nabble.com/file/n5014907/P%23233-S59-%2820-30%29-01-274_progress_cropped.jpg
> >
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Removing-Parts-of-the-Image-Below-a-Threshold-Size-tp3689834p5014907.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Result.tif (324K) Download Attachment
Threshold.tif (324K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

valenzul
In reply to this post by Gabriel Landini
Hello Gabriel,
Yes I re-started the program after installed-added the folder with the plug-ins. Yes, I can see list of morphology plug-ins/macros under the plugins menu.
My images are not binary, they are 8-bit grayscale. After your suggestion, I converted an image to binary using Gimp software, and try to run the macro again. If running the macro consist on just open the binary image and open the macro "Keepparticles" from the plugins menu, ImageJ still is giving me the window showing "unrecognized command: "Particles8".

The method proposed by Amogh below worked fine, but I just wanted to clarify with you that the macro still is not working for me just in case you wanted to double check. I'm not an expert on the software, so I want to say that is probably something on my side.
Thanks,
Luis
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

valenzul
In reply to this post by amoghj
Hello Amogh,
Thanks for taking the time on the matter. Your method worked for my images.
Still the macro did not work for me.
Thank you very much for your help.
Best,
Luis Valenzuela
Reply | Threaded
Open this post in threaded view
|

Re: Removing Parts of the Image Below a Threshold Size

Gabriel Landini
In reply to this post by valenzul
On Tuesday 10 Nov 2015 14:44:23 valenzul wrote:

> My images are not binary, they are 8-bit grayscale. After your suggestion, I
> converted an image to binary using Gimp software,

You can binarise them in IJ too.

> and try to run the macro
> again. If running the macro consist on just open the binary image and open
> the macro "Keepparticles" from the plugins menu, ImageJ still is giving me
> the window showing "unrecognized command: "Particles8".

Hm... Can you email me privately this macro and I will have a look. It runs
fine here.

If you press CTL-L (the IJ control panel) and search for "Particles" do you
see the Particles8 and 4 plugins in the list?
Also are you sure that you have just under Plugins the morphology folder with
all the plugins inside, and not another "morphology" folder inside it?
Do you see Particles8 in the Plugins menu entry, under Morphology?

As far as I remember IJ can see only one level of subfolders.

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html