Eclipse SCIFIO ImageJ Project Setup

eclipse
scifio
imagej
Tags: #<Tag:0x00007fa30485efb8> #<Tag:0x00007fa30485ee78> #<Tag:0x00007fa30485ece8>

#1

Hello,

I’m about to create a SCIFIO project in Eclipse, and would like to know if someone might have some suggestions how to do this.

At the end, I would like to read/write TIFF and HDF files. So far, I figured out that I need the following packages:

  • scifio-master
  • imagej-common-master,
  • imglib2-master
  • HDF5_Vibez-master

Maybe more is needed? And how should it be combined in Eclipse to create an environment to run the sample files as provided in scifio-tutorials-master (sorry for not attaching the files directly, but this not appowed for new users).

In order to avoid basic mistakes when setting up the project in Eclipse, I look for advice how to do this properly.

Suggestions, tips are very welcome.

Thanks in advance

Juergen


#2

Hi Jürgen,

The easiest thing to do is to use Maven like SCIFIO does. Start by forking and cloning the SCIFIO project from Github. Instructions here. Then you need to have Maven installed on your computer. Instructions for different operating systems here. Eclipse has good Maven integration, so after you’ve done the cloning and installing, you should be able to open the code in Eclipse as a Maven project, and then build it. Here’s a pull request I made to SCIFIO that adds support for reading a custom file format. Hope this helps :slight_smile:

Best regards,
Richard


#3

Hi Richard,

Thanks for the start. I followed your procedure and it works.

I created the fork of scifio in github and downloaded the resulting scifio-master zip file to my PC and uncompressed it. Then I used the Eclipse Import function to import an Existing Maven Project. After this Eclipse did the build and the scifio project was created. So far so good.

But what do I need to do to add another project, e.g. the scifio-tutorials, to it? If I do it the same way, I’m getting two separate projects side by side. But that’s not what I want. I would like to create a main project e.g. “SCIFIO” that includes “scifio-master” and “scifio-tutorials” as sub-projects.

And if I need more packages in future (e.g. HDF5_Vibez), I simply want expand the SCFIO project with more github projects.

Thanks

Juergen


#4

The whole purpose of Maven is that you don’t need to compile stuff that you only want to use, without doing any changes. So instead of sub-projects, you simply define them as dependencies.

As I mentioned on the github issue you opened, you should simply define a dependency in your pom.xml for each component that you’re using:

<dependency>
  <groupId>sc.fiji</groupId>
  <artifactId>HDF5_Vibez</artifactId>
  <version>0.1.0-SNAPSHOT</version>
</dependency>

You can take the example-imagej-command as a starting point.


While you told us what you tried, it is still unclear to me what you’d like to achieve. If all you need is:

then you really don’t need to deal with all the source code of scifio and other projects. You usually don’t start assembling a motor from single bolts and screws (and then the car) if your goal is to get from one city to another.


#5

Hi Jan,

I think I got the idea and try to create the project, using the example-imagej-command as a blueprint, modifying it and adding the needed dependencies.

I’ll let you know about the result when I’m done.

Thanks

Juergen


#6

Hello,

here are the results of my tests with dependencies.

First I tried to modify the example-imagej-command example, but without any success. Whatever I did, only “can not find this, can not find that” error messages. So I stopped this exercises and went to the scifio pom.

Into the scifio pom, I added three dependies. Only one for each test.

Test 1 ------------------------------------------------------------------------
Added only the HDF5_Vibez dependency:

sc.fiji
HDF5_Vibez
0.1.0-SNAPSHOT

This resulted in pom error messages according attached screenshot “scifio pom with HDF5_Vibez dependency”. Assuming that Curtis’ comment “The HDF5 Vibez plugin is not built on SCIFIO” might be the reason for this, I tried to add the scifio-turorials to scifio.

But also not success. First I added the artifactId according the pom of scifio-turorials. As this ended with errors, I deleted the pom- in the artifactId, but also no success.

Test 2 ------------------------------------------------------------------------
Added only the scifio-turorials dependency with artifactId = pom-scifio-tutorials:

io.scif
pom-scifio-tutorials
1.0.0-SNAPSHOT

Test result as in attached screenshot “scifio pom

with scifio-turorials dependency 1”.

Test 3 ------------------------------------------------------------------------
Added only the scifio-turorials dependency with artifactId = scifio-tutorials:

io.scif
scifio-tutorials
1.0.0-SNAPSHOT

Test result as in attached screenshot “scifio pom with scifio-turorials dependency 2”.

I really expected at least a positive result with scifio-turorials, as this should be built on SCIFIO.

Does anyone have an idea why it’s not possible to expand scifio with scifio-turorials?

Thanks

