Difference between revisions of "ImgLib2 FAQ"

m (Rueden moved page Imglib FAQ to ImgLib2 FAQ: Make it clear this FAQ is about ImgLib2.)
(ImgLib1 (deprecated): Add ImgLib1 deprecation notice)
Line 12: Line 12:
  
 
= ImgLib1 (deprecated) =
 
= ImgLib1 (deprecated) =
 +
 +
<div style="background:#fdd; padding: 10px 10px 0 10px; border: 1px solid black;">
 +
'''DEPRECATION NOTICE:'''
 +
This section describes ImgLib1, the previous incarnation of the [[ImgLib2]] library. We encourage developers to use ImgLib2 instead, and [[How To Migrate Code From ImgLib To ImgLib2|migrate existing ImgLib1 programs to ImgLib2]] whenever possible.
 +
</div>
  
 
== How to create a new Image from scratch? ==
 
== How to create a new Image from scratch? ==

Revision as of 13:09, 3 May 2013

ImgLib2

What is ImgLib2 anyway?

It is a library that helps you to implement algorithms for multi-dimensional data processing. The idea is that you can concentrate on the essence of your algorithm rather than syntactic sugar. It is possible to implement an algorithm without specifying what the image's data type is, how many dimensions it has, and how the image is stored.

ImgLib2 is also the basis of ImageJ2.

How do I migrate my ImgLib1 code to ImgLib2?

There is some rudimentary documentation, but you will most likely need to ask more detailed questions on the Fiji developers mailing list.

ImgLib1 (deprecated)

DEPRECATION NOTICE: This section describes ImgLib1, the previous incarnation of the ImgLib2 library. We encourage developers to use ImgLib2 instead, and migrate existing ImgLib1 programs to ImgLib2 whenever possible.

How to create a new Image from scratch?

There are three parts to it: the data type, the dimension and the storage strategy. Example: If you already have an image first whose dimensions you want to copy, and the result should be of float type and be stored in a single large array, you can use this snippet of code:

ImageFactory<FloatType> factory = new ImageFactory<FloatType>(new FloatType(), new ArrayContainerFactory());
Image<FloatType> result = factory.createImage(first.getDimensions(), "result");