[scikit-image] Parallel processing segmentation while keeping labels

Cedric Espenel cedric.espenel at gmail.com
Wed Jun 28 18:37:54 EDT 2017


Hi Juan,

Thank you for your answer, I kind of do what you propose, although it's not
very "elegant":

1) Using util.view_as_windows(), I make chunks with overlay.
2) jolib for parallel processing (I'd like to use
skimage.util.apply_parallel but I'm not sure how I can use a fonction with
more than 1 arg?)
3) this part is a little "bricolage", I take the overlap of adjacent
regions and, using regionprops, I can find the "intensity" (label) of 1
region over the other one. Then I just relabel one of the region.
4) I stitch the block back together, again, it's not pretty, I just add up
all the regions into a new array, not sure if there is a better way.

So it works well and it's relatively easy to implement because I only have
4 chunks, I've to see how that will go for a big tile of images.

Best,

Cedric

2017-06-28 3:27 GMT-07:00 Juan Nunez-Iglesias <jni.soma at gmail.com>:

> Hi Cedric,
>
> Stitching of separate regions is not a trivial problem… You’ll basically
> have to:
>
> a) overlap the blocks by a certain amount. You might be able to use
> skimage.util.apply_parallel more easily here than joblib.
> b) compute which labels overlap the most between each neighbouring pair of
> images
> c) relabel as necessary to make those labels match
>
> It’s not super-hard, just a lot of annoying bookkeeping. If you come up
> with a reasonably robust method to do this, I for one would very much
> welcome such a contribution into the library!
>
> Here’s a paper from an old colleague of mine who had to deal this on a
> large-scale problem, and they created a robust method to do the matching:
> https://arxiv.org/pdf/1604.00385.pdf
> (page 6)
>
> Juan.
>
> On 27 Jun 2017, 9:20 AM +1000, Cedric Espenel <cedric.espenel at gmail.com>,
> wrote:
>
> Hi,
>
> I'm working on a project where I have to segment out nucleus of cells in a
> volume. I use random_walker with define markers for every nuclei. If I try
> to run it on the all volume the segmentation works well but it's very slow.
> So I used util.view_as_blocks function from scikit to split my image and
> markers and I loop over the different block using joblib:
>
> rw_dapi_chunks = Parallel(n_jobs = 4)(delayed(segmentation.
> random_walker)(chunks[i,j],
>                                      chunks_markers[i,j], beta = 3000,
> mode='cg_mg') for
>                                       i in range(2) for j in range(2))
>
>
> So I end up with a list of 4 images and if I combine these images (btw I'm
> not sure what is the best way for doing that? I just add them up in an
> empty array) everything work well, except that I end-up with nuclei with 2
> different labels:
>
>  [image: Images intégrées 1]
> Am I doing something wrong? Is there a way to split your images in block
> for parallel computing but being able to get the labeling right at the end?
>
> Best,
>
> Cedric
> _______________________________________________
> scikit-image mailing list
> scikit-image at python.org
> https://mail.python.org/mailman/listinfo/scikit-image
>
>
> _______________________________________________
> scikit-image mailing list
> scikit-image at python.org
> https://mail.python.org/mailman/listinfo/scikit-image
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20170628/cd7c95de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 24856 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20170628/cd7c95de/attachment-0001.png>


More information about the scikit-image mailing list