Posted by
dscho on
Dec 02, 2013; 11:45pm
URL: http://imagej.273.s1.nabble.com/Standalone-ImgLib2-usage-tp5005746p5005786.html
Hi Rex,
On Sun, 1 Dec 2013, Rex Kerr wrote:
> I've been attempting to use ImgLib2 in a quasi-standalone fashion to
> automate some image processing tasks. So far this has been an exercise
> in frustration due to a combination of underdocumented dependency on
> other libraries for critical functionality (ImageJ/Fiji, SCIFIO, etc.)
> and lack of documentation of ImgLib2 itself.
Just to clarify (since that might be lost otherwise in the extensive
information you received from other people): ImgLib2 is under heavy
development, its primary purpose being to serve the needs of the ImgLib2
team (Stephan Saalfeld, Stephan Preibisch and Tobias Pietzsch) and to
cater to ImageJ2 and KNIME.
As such, ImgLib2 has proved to be incredibly powerful, but necessarily at
the expense of documentation that makes it easy for others to get started
with using ImgLib2.
Also: While ImgLib2 is used in ImageJ2, KNIME, Fiji and SCIFIO, it is a
*dependency* thereof, not a dependencee [*1*].
> This has been so difficult thus far that I have to wonder if I'm missing
> some key resource.
The biggest key resource you missed until you wrote this mail was the
mailing list. The community is really *the* strength of ImageJ (and by
extension, ImgLib2).
> Before I ask specific questions: what is it that I was supposed to do?
You did the right thing: raise your issues here.
> Or is ImgLib2 not intended to be used apart from Fiji etc. (and a good
> working knowledge of what ImageJ can do and how it does it)?
Eventually, no knowledge of ImageJ 1.x will be required at all to use
ImgLib2 efficiently. Nor is knowledge about Fiji or ImageJ2 essential.
KNIME uses ImgLib2 entirely without relying on ImageJ 1.x, Fiji or
ImageJ2.
Practically speaking, most of the developers using ImgLib2 have been
exposed to ImageJ 1.x, therefore it does not hurt to understand the latter
in order to understand the former.
But as I said, in the future this will be a thing of the past.
However, please keep in mind that as enthusiastic as the ImgLib2
developers are (both core team and contributors), our days have 24 hours
just as yours and while we strive to help users such as yourself, we
simply cannot spend most of our time to write tutorials (although there
are quite some, as pointed out by others:
http://imglib2.net/). We have to
use most of our time to develop ImgLib2 for use in our research.
This is where you come in: ask the questions you need answers for, and
then write documentation helping others in turn. The ImgLib2 website is
actually a Wiki, you can easily register and extend/improve it.
I would be interested in particular in a description how to use ImgLib2 in
conjunction with Scala, for there are quite a few Scala fans out there
(just as yourself), requiring image processing and analysis.
And now, as promised, the overview of the involved components/projects:
ImgLib2
actually consists of a couple of subprojects. Developed mainly by
above-mentioned trio, it is separated into
core (data structures and interfaces),
three algorithm packages (mainly differing in licensing, as there are a
few that need to be under GPL),
ops (to be reworked massively in the near future, don't use it yet),
realtransform (for coordinate transformations),
meta (for metadata, such as axis types),
io (soon to be replaced by SCIFIO completely),
ui (hopefully soon to be reconciled with parts of ImageJ2), and
ij (for interacting with ImageJ 1.x' data structures -- insofar
possible)
SCIFIO
*the* I/O to be used with ImgLib2. SCIFIO's extensible design
makes it very easy to add drop-in support for additional file
formats and decouples ImgLib2 nicely from the many implementation
details of the many, many file formats out there
Fiji, ImageJ2, KNIME
users of ImgLib2, to be used as examples in your case, not as
dependencies
While it is true that most of the developers who work with ImgLib2 use
Eclipse (it is kind of *the* standard when working with Java projects, to
complain about it just means to lose a lot of hot air, not that I am not
guilty of that myself...), by no means you are bound to use it.
ImgLib2 is actually maintained as a set of Maven projects; Eclipse is just
a convenient way to work with them.
In fact, you do not even need to use Maven -- unless you want to --
because you can easily interact with the Maven repositories without using
Maven. For example, Fiji and part of our Jenkins jobs use this shell
script (in conjunction with curl to retrieve files from the website
interface of the ImageJ2 Maven repository) to download specified artifacts:
https://github.com/scijava/scijava-common/blob/master/bin/maven-helper.shThere is also a minimal drop-in replacement we developed for users who do
not need the full power of Maven but just want to build a Java project
adhering to pretty strict standards: MiniMaven. This is, in fact, what
ImageJ2's script editor (and also Fiji's default Build.sh) use to build
artifacts and download/install dependencies.
In case you do not want to bother with Maven, MiniMaven, or
maven-helper.sh, but also insist on not downloading each and every
component manually, you can still just use Maven to *download* the .jar
files: After
git clone
https://github.com/imagej/imglib/ cd imglib/examples
mvn dependency:copy-dependencies
all the dependencies used by the ImgLib2 examples will be in the
target/dependency/ subdirectory of imglib/examples/.
Speaking of the examples: in many cases, they are more helpful than
reading the source of the ImgLib2 libraries themselves, and "git grep" is
a very powerful tool to query the examples for hints.
Ciao,
Johannes
Footnote *1*: technically, there is some code in ImgLib2 that uses SCIFIO
as a dependency, but that is by no means ImgLib2 code you need to use,
except as a reference how to do things.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html