Juergen


#7

Eclipse doesn’t automatically download Maven dependencies by default, so:

  1. Right click your project in the package explorer
  2. Select Maven > Update Project…
  3. OK the dialog

Let me know if this resolves the missing packages.


#8

Update Project didn’t help. As far as I understand it, is the pom the instance that controls what needs to be downloaded. But as soon as I add a dependency to the pom of scifio, the pom gets the error indication in Eclipse (see attached screenshot).

For me, all the pure scifio stuff (.java and .jar files) is there, but nothing more. It seems that the pom processing stops as soon as the lines of the added dependency are reached.

Juergen

PS: If I could, I would upload the modified scifio pom. But as new user, I’m not allowed to upload anything else than images. I also tried to put the pom xml into a zip archive, but i’s also not allowed for new users to upload zips.


#9


#10

I just manually increased your user trust level, so in the future you should be able to upload other files as well. For code however, you can simply paste it in your post (between code fences ``` for formatting) instead of uploading, or it’s often the easiest to share it via github.com or as a gist.github.com.

Please also make sure you have the ImageJ Maven repository configured in your pom.xml:

<repositories>
		<repository>
			<id>imagej.public</id>
			<url>http://maven.imagej.net/content/groups/public</url>
		</repository>
</repositories>

#11

Yes, the repository is, must be there, as I used the original scifio pom, and just added the scifio-tutorials at the end (see below).

<?xml version="1.0" encoding="UTF-8"?> 4.0.0
<parent>
	<groupId>org.scijava</groupId>
	<artifactId>pom-scijava</artifactId>
	<version>17.1.1</version>
	<relativePath />
</parent>

<groupId>io.scif</groupId>
<artifactId>scifio</artifactId>
<version>0.34.0-SNAPSHOT</version>

<name>SCIFIO Core</name>
<description>SCIFIO is a library for scientific N-dimensional image I/O.</description>
<url>http://scif.io/</url>
<inceptionYear>2011</inceptionYear>
<organization>
	<name>SCIFIO</name>
	<url>http://scif.io/</url>
</organization>
<licenses>
	<license>
		<name>Simplified BSD License</name>
		<distribution>repo</distribution>
	</license>
</licenses>

<developers>
	<developer>
		<id>ctrueden</id>
		<name>Curtis Rueden</name>
		<url>https://imagej.net/User:Rueden</url>
		<roles>
			<role>founder</role>
			<role>lead</role>
			<role>developer</role>
			<role>debugger</role>
			<role>reviewer</role>
			<role>support</role>
			<role>maintainer</role>
		</roles>
	</developer>
</developers>
<contributors>
	<contributor>
		<name>Mark Hiner</name>
		<url>https://imagej.net/User:Hinerm</url>
		<roles><role>founder</role></roles>
		<properties><id>hinerm</id></properties>
	</contributor>
	<contributor>
		<name>Johannes Schindelin</name>
		<url>https://imagej.net/User:Schindelin</url>
		<properties><id>dscho</id></properties>
	</contributor>
	<contributor>
		<name>Andrea Ballaminut</name>
		<properties><id>ballaminut</id></properties>
	</contributor>
	<contributor>
		<name>Gabriel Einsdorf</name>
		<url>https://imagej.net/User:Gab1one</url>
		<properties><id>gab1one</id></properties>
	</contributor>
	<contributor>
		<name>Henry Pinkard</name>
		<url>https://imagej.net/User:HPinkard</url>
		<properties><id>henrypinkard</id></properties>
	</contributor>
	<contributor>
		<name>Ray Plante</name>
		<properties><id>RayPlante</id></properties>
	</contributor>
	<contributor>
		<name>Daniel Seebacher</name>
		<properties><id>seebacherd</id></properties>
	</contributor>
	<contributor>
		<name>Richard Domander</name>
		<url>https://imagej.net/User:Rdom</url>
		<properties><id>rimadoma</id></properties>
	</contributor>
</contributors>

<mailingLists>
	<mailingList>
		<name>ImageJ Forum</name>
		<archive>http://forum.imagej.net/tags/scifio</archive>
	</mailingList>
</mailingLists>

<scm>
	<connection>scm:git:git://github.com/scifio/scifio</connection>
	<developerConnection>scm:git:git@github.com:scifio/scifio</developerConnection>
	<tag>HEAD</tag>
	<url>https://github.com/scifio/scifio</url>
</scm>
<issueManagement>
	<system>GitHub Issues</system>
	<url>https://github.com/scifio/scifio/issues</url>
</issueManagement>
<ciManagement>
	<system>Travis CI</system>
	<url>https://travis-ci.org/scifio/scifio</url>
</ciManagement>

<properties>
	<package-name>io.scif</package-name>

	<license.licenseName>bsd_2</license.licenseName>
	<license.copyrightOwners>SCIFIO developers.</license.copyrightOwners>
	<license.projectName>SCIFIO library for reading and converting scientific file formats.</license.projectName>

	<imglib2.version>4.2.1</imglib2.version>
	<mapdb.version>1.0.3</mapdb.version>

	<!-- NB: Deploy releases to the ImageJ Maven repository. -->
	<releaseProfiles>deploy-to-imagej</releaseProfiles>
</properties>

<repositories>
	<repository>
		<id>imagej.public</id>
		<url>https://maven.imagej.net/content/groups/public</url>
	</repository>
</repositories>

<dependencies>
	<!-- SCIFIO dependencies -->
	<dependency>
		<groupId>io.scif</groupId>
		<artifactId>scifio-jai-imageio</artifactId>
	</dependency>

	<!-- ImageJ dependencies -->
	<dependency>
		<groupId>net.imagej</groupId>
		<artifactId>imagej-common</artifactId>
	</dependency>

	<!-- ImgLib2 dependencies -->
	<dependency>
		<groupId>net.imglib2</groupId>
		<artifactId>imglib2</artifactId>
	</dependency>

	<!-- SciJava dependencies -->
	<dependency>
		<groupId>org.scijava</groupId>
		<artifactId>scijava-common</artifactId>
	</dependency>

	<!-- Third-party dependencies -->
	<dependency>
		<groupId>org.mapdb</groupId>
		<artifactId>mapdb</artifactId>
		<version>${mapdb.version}</version>
	</dependency>

	<!-- Test scope dependencies -->
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<scope>test</scope>
	</dependency>

	<!-- scifio turorials dependencies -->
	<dependency>
		<groupId>io.scif</groupId>
		<artifactId>pom-scifio-tutorials</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</dependency>

</dependencies>
.

#12

What’s the reason you want one project to include both scifio and scifio-tutorials? As far as I can tell, declaring a dependency to both creates a circular dependency, because scifio-tutorials is already dependant on pom-scifio. Thus having both is not possible.


#13

There is no real reason to include both, scifio and scifio-tutorials. I did it just as a cross-check to identify maybe basic problems, on the way to find out why it’s not possible to have one project that includes scifio and HDF5_Vibez.

But I think the answer was already given by Curtis, because “The HDF5 Vibez plugin is not built on SCIFIO”. Taking this into account, I assume the best way forward is to take scifio as it is, and to investigate how to make use of HDF5_Vibez on top of it “the manual way”, means not using Maven. For this, I will contact @kmdouglass from the HDF5_Vibez project.

Hence, there is no more need to follow-up the Maven and pom issues.

Thanks to ALL for taking the time to provide valuable comments!

Juergen


#14

No, it does. But if you modify a pom.xml, especially outside of Eclipse, you may need to use the “Update Project” technique that @rimadoma described to get your Eclipse project back in sync with the Maven POM.

A parent POM is not a dependency in the Maven sense. So scifio and scifio-tutorials are not co-dependent. However, scifio-tutorials is not intended to be consumed as a dependency. You are supposed to take the source code you need from that project, and use it as a starting point for your own project.

You certainly could create a project that depends on both scifio and HDF5_Vibez. But they have nothing to do with one another. You could invoke each of them as libraries, though, as needed for your project.

I strongly advise any project you build to use Maven. The HDF5_Vibez project uses Maven. The scifio project uses Maven. You can consume either or both of them as dependencies using Maven.

Extend pom-scijava. Do not extend pom-scifio. Note that the SCIFIO tutorials are out of date, and need adjustment to extend pom-scijava instead of pom-scifio. Edit: I have now updated the scifio-tutorials projects to extend pom-scijava as they should.


#15

Hi there,

I am already working on SCIFIO HDF5 support! - my plan is to port code from HDF5_Vibez to SCIFIO Reader format… @jstumpe are you willing to join forces? There are a few issues with SCIFIO and files that handle multiple datasets (https://github.com/scifio/scifio/issues/259) so this could prove troublesome. For immediate use of HDF5s in scripts, I made a public legacy API for HDF5 (https://github.com/fiji/HDF5_Vibez/pull/4). I will soon (next week) push ij2 branch of HDF5_Vibez to my fork.

I think first it will just contain methods from legacy API (hdf5_read and hdf5_write) ported to work with Dataset / Img - next step is integration with SCIFIO - which would mean returning Plane objects from HDF5 so SCIFIO could do all the magic to create Img…

Let’s move the development-specific discussion here: HDF5 SCIFIO plugin discussion


HDF5 SCIFIO plugin discussion