I need to convert the new net.imglib2.img.Img
to the old ij.ImagePlus
class, because there is some old ImageJ 1.x I want to use.
Supposedly, I can use ImageJFunctions.wrap()
,
static <T extends NumericType<T>> ij.ImagePlus net.imglib2.img.display.imagej.ImageJFunctions.wrap(RandomAccessibleInterval, String)
since net.imglib2.img.Img
inherits from RandomAccessibleInterval
.
The problem I am having is that I cannot import ImageJFunctions
.
Code:
import net.imglib2.img.display.imagej.ImageJFunctions;
Error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
ImageJFunctions cannot be resolved to a type
In my pom.xml
, I am using org.scijava
with <version>26.0.0</version>
.
ImageJFunctions
lives in the imglib2-ij repo, so you'll need to add this dependency to your pom:
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-ij</artifactId>
</dependency>
Edit:
You can leave the version empty if you're using pom-scijava as a parent.
Mis-read part of your question, sorry. You probably won't need the information below, but I'm leaving it for completeness anyway, hope that's ok.
If you havn't already, you may also need to add the scijava maven repository:
<repositories>
<repository>
<id>scijava.public</id>
<url>https://maven.scijava.org/content/groups/public</url>
</repository>
</repositories>
You can check for available versions here, though it's often convenient to use pom-scijava as a parent pom.