Find connected regions 3D / Flood filling 3D from seed region

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

Find connected regions 3D / Flood filling 3D from seed region

Djoere Gaublomme
Hi,

I want to perform an action on a large 3D image stack (8-bit  
grayscale, approximately 800x800x800 and 500 MB).
The action I want to do is to start from a selected ROI (preferably  
based on a separate Mask image) and find all neighbouring voxels with  
the same gray values (for clarification: I only want to select voxels  
that have the same gray value as a selected neighbouring voxel).  It  
does not matter whether gray value information is retained in the  
resulting image or not.

For now, the only solution I found was to add an object to the 3D  
Manager from the Mask image, then put this selection on the grayscale  
stack and run "Find Connected Regions"
[http://www.longair.net/edinburgh/imagej/find-connected-regions/ ,  
with the following parameters : run("Find Connected Regions", "  
display_one_image display_results regions_must  
regions_for_values_over=1 minimum_number_of_points=1 stop_after=-1"); ]

However, this takes forever to process, so I am wondering if there is  
a faster alternative (and preferably one that is macro-friendly).
I have tried Flood Fill (3D), but this does not appear to work with a  
seed region.

Thanks in advance!

Djoere

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Ignacio Arganda-Carreras
Hello Djoere,

You might want to install the IJPB-plugins library. It comes with an
efficient implementation of Connected Components in 3D that you can use to
find the region you want after binarizing it with the proper threshold.

http://github.com/ijpb/ijpb-plugins

After installation, you should have the plugin under "Plugins > Fast
Morphology > Binary Images > Connected Component Labeling".

Let me know if you need more help,

ignacio

On Wed, Oct 1, 2014 at 10:54 AM, Djoere Gaublomme <[hidden email]
> wrote:

> Hi,
>
> I want to perform an action on a large 3D image stack (8-bit grayscale,
> approximately 800x800x800 and 500 MB).
> The action I want to do is to start from a selected ROI (preferably based
> on a separate Mask image) and find all neighbouring voxels with the same
> gray values (for clarification: I only want to select voxels that have the
> same gray value as a selected neighbouring voxel).  It does not matter
> whether gray value information is retained in the resulting image or not.
>
> For now, the only solution I found was to add an object to the 3D Manager
> from the Mask image, then put this selection on the grayscale stack and run
> "Find Connected Regions"
> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
> the following parameters : run("Find Connected Regions", "
> display_one_image display_results regions_must regions_for_values_over=1
> minimum_number_of_points=1 stop_after=-1"); ]
>
> However, this takes forever to process, so I am wondering if there is a
> faster alternative (and preferably one that is macro-friendly).
> I have tried Flood Fill (3D), but this does not appear to work with a seed
> region.
>
> Thanks in advance!
>
> Djoere
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Seung's lab, 46-5065
Department of Brain and Cognitive Sciences
Massachusetts Institute of Technology
43 Vassar St.
Cambridge, MA 02139
USA

Phone: (001) 617-324-3747
Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Thomas Boudier
In reply to this post by Djoere Gaublomme
Hi Djoere,

Not sure to fully understand, but it seems that you have some seeds, and
want to aggregate voxels to these seeds based on some criteria. May be
have a look to some spots detection plugins like

http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection

you need two images, one with seeds (may be you need to "draw" your
rois) and a signal image, it uses local threshold to aggregate voxels to
the seeds, in your case, local threshold is a constant.

Hope this helps

Thomas


On 01/10/14 16:54, Djoere Gaublomme wrote:

> Hi,
>
> I want to perform an action on a large 3D image stack (8-bit grayscale,
> approximately 800x800x800 and 500 MB).
> The action I want to do is to start from a selected ROI (preferably
> based on a separate Mask image) and find all neighbouring voxels with
> the same gray values (for clarification: I only want to select voxels
> that have the same gray value as a selected neighbouring voxel).  It
> does not matter whether gray value information is retained in the
> resulting image or not.
>
> For now, the only solution I found was to add an object to the 3D
> Manager from the Mask image, then put this selection on the grayscale
> stack and run "Find Connected Regions"
> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
> the following parameters : run("Find Connected Regions", "
> display_one_image display_results regions_must regions_for_values_over=1
> minimum_number_of_points=1 stop_after=-1"); ]
>
> However, this takes forever to process, so I am wondering if there is a
> faster alternative (and preferably one that is macro-friendly).
> I have tried Flood Fill (3D), but this does not appear to work with a
> seed region.
>
> Thanks in advance!
>
> Djoere
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
   /***************************************************************/
      Thomas Boudier, Associate Professor, UPMC,
      Université Pierre et Marie Curie, Paris, France.
      BioInformatics Institute (BII)/IPAL, Singapore.
/**************************************************************/

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Djoere Gaublomme
Thanks for the replies Ignacio and Thomas, I will check these out!

Kind regards

Djoere


Quoting Thomas Boudier <[hidden email]>:

> Hi Djoere,
>
> Not sure to fully understand, but it seems that you have some seeds,  
> and want to aggregate voxels to these seeds based on some criteria.  
> May be have a look to some spots detection plugins like
>
> http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection
>
> you need two images, one with seeds (may be you need to "draw" your  
> rois) and a signal image, it uses local threshold to aggregate  
> voxels to the seeds, in your case, local threshold is a constant.
>
> Hope this helps
>
> Thomas
>



Quoting Ignacio Arganda-Carreras <[hidden email]>:

> Hello Djoere,
>
> You might want to install the IJPB-plugins library. It comes with an
> efficient implementation of Connected Components in 3D that you can use to
> find the region you want after binarizing it with the proper threshold.
>
> http://github.com/ijpb/ijpb-plugins
>
> After installation, you should have the plugin under "Plugins > Fast
> Morphology > Binary Images > Connected Component Labeling".
>
> Let me know if you need more help,
>
> ignacio




> On 01/10/14 16:54, Djoere Gaublomme wrote:
>> Hi,
>>
>> I want to perform an action on a large 3D image stack (8-bit grayscale,
>> approximately 800x800x800 and 500 MB).
>> The action I want to do is to start from a selected ROI (preferably
>> based on a separate Mask image) and find all neighbouring voxels with
>> the same gray values (for clarification: I only want to select voxels
>> that have the same gray value as a selected neighbouring voxel).  It
>> does not matter whether gray value information is retained in the
>> resulting image or not.
>>
>> For now, the only solution I found was to add an object to the 3D
>> Manager from the Mask image, then put this selection on the grayscale
>> stack and run "Find Connected Regions"
>> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
>> the following parameters : run("Find Connected Regions", "
>> display_one_image display_results regions_must regions_for_values_over=1
>> minimum_number_of_points=1 stop_after=-1"); ]
>>
>> However, this takes forever to process, so I am wondering if there is a
>> faster alternative (and preferably one that is macro-friendly).
>> I have tried Flood Fill (3D), but this does not appear to work with a
>> seed region.
>>
>> Thanks in advance!
>>
>> Djoere
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
>   /***************************************************************/
>      Thomas Boudier, Associate Professor, UPMC,
>      Université Pierre et Marie Curie, Paris, France.
>      BioInformatics Institute (BII)/IPAL, Singapore.
> /**************************************************************/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Djoere Gaublomme
Hello,

Unfortunately these solutions don't seem to solve the problem at hand.

If I understand correctly, the "Connected Component Labeling" from the  
IJPB plugin only works on binary images, whereas I want to perform the  
connecting on a grayscale image, based on a seed region that is binary.

The spot detection plugin comes very close to what is desired, but the  
criteria for object extension are not the correct ones in this case.  
For example, if I understand correctly, "Constant" would extend the  
seed whenever a neighbouring voxel of my seed region is above the  
"Constant" gray value, regardless of what the gray value of the seed  
voxel next to it is.

What I am looking for is an extension of my seed regions that acts  
like a 3D flood fill, namely that all connected voxels with the same  
grayscale value will be selected.

Does anybody know if this exists?

Thanks in advance

Djoere



Quoting Djoere Gaublomme <[hidden email]>:

> Thanks for the replies Ignacio and Thomas, I will check these out!
>
> Kind regards
>
> Djoere
>
>
> Quoting Thomas Boudier <[hidden email]>:
>
>> Hi Djoere,
>>
>> Not sure to fully understand, but it seems that you have some  
>> seeds, and want to aggregate voxels to these seeds based on some  
>> criteria. May be have a look to some spots detection plugins like
>>
>> http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection
>>
>> you need two images, one with seeds (may be you need to "draw" your  
>> rois) and a signal image, it uses local threshold to aggregate  
>> voxels to the seeds, in your case, local threshold is a constant.
>>
>> Hope this helps
>>
>> Thomas
>>
>
>
>
> Quoting Ignacio Arganda-Carreras <[hidden email]>:
>
>> Hello Djoere,
>>
>> You might want to install the IJPB-plugins library. It comes with an
>> efficient implementation of Connected Components in 3D that you can use to
>> find the region you want after binarizing it with the proper threshold.
>>
>> http://github.com/ijpb/ijpb-plugins
>>
>> After installation, you should have the plugin under "Plugins > Fast
>> Morphology > Binary Images > Connected Component Labeling".
>>
>> Let me know if you need more help,
>>
>> ignacio
>
>
>
>
>> On 01/10/14 16:54, Djoere Gaublomme wrote:
>>> Hi,
>>>
>>> I want to perform an action on a large 3D image stack (8-bit grayscale,
>>> approximately 800x800x800 and 500 MB).
>>> The action I want to do is to start from a selected ROI (preferably
>>> based on a separate Mask image) and find all neighbouring voxels with
>>> the same gray values (for clarification: I only want to select voxels
>>> that have the same gray value as a selected neighbouring voxel).  It
>>> does not matter whether gray value information is retained in the
>>> resulting image or not.
>>>
>>> For now, the only solution I found was to add an object to the 3D
>>> Manager from the Mask image, then put this selection on the grayscale
>>> stack and run "Find Connected Regions"
>>> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
>>> the following parameters : run("Find Connected Regions", "
>>> display_one_image display_results regions_must regions_for_values_over=1
>>> minimum_number_of_points=1 stop_after=-1"); ]
>>>
>>> However, this takes forever to process, so I am wondering if there is a
>>> faster alternative (and preferably one that is macro-friendly).
>>> I have tried Flood Fill (3D), but this does not appear to work with a
>>> seed region.
>>>
>>> Thanks in advance!
>>>
>>> Djoere
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>>  /***************************************************************/
>>     Thomas Boudier, Associate Professor, UPMC,
>>     Université Pierre et Marie Curie, Paris, France.
>>     BioInformatics Institute (BII)/IPAL, Singapore.
>> /**************************************************************/
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Thomas Boudier
Hi Djoere,

Ok, I understand better, you want to connect voxels that have exactly
the same values as the seed, right ? Can you send me a sample image with
seeds, I think that playing with different local threshold with special
values may work, but I would need an image to test it.

Best,

Thomas


On 07/10/14 15:12, Djoere Gaublomme wrote:

> Hello,
>
> Unfortunately these solutions don't seem to solve the problem at hand.
>
> If I understand correctly, the "Connected Component Labeling" from the
> IJPB plugin only works on binary images, whereas I want to perform the
> connecting on a grayscale image, based on a seed region that is binary.
>
> The spot detection plugin comes very close to what is desired, but the
> criteria for object extension are not the correct ones in this case.
> For example, if I understand correctly, "Constant" would extend the seed
> whenever a neighbouring voxel of my seed region is above the "Constant"
> gray value, regardless of what the gray value of the seed voxel next to
> it is.
>
> What I am looking for is an extension of my seed regions that acts like
> a 3D flood fill, namely that all connected voxels with the same
> grayscale value will be selected.
>
> Does anybody know if this exists?
>
> Thanks in advance
>
> Djoere
>
>
>
> Quoting Djoere Gaublomme <[hidden email]>:
>
>> Thanks for the replies Ignacio and Thomas, I will check these out!
>>
>> Kind regards
>>
>> Djoere
>>
>>
>> Quoting Thomas Boudier <[hidden email]>:
>>
>>> Hi Djoere,
>>>
>>> Not sure to fully understand, but it seems that you have some seeds,
>>> and want to aggregate voxels to these seeds based on some criteria.
>>> May be have a look to some spots detection plugins like
>>>
>>> http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection
>>>
>>>
>>> you need two images, one with seeds (may be you need to "draw" your
>>> rois) and a signal image, it uses local threshold to aggregate voxels
>>> to the seeds, in your case, local threshold is a constant.
>>>
>>> Hope this helps
>>>
>>> Thomas
>>>
>>
>>
>>
>> Quoting Ignacio Arganda-Carreras <[hidden email]>:
>>
>>> Hello Djoere,
>>>
>>> You might want to install the IJPB-plugins library. It comes with an
>>> efficient implementation of Connected Components in 3D that you can
>>> use to
>>> find the region you want after binarizing it with the proper threshold.
>>>
>>> http://github.com/ijpb/ijpb-plugins
>>>
>>> After installation, you should have the plugin under "Plugins > Fast
>>> Morphology > Binary Images > Connected Component Labeling".
>>>
>>> Let me know if you need more help,
>>>
>>> ignacio
>>
>>
>>
>>
>>> On 01/10/14 16:54, Djoere Gaublomme wrote:
>>>> Hi,
>>>>
>>>> I want to perform an action on a large 3D image stack (8-bit grayscale,
>>>> approximately 800x800x800 and 500 MB).
>>>> The action I want to do is to start from a selected ROI (preferably
>>>> based on a separate Mask image) and find all neighbouring voxels with
>>>> the same gray values (for clarification: I only want to select voxels
>>>> that have the same gray value as a selected neighbouring voxel).  It
>>>> does not matter whether gray value information is retained in the
>>>> resulting image or not.
>>>>
>>>> For now, the only solution I found was to add an object to the 3D
>>>> Manager from the Mask image, then put this selection on the grayscale
>>>> stack and run "Find Connected Regions"
>>>> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
>>>> the following parameters : run("Find Connected Regions", "
>>>> display_one_image display_results regions_must
>>>> regions_for_values_over=1
>>>> minimum_number_of_points=1 stop_after=-1"); ]
>>>>
>>>> However, this takes forever to process, so I am wondering if there is a
>>>> faster alternative (and preferably one that is macro-friendly).
>>>> I have tried Flood Fill (3D), but this does not appear to work with a
>>>> seed region.
>>>>
>>>> Thanks in advance!
>>>>
>>>> Djoere
>>>>
>>>> --
>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>>
>>>
>>> --
>>>  /***************************************************************/
>>>     Thomas Boudier, Associate Professor, UPMC,
>>>     Université Pierre et Marie Curie, Paris, France.
>>>     BioInformatics Institute (BII)/IPAL, Singapore.
>>> /**************************************************************/
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
   /***************************************************************/
      Thomas Boudier, Associate Professor, UPMC,
      Université Pierre et Marie Curie, Paris, France.
      BioInformatics Institute (BII)/IPAL, Singapore.
/**************************************************************/

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Djoere Gaublomme
Hello Thomas,

That is correct, I only want the pixels with exactly the same value as  
neighbouring voxels in the seed.
I'll send you a sample image.

Kind regards

Djoere


Quoting Thomas Boudier <[hidden email]>:

> Hi Djoere,
>
> Ok, I understand better, you want to connect voxels that have  
> exactly the same values as the seed, right ? Can you send me a  
> sample image with seeds, I think that playing with different local  
> threshold with special values may work, but I would need an image to  
> test it.
>
> Best,
>
> Thomas
>
>
> On 07/10/14 15:12, Djoere Gaublomme wrote:
>> Hello,
>>
>> Unfortunately these solutions don't seem to solve the problem at hand.
>>
>> If I understand correctly, the "Connected Component Labeling" from the
>> IJPB plugin only works on binary images, whereas I want to perform the
>> connecting on a grayscale image, based on a seed region that is binary.
>>
>> The spot detection plugin comes very close to what is desired, but the
>> criteria for object extension are not the correct ones in this case.
>> For example, if I understand correctly, "Constant" would extend the seed
>> whenever a neighbouring voxel of my seed region is above the "Constant"
>> gray value, regardless of what the gray value of the seed voxel next to
>> it is.
>>
>> What I am looking for is an extension of my seed regions that acts like
>> a 3D flood fill, namely that all connected voxels with the same
>> grayscale value will be selected.
>>
>> Does anybody know if this exists?
>>
>> Thanks in advance
>>
>> Djoere
>>
>>
>>
>> Quoting Djoere Gaublomme <[hidden email]>:
>>
>>> Thanks for the replies Ignacio and Thomas, I will check these out!
>>>
>>> Kind regards
>>>
>>> Djoere
>>>
>>>
>>> Quoting Thomas Boudier <[hidden email]>:
>>>
>>>> Hi Djoere,
>>>>
>>>> Not sure to fully understand, but it seems that you have some seeds,
>>>> and want to aggregate voxels to these seeds based on some criteria.
>>>> May be have a look to some spots detection plugins like
>>>>
>>>> http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection
>>>>
>>>>
>>>> you need two images, one with seeds (may be you need to "draw" your
>>>> rois) and a signal image, it uses local threshold to aggregate voxels
>>>> to the seeds, in your case, local threshold is a constant.
>>>>
>>>> Hope this helps
>>>>
>>>> Thomas
>>>>
>>>
>>>
>>>
>>> Quoting Ignacio Arganda-Carreras <[hidden email]>:
>>>
>>>> Hello Djoere,
>>>>
>>>> You might want to install the IJPB-plugins library. It comes with an
>>>> efficient implementation of Connected Components in 3D that you can
>>>> use to
>>>> find the region you want after binarizing it with the proper threshold.
>>>>
>>>> http://github.com/ijpb/ijpb-plugins
>>>>
>>>> After installation, you should have the plugin under "Plugins > Fast
>>>> Morphology > Binary Images > Connected Component Labeling".
>>>>
>>>> Let me know if you need more help,
>>>>
>>>> ignacio
>>>
>>>
>>>
>>>
>>>> On 01/10/14 16:54, Djoere Gaublomme wrote:
>>>>> Hi,
>>>>>
>>>>> I want to perform an action on a large 3D image stack (8-bit grayscale,
>>>>> approximately 800x800x800 and 500 MB).
>>>>> The action I want to do is to start from a selected ROI (preferably
>>>>> based on a separate Mask image) and find all neighbouring voxels with
>>>>> the same gray values (for clarification: I only want to select voxels
>>>>> that have the same gray value as a selected neighbouring voxel).  It
>>>>> does not matter whether gray value information is retained in the
>>>>> resulting image or not.
>>>>>
>>>>> For now, the only solution I found was to add an object to the 3D
>>>>> Manager from the Mask image, then put this selection on the grayscale
>>>>> stack and run "Find Connected Regions"
>>>>> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ , with
>>>>> the following parameters : run("Find Connected Regions", "
>>>>> display_one_image display_results regions_must
>>>>> regions_for_values_over=1
>>>>> minimum_number_of_points=1 stop_after=-1"); ]
>>>>>
>>>>> However, this takes forever to process, so I am wondering if there is a
>>>>> faster alternative (and preferably one that is macro-friendly).
>>>>> I have tried Flood Fill (3D), but this does not appear to work with a
>>>>> seed region.
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Djoere
>>>>>
>>>>> --
>>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>>>
>>>>
>>>> --
>>>> /***************************************************************/
>>>>    Thomas Boudier, Associate Professor, UPMC,
>>>>    Université Pierre et Marie Curie, Paris, France.
>>>>    BioInformatics Institute (BII)/IPAL, Singapore.
>>>> /**************************************************************/
>>>>
>>>> --
>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
>   /***************************************************************/
>      Thomas Boudier, Associate Professor, UPMC,
>      Université Pierre et Marie Curie, Paris, France.
>      BioInformatics Institute (BII)/IPAL, Singapore.
> /**************************************************************/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Find connected regions 3D / Flood filling 3D from seed region

Thomas Boudier
Hi,

Here a plugin to do the flooding from a mask image to a signal image.
Here all pixels from the mask image are considered as seeds. You need
the mcib3d library. The mask image should be named "seed" and the signal
image "raw", just compile and run from ImageJ.


import ij.IJ;
import ij.WindowManager;
import ij.plugin.PlugIn;
import mcib3d.image3d.ImageInt;
import mcib3d.image3d.processing.Flood3D;

/**
  *
  * @author thomasb
  */
public class Flood_3D implements PlugIn {

     @Override
     public void run(String string) {
         ImageInt seed = ImageInt.wrap(WindowManager.getImage("seed"));
         ImageInt raw = ImageInt.wrap(WindowManager.getImage("raw"));

         for (int x = 0; x < seed.sizeX; x++) {
             for (int y = 0; y < seed.sizeY; y++) {
                 for (int z = 0; z < seed.sizeZ; z++) {
                     int pix = seed.getPixelInt(x, y, z);
                     int pix2 = raw.getPixelInt(x, y, z);
                     if ((pix == 255) && (pix2 < 255)) {
                         IJ.showStatus("flooding "+x+" "+y+" "+z);
                         seed.setPixel(x, y, z, 0);
                         Flood3D.flood3d6(raw, x, y, z, 255);
                     }
                 }
             }
         }
         raw.show();
         IJ.log("Finished");
     }
}



Best

Thomas



On 07/10/14 15:46, Djoere Gaublomme wrote:

> Hello Thomas,
>
> That is correct, I only want the pixels with exactly the same value as
> neighbouring voxels in the seed.
> I'll send you a sample image.
>
> Kind regards
>
> Djoere
>
>
> Quoting Thomas Boudier <[hidden email]>:
>
>> Hi Djoere,
>>
>> Ok, I understand better, you want to connect voxels that have exactly
>> the same values as the seed, right ? Can you send me a sample image
>> with seeds, I think that playing with different local threshold with
>> special values may work, but I would need an image to test it.
>>
>> Best,
>>
>> Thomas
>>
>>
>> On 07/10/14 15:12, Djoere Gaublomme wrote:
>>> Hello,
>>>
>>> Unfortunately these solutions don't seem to solve the problem at hand.
>>>
>>> If I understand correctly, the "Connected Component Labeling" from the
>>> IJPB plugin only works on binary images, whereas I want to perform the
>>> connecting on a grayscale image, based on a seed region that is binary.
>>>
>>> The spot detection plugin comes very close to what is desired, but the
>>> criteria for object extension are not the correct ones in this case.
>>> For example, if I understand correctly, "Constant" would extend the seed
>>> whenever a neighbouring voxel of my seed region is above the "Constant"
>>> gray value, regardless of what the gray value of the seed voxel next to
>>> it is.
>>>
>>> What I am looking for is an extension of my seed regions that acts like
>>> a 3D flood fill, namely that all connected voxels with the same
>>> grayscale value will be selected.
>>>
>>> Does anybody know if this exists?
>>>
>>> Thanks in advance
>>>
>>> Djoere
>>>
>>>
>>>
>>> Quoting Djoere Gaublomme <[hidden email]>:
>>>
>>>> Thanks for the replies Ignacio and Thomas, I will check these out!
>>>>
>>>> Kind regards
>>>>
>>>> Djoere
>>>>
>>>>
>>>> Quoting Thomas Boudier <[hidden email]>:
>>>>
>>>>> Hi Djoere,
>>>>>
>>>>> Not sure to fully understand, but it seems that you have some seeds,
>>>>> and want to aggregate voxels to these seeds based on some criteria.
>>>>> May be have a look to some spots detection plugins like
>>>>>
>>>>> http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:3d_spots_segmentation:start&s[]=spots&s[]=detection
>>>>>
>>>>>
>>>>>
>>>>> you need two images, one with seeds (may be you need to "draw" your
>>>>> rois) and a signal image, it uses local threshold to aggregate voxels
>>>>> to the seeds, in your case, local threshold is a constant.
>>>>>
>>>>> Hope this helps
>>>>>
>>>>> Thomas
>>>>>
>>>>
>>>>
>>>>
>>>> Quoting Ignacio Arganda-Carreras <[hidden email]>:
>>>>
>>>>> Hello Djoere,
>>>>>
>>>>> You might want to install the IJPB-plugins library. It comes with an
>>>>> efficient implementation of Connected Components in 3D that you can
>>>>> use to
>>>>> find the region you want after binarizing it with the proper
>>>>> threshold.
>>>>>
>>>>> http://github.com/ijpb/ijpb-plugins
>>>>>
>>>>> After installation, you should have the plugin under "Plugins > Fast
>>>>> Morphology > Binary Images > Connected Component Labeling".
>>>>>
>>>>> Let me know if you need more help,
>>>>>
>>>>> ignacio
>>>>
>>>>
>>>>
>>>>
>>>>> On 01/10/14 16:54, Djoere Gaublomme wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I want to perform an action on a large 3D image stack (8-bit
>>>>>> grayscale,
>>>>>> approximately 800x800x800 and 500 MB).
>>>>>> The action I want to do is to start from a selected ROI (preferably
>>>>>> based on a separate Mask image) and find all neighbouring voxels with
>>>>>> the same gray values (for clarification: I only want to select voxels
>>>>>> that have the same gray value as a selected neighbouring voxel).  It
>>>>>> does not matter whether gray value information is retained in the
>>>>>> resulting image or not.
>>>>>>
>>>>>> For now, the only solution I found was to add an object to the 3D
>>>>>> Manager from the Mask image, then put this selection on the grayscale
>>>>>> stack and run "Find Connected Regions"
>>>>>> [http://www.longair.net/edinburgh/imagej/find-connected-regions/ ,
>>>>>> with
>>>>>> the following parameters : run("Find Connected Regions", "
>>>>>> display_one_image display_results regions_must
>>>>>> regions_for_values_over=1
>>>>>> minimum_number_of_points=1 stop_after=-1"); ]
>>>>>>
>>>>>> However, this takes forever to process, so I am wondering if there
>>>>>> is a
>>>>>> faster alternative (and preferably one that is macro-friendly).
>>>>>> I have tried Flood Fill (3D), but this does not appear to work with a
>>>>>> seed region.
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Djoere
>>>>>>
>>>>>> --
>>>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>>>>
>>>>>
>>>>> --
>>>>> /***************************************************************/
>>>>>    Thomas Boudier, Associate Professor, UPMC,
>>>>>    Université Pierre et Marie Curie, Paris, France.
>>>>>    BioInformatics Institute (BII)/IPAL, Singapore.
>>>>> /**************************************************************/
>>>>>
>>>>> --
>>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>>
>>>> --
>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>>   /***************************************************************/
>>      Thomas Boudier, Associate Professor, UPMC,
>>      Université Pierre et Marie Curie, Paris, France.
>>      BioInformatics Institute (BII)/IPAL, Singapore.
>> /**************************************************************/
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
   /***************************************************************/
      Thomas Boudier, Associate Professor, UPMC,
      Université Pierre et Marie Curie, Paris, France.
      BioInformatics Institute (BII)/IPAL, Singapore.
/**************************************************************/

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