[ImageJ-devel] Using ImgLib2 with JavaFX and other questions.
Tobias Pietzsch
pietzsch at mpi-cbg.de
Tue Sep 2 06:59:10 CDT 2014
Hi Michael,
On 29 Aug 2014, at 13:09, Michael Ellis <michael.ellis at dsuk.biz> wrote:
> I am trying to learn about ImgLib2
>
> In particular I could do with help for the following:
>
> All my images will be 2D byte images typically of size 1300x1000.
>
> How do I get an Img into a format compatible for displaying within JavaFX (rather than using ImageJFunctions.show() )?
> Assuming there is no explicit JavaFX support in ImgLib2, I think this boils down to producing and 24 bit RGB or 32bit ARGB image where I can access the data. But how do I do this?
Have a look at ARGBScreenImage which extends ArrayImg< ARGBType, IntArray >.
This s a 2D image intended for displaying on screen. You can get to the underlying 32bit ARGB int[] array by
public int[] getData()
or get it wrapped in a AWT BufferedImage by
public BufferedImage image()
>
> How would I combine multiple 2D 8 bit image planes (up to 7 planes, each with own colour table) and combine them under programatic control into a single RGB image where every pixel in the destination image dest[x, y] is a function of the pixels at src[plane, x, y]?
See
net.imglib2.display.projector.composite.CompositeXYProjector
or
net.imglib2.display.projector.composite.CompositeXYRandomAccessibleProjector
They should do exactly what you need. Note, that they expect that [x, y] of your image to composite are the first two dimensions. So it would work with [x, y, …, plane, …].
If you really have [plane, x, y], you can use Views.permute(...) to get a virtual view into your data as [x, y, plane].
>
> How would I threshold a 2D Img producing a 1 bit Img?
You could simply do this by implementing a Converter< __YourImageType__, BitType > and then using Converters.convert(...) to get a virtual view into your data as a thresholded 1 bit image.
> How would I fill holes in the binary thresholded Img?
Have a look through imglib2-algorithms, imglib2-algorithms, and imglib2-ops. There should be something there.
> How could I identify and label objects in the binary thresholded Img and extract a concise description of the object boundaries (e.g. polygon, or chain code descriptions)?
To identify objects you could use
net.imglib2.algorithm.labeling.AllConnectedComponents
About the object descriptions, I don’t think we have anything for that, but I’m not sure. Maybe someone familiar with imglib2-ops can comment?
best regards,
Tobias
>
> How can I register a multiple Imgs using cross correlation image registration?
>
> Any help would be appreciated. I’m not looking for complete solutions to this and whilst this work is intended for a commercial product, I am happy to contribute all the source code examples I generate by way of investigating any of the above.
>
> — Michael Ellis
> Digital Scientific UK Ltd.
>
>
>
>
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140902/01e96471/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140902/01e96471/attachment.pgp>
More information about the ImageJ-devel
mailing list