changing the LUT alters the display range

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

changing the LUT alters the display range

Jeremy Adler
Oddity -when the LUT is changed the display range as seen on the screen is reset,
but the reported display range returned by getMinAndMAX is unchanged.
At the end of the macro the actual display is the full range 0-255, but reported range is 65-121.

And I missing something or is this a genuine problem    ImageJ 1.52v from FIJI

// changing the LUT resets the display range
print("\\Clear");
newImage("Untitled", "8-bit ramp", 256, 32, 1);// ramp.
getMinAndMax(minDis, maxDis);// check display range.
print("Orig display range",minDis, maxDis);
wait(3000);// delay see the image.
run("Grays");// LUT.
setMinAndMax(65, 121);// change display range.
getMinAndMax(minDisGray, maxDisGray);// check display range.
print("changed display range",minDisGray, maxDisGray);
wait(3000);// delay see the image.
run("Fire");;// change LUT.
getMinAndMax(minDis16, maxDis16);// check display range.
print("Fire display range",minDis16, maxDis16);

Jeremy Adler
BioVis
Uppsala u








När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: changing the LUT alters the display range

Gabriel Landini
Hi Jeremy,
Yes, I can reproduce it in the latest daily build. The image display does not
get set to the min and max values.
As soon as you execute the B/C command it gets set correctly, so I suppose
that there is an update or range set call missing somewhere.

Cheers

Gabriel


On Wednesday, 8 April 2020 09:01:41 BST you wrote:
> Oddity -when the LUT is changed the display range as seen on the screen is
> reset,
 but the reported display range returned by getMinAndMAX is
> unchanged. At the end of the macro the actual display is the full range
> 0-255, but reported range is 65-121.
> And I missing something or is this a genuine problem    ImageJ 1.52v from
> FIJI
 

> // changing the LUT resets the display range
> print("\\Clear");
> newImage("Untitled", "8-bit ramp", 256, 32, 1);// ramp.
> getMinAndMax(minDis, maxDis);// check display range.
> print("Orig display range",minDis, maxDis);
> wait(3000);// delay see the image.
> run("Grays");// LUT.
> setMinAndMax(65, 121);// change display range.
> getMinAndMax(minDisGray, maxDisGray);// check display range.
> print("changed display range",minDisGray, maxDisGray);
> wait(3000);// delay see the image.
> run("Fire");;// change LUT.
> getMinAndMax(minDis16, maxDis16);// check display range.
> print("Fire display range",minDis16, maxDis16);
>
> Jeremy Adler
> BioVis
> Uppsala u
>
>
>
>
>
>
>
>
> När du har kontakt med oss på Uppsala universitet med e-post så innebär det
> att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det
> kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/
 
> E-mailing Uppsala University means that we will process your personal data.
> For more information on how this is performed, please read here:
> http://www.uu.se/en/about-uu/data-protection-policy
 
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Help Required to Build MODULAR Java 11 Application Using ImageJ as Library

Michael P Ellis
Any help gratefully received.

I am trying to build a modular JavaFX application using ImageJ as a Java library under Java 11 with a NetBeans maven driven project.

My first port of call was to use the IntroToImageJAPI project based upon the example at

https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api <https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api>

I copied this project to my local hard disk and building with command line "mvn compile”

Under my default Java 11 installation this failed, to I switched to Java 1.8 and it succeeded in building.

I’ve spent days trying various options like adding the module-info.java file, moving the main class into a package trying different recommendations for the pom and the module-info file and at every turn, failure. So if anyone can help with…

1. Is there a version of ImageJ that can be used as a library for my own Java 11 compliant / JavaFX application and if so where do I get it?
2. Is there an SSCCE maven project for using ImageJ as a library using Java modules and is fully Java 11 compliant?

Failing this I will try and fall back and use Image 1.x though will that play nice with JavaFX if I avoid using any of the ImageJ UI features?

———
Of no doubt no interest to anyone, but I lament the myriad of complexities brought through the evolution of Java. Generics, Modules, Lambdas and Annotations whilst no doubt all useful feel like the sort of language layering that make what was once simple now obscure. It reminds me of what happened to the elegant simplicity of K&R C when C++ moseyed along with the macro preprocessor, pre compilation, and the STL library. Plain ugly. The original K&R C book was a slim tome that made it easy to unleash your imagination and get creative. Java now it feels like hurdles at every step.

Perhaps Oracle’s GraalVM will give a performance leg up to Python or a new clean and simple language.

Ignore this, just a personal grouchy gripe whilst I am solitary lockdown!

Wishing everyone stays health and happy.

P.S. For anyone wanting to try or use karyotyping software during this hellish period of Coronavirus we are allowing its use free of charge and free of any commitment whatsoever.Our attempt to put something back. https://www.karyotyper.com/ <https://www.karyotyper.com/>





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Help Required to Build MODULAR Java 11 Application Using ImageJ as Library

Peterbauer Thomas

On 08.04.20 12:40, Michael Ellis wrote:

> Any help gratefully received.
>
> I am trying to build a modular JavaFX application using ImageJ as a Java library under Java 11 with a NetBeans maven driven project.
>
> My first port of call was to use the IntroToImageJAPI project based upon the example at
>
> https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api <https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api>
>
> I copied this project to my local hard disk and building with command line "mvn compile”
>
> Under my default Java 11 installation this failed, to I switched to Java 1.8 and it succeeded in building.
>
> I’ve spent days trying various options like adding the module-info.java file, moving the main class into a package trying different recommendations for the pom and the module-info file and at every turn, failure. So if anyone can help with…
>
> 1. Is there a version of ImageJ that can be used as a library for my own Java 11 compliant / JavaFX application and if so where do I get it?

Yes, it's extemely painful to setup JavaFX+ImageJ, but as far as I can
tell ij.jar itself is no problem (even if compiled with JDK8). I just had to

1. Remove MacAdapter.class from ij.jar. JDK9+ confuses it with a
module-info.class

2. Make sure to have the following line in /META-INF/MANIFEST.MF in ij.jar:

     Automatic-Module-Name: ij

3. If you have a modular JavaFX app, add the following line to your
module-info.java:

     requires ij;

4. To run it, include the following options in the command line argument:

     --module-path path-to-ij.jar;path-to-other-jars
--add-modules=ij,javafx.base,javafx.controls,org,whatever-module-else-you-need

Note that, for the module path, multiple paths to different jar
locations need to be separated by a semicolon (on Windows) or a colon
(Linux).

Hope it helps,

Thomas

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: changing the LUT alters the display range

Wayne Rasband-2
In reply to this post by Jeremy Adler
> On Apr 8, 2020, at 4:01 AM, Jeremy Adler <[hidden email]> wrote:
>
> Oddity -when the LUT is changed the display range as seen on the screen is reset,
> but the reported display range returned by getMinAndMAX is unchanged.
> At the end of the macro the actual display is the full range 0-255, but reported range is 65-121.
>
> And I missing something or is this a genuine problem    ImageJ 1.52v from FIJI

This bug is fixed in the ImageJ 1.52v19 daily build and in the 1.52v release candidate.

-wayne


>
> // changing the LUT resets the display range
> print("\\Clear");
> newImage("Untitled", "8-bit ramp", 256, 32, 1);// ramp.
> getMinAndMax(minDis, maxDis);// check display range.
> print("Orig display range",minDis, maxDis);
> wait(3000);// delay see the image.
> run("Grays");// LUT.
> setMinAndMax(65, 121);// change display range.
> getMinAndMax(minDisGray, maxDisGray);// check display range.
> print("changed display range",minDisGray, maxDisGray);
> wait(3000);// delay see the image.
> run("Fire");;// change LUT.
> getMinAndMax(minDis16, maxDis16);// check display range.
> print("Fire display range",minDis16, maxDis16);
>
> Jeremy Adler
> BioVis
> Uppsala u

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Help Required to Build MODULAR Java 11 Application Using ImageJ as Library

Michael P Ellis
In reply to this post by Peterbauer Thomas
Dear Thomas,

Thank you for you reply,

I have some questions about your reply (below) due to my lack of understanding. I apologise.

Firstly, before we even get to the JavaFX, I just want to use the latest ImageJ distribution with a Java 11 Modules project building with Maven

- Is https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api a good starting point?

- If it is what edits do I need to make to this project pom.xml

- Does this project use the recommended version of ImageJ?

I have just created a public gitlab repository with what i have so far (which does not work)
Yuu can get it at: https://gitlab.com/Michael51773/java11moduleimagej <https://gitlab.com/Michael51773/java11moduleimagej>o
If you or anyone is able to provide guidance to getting this work then I will leave it up as a recipe for others.

At present I get…

As you can see the pom that ships with the example rejects the use of a JDK that is not 1.8.x

I have tried to cut the source example to the bear minimum SSCCE to get the ball rolling.

— Michael Ellis




macbokpro:Java11ImageJ michaelellis$ java -version
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
macbokpro:Java11ImageJ michaelellis$ mvn -version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T20:00:29+01:00)
Maven home: /usr/local/Cellar/maven/3.6.1/libexec
Java version: 11.0.6, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
macbokpro:Java11ImageJ michaelellis$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< imagej-tutorials:intro-to-imagej-api >----------------
[INFO] Building Intro to ImageJ API with Java 11 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ intro-to-imagej-api ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] Adding ignore: org.apache.hadoop.yarn.*.package-info
[INFO] Adding ignore: org.apache.spark.unused.UnusedStubClass
[INFO] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
[INFO] Adding ignore: org.junit.runner.Runner
[INFO] Adding ignore: module-info
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 11.0.6 is not in the allowed range [1.8.0-101,1.8.9999].
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.261 s
[INFO] Finished at: 2020-04-08T17:43:35+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-rules) on project intro-to-imagej-api: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
macbokpro:Java11ImageJ michaelellis$



> On 8 Apr 2020, at 13:09, Thomas Peterbauer <[hidden email]> wrote:
>
>
> On 08.04.20 12:40, Michael Ellis wrote:
>> Any help gratefully received.
>>
>> I am trying to build a modular JavaFX application using ImageJ as a Java library under Java 11 with a NetBeans maven driven project.
>>
>> My first port of call was to use the IntroToImageJAPI project based upon the example at
>>
>> https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api <https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api>
>>
>> I copied this project to my local hard disk and building with command line "mvn compile”
>>
>> Under my default Java 11 installation this failed, to I switched to Java 1.8 and it succeeded in building.
>>
>> I’ve spent days trying various options like adding the module-info.java file, moving the main class into a package trying different recommendations for the pom and the module-info file and at every turn, failure. So if anyone can help with…
>>
>> 1. Is there a version of ImageJ that can be used as a library for my own Java 11 compliant / JavaFX application and if so where do I get it?
>
> Yes, it's extemely painful to setup JavaFX+ImageJ, but as far as I can
> tell ij.jar itself is no problem (even if compiled with JDK8). I just had to
>
> 1. Remove MacAdapter.class from ij.jar. JDK9+ confuses it with a
> module-info.class

> 2. Make sure to have the following line in /META-INF/MANIFEST.MF in ij.jar:
>
>     Automatic-Module-Name: ij
>
> 3. If you have a modular JavaFX app, add the following line to your
> module-info.java:
>
>     requires ij;
>
> 4. To run it, include the following options in the command line argument:
>
>     --module-path path-to-ij.jar;path-to-other-jars
> --add-modules=ij,javafx.base,javafx.controls,org,whatever-module-else-you-need
>
> Note that, for the module path, multiple paths to different jar
> locations need to be separated by a semicolon (on Windows) or a colon
> (Linux).
>
> Hope it helps,
>
> Thomas
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

I am attempting to use Maven for the build process.




Michael Ellis (Managing Director)
Digital Scientific UK Ltd.
http://www.dsuk.biz <http://www.dsuk.biz/>
[hidden email]
tel: +44(0)1223 911215

The Commercial Centre
6 Green End
Cambridge
CB23 7DY

=== END OF EMAIL ===


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Layout.jpeg (29K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

LUT being lost When Converting Stack from 16bit to 8 bit

Michael P Ellis
If I create a 4 channel, 16bit CompositeImage, assign a LUT to the 4th channel, and then convert the CompositeImage to 8 bit, the assigned LUT is lost.

You can recreate the problem with this ImageJMacro:

newImage("HyperStack", "16-bit composite-mode label", 256, 256, 4, 1, 1);
setSlice(4);
run("Cyan");
setSlice(1);
run("8-bit");
setSlice(4);

Not after running the macro, that the LUT for channel 4 has default to its default value of being Grays

This is not my actual use case, I am using ImageJ as a callable library but, of course after converting my 16bit stack to 8 bit, I lose my LUT assignments.

Is there a fix or a better way of doing this?

This seems to be the case for both Image 1.52u and for 2.0.0-rc-69/15sp (as part if Fiji distribution)



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: LUT being lost When Converting Stack from 16bit to 8 bit

Krs5
Yep, i can repeat this and it seems to be the case for any channel in any composite image.

Best wishes

Kees

________________________________
From: Michael Ellis <[hidden email]>
Sent: 09 April 2020 11:11
To: [hidden email] <[hidden email]>
Subject: LUT being lost When Converting Stack from 16bit to 8 bit

If I create a 4 channel, 16bit CompositeImage, assign a LUT to the 4th channel, and then convert the CompositeImage to 8 bit, the assigned LUT is lost.

You can recreate the problem with this ImageJMacro:

newImage("HyperStack", "16-bit composite-mode label", 256, 256, 4, 1, 1);
setSlice(4);
run("Cyan");
setSlice(1);
run("8-bit");
setSlice(4);

Not after running the macro, that the LUT for channel 4 has default to its default value of being Grays

This is not my actual use case, I am using ImageJ as a callable library but, of course after converting my 16bit stack to 8 bit, I lose my LUT assignments.

Is there a fix or a better way of doing this?

This seems to be the case for both Image 1.52u and for 2.0.0-rc-69/15sp (as part if Fiji distribution)



--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7C4f004bea42c54359bfe908d7dc6e68ae%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637220239075645895&amp;sdata=BuUAaGn%2Fsl%2FUYtqVELSigD4QoXpPYbP8wNSVGsEsp40%3D&amp;reserved=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: LUT being lost When Converting Stack from 16bit to 8 bit

Michael P Ellis
In reply to this post by Michael P Ellis
As a follow up to this. For my use case, in Java, converting a 16 bit CompositeImage to 8 bit CompositeImage preserving LUTS, this seems to work:

        CompositeImage ci = createTestImage(1024, 1024);
        LUT[] luts = ci.getLuts(); // Copy luts
        new StackConverter(ci).convertToGray8();
        ci.setTitle(ci.getTitle());
        ci.setLuts(luts); // re- apply luts
        ci.resetDisplayRanges();

> On 9 Apr 2020, at 11:11, Michael Ellis <[hidden email]> wrote:
>
> If I create a 4 channel, 16bit CompositeImage, assign a LUT to the 4th channel, and then convert the CompositeImage to 8 bit, the assigned LUT is lost.
>
> You can recreate the problem with this ImageJMacro:
>
> newImage("HyperStack", "16-bit composite-mode label", 256, 256, 4, 1, 1);
> setSlice(4);
> run("Cyan");
> setSlice(1);
> run("8-bit");
> setSlice(4);
>
> Not after running the macro, that the LUT for channel 4 has default to its default value of being Grays
>
> This is not my actual use case, I am using ImageJ as a callable library but, of course after converting my 16bit stack to 8 bit, I lose my LUT assignments.
>
> Is there a fix or a better way of doing this?
>
> This seems to be the case for both Image 1.52u and for 2.0.0-rc-69/15sp (as part if Fiji distribution)
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Michael Ellis (Managing Director)
Digital Scientific UK Ltd.
http://www.dsuk.biz <http://www.dsuk.biz/>
[hidden email]
tel: +44(0)1223 911215

The Commercial Centre
6 Green End
Cambridge
CB23 7DY

=== END OF EMAIL ===


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Help Required to Build MODULAR Java 11 Application Using ImageJ as Library

Curtis Rueden-2
In reply to this post by Michael P Ellis
Hi Michael,

> I just want to use the latest ImageJ distribution with a Java 11 Modules
> project building with Maven
>
> - Is
>
https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api
> a good starting point?

Be aware that everything in https://github.com/imagej/tutorials uses
ImageJ2. Based on other questions I've seen from you on this mailing list,
I assume you want to use ImageJ1?

That said: ImageJ2 is currently built on Java 8. The pom-scijava parent
(used by the tutorials, and which I encourage you to use) enforces Java 8
to build by default, although this can be changed by overriding the
scijava.jvm.version and scijava.jvm.build.version properties. We are in the
process of exploring use of Java 11 (experimental code at
https://github.com/scijava/incubator is now Java-11-based) but I expect it
will still be months-to-years before ImageJ2 and Fiji have fully made the
switch.

> 1. Is there a version of ImageJ that can be used as a library for my own
Java
> 11 compliant / JavaFX application and if so where do I get it?

The net.imagej:ij artifacts (i.e. ImageJ1) on Maven Central include
"Automatic-Module-Name: ij" in the manifest starting with version 1.52m. So
hopefully you can depend on net.imagej:ij directly without needing to
repackage it yourself. Although if what Thomas said about MacAdapter.class
is correct, that could be a remaining technical hurdle, since the published
Maven artifacts do still include MacAdapter.class in the root folder.

As an aside: an application can be "Java 11 compliant"—i.e., build and run
using Java 11—without being JPMS modular.

> 2. Is there an SSCCE maven project for using ImageJ as a library using
Java
> modules and is fully Java 11 compliant?

The best I can offer you right now is a work-in-progress branch on the
scijava/incubator repository [1]. There, we are exploring JPMS
modularization of next-generation SciJava and ImageJ components. I am
interested in modularizing the next-generation codebase because it will
allow much greater control and limits to the public API surface, hopefully
reducing future code paralysis and improving long-term reproducibility of
user extensions.

Finally, some gotchas with Maven-based JPMS-modularized projects we have
already run across:

- Use the latest maven-compiler-plugin -- version 3.7.0 is too old. Version
3.8.1 works.

- The latest pom-scijava parent has a "jigsaw" profile [2] that triggers
when you have a src/main/java/module-info.java, intended to allow
JPMS-modularized projects to target Java 8. Unfortunately, this profile
breaks compilation of JPMS-modularized projects when targeting Java 11.
Therefore, we have now removed this profile on the master branch [3].
Therefore, the next major release of pom-scijava should work better for use
with JPMS-modularized projects targeting Java 11.

If you have further questions about this, I encourage you to post on
forum.image.sc in the Development category, rather than here.

Regards,
Curtis

--
Curtis Rueden
Software architect, LOCI/Eliceiri lab - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Have you tried the Image.sc Forum? https://forum.image.sc/

[1] https://github.com/scijava/incubator/tree/scijava/scijava-ops/modularity
[2] Based on this article:
https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html
[3]
https://github.com/scijava/pom-scijava-base/commit/4706af1d418352e655af357f07ca82e15abdd4c2

On Wed, Apr 8, 2020 at 11:51 AM Michael Ellis <[hidden email]>
wrote:

> Dear Thomas,
>
> Thank you for you reply,
>
> I have some questions about your reply (below) due to my lack of
> understanding. I apologise.
>
> Firstly, before we even get to the JavaFX, I just want to use the latest
> ImageJ distribution with a Java 11 Modules project building with Maven
>
> - Is
> https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api
> a good starting point?
>
> - If it is what edits do I need to make to this project pom.xml
>
> - Does this project use the recommended version of ImageJ?
>
> I have just created a public gitlab repository with what i have so far
> (which does not work)
> Yuu can get it at: https://gitlab.com/Michael51773/java11moduleimagej <
> https://gitlab.com/Michael51773/java11moduleimagej>o
> If you or anyone is able to provide guidance to getting this work then I
> will leave it up as a recipe for others.
>
> At present I get…
>
> As you can see the pom that ships with the example rejects the use of a
> JDK that is not 1.8.x
>
> I have tried to cut the source example to the bear minimum SSCCE to get
> the ball rolling.
>
> — Michael Ellis
>
>
>
>
> macbokpro:Java11ImageJ michaelellis$ java -version
> java version "11.0.6" 2020-01-14 LTS
> Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
> Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
> macbokpro:Java11ImageJ michaelellis$ mvn -version
> Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555;
> 2019-04-04T20:00:29+01:00)
> Maven home: /usr/local/Cellar/maven/3.6.1/libexec
> Java version: 11.0.6, vendor: Oracle Corporation, runtime:
> /Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home
> Default locale: en_GB, platform encoding: UTF-8
> OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
> macbokpro:Java11ImageJ michaelellis$ mvn compile
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ----------------< imagej-tutorials:intro-to-imagej-api
> >----------------
> [INFO] Building Intro to ImageJ API with Java 11 1.0.0-SNAPSHOT
> [INFO] --------------------------------[ jar
> ]---------------------------------
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @
> intro-to-imagej-api ---
> [INFO] Adding ignore: module-info
> [INFO] Adding ignore: META-INF/versions/*/module-info
> [INFO] Adding ignore: org.apache.hadoop.yarn.*.package-info
> [INFO] Adding ignore: org.apache.spark.unused.UnusedStubClass
> [INFO] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
> [INFO] Adding ignore: org.junit.runner.Runner
> [INFO] Adding ignore: module-info
> [WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireJavaVersion
> failed with message:
> Detected JDK Version: 11.0.6 is not in the allowed range
> [1.8.0-101,1.8.9999].
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time:  7.261 s
> [INFO] Finished at: 2020-04-08T17:43:35+01:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce
> (enforce-rules) on project intro-to-imagej-api: Some Enforcer rules have
> failed. Look above for specific messages explaining why the rule failed. ->
> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> macbokpro:Java11ImageJ
> <http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionmacbokpro:Java11ImageJ>
> michaelellis$
>
>
>
> > On 8 Apr 2020, at 13:09, Thomas Peterbauer <
> [hidden email]> wrote:
> >
> >
> > On 08.04.20 12:40, Michael Ellis wrote:
> >> Any help gratefully received.
> >>
> >> I am trying to build a modular JavaFX application using ImageJ as a
> Java library under Java 11 with a NetBeans maven driven project.
> >>
> >> My first port of call was to use the IntroToImageJAPI project based
> upon the example at
> >>
> >>
> https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api
> <
> https://github.com/imagej/tutorials/tree/master/maven-projects/intro-to-imagej-api
> >
> >>
> >> I copied this project to my local hard disk and building with command
> line "mvn compile”
> >>
> >> Under my default Java 11 installation this failed, to I switched to
> Java 1.8 and it succeeded in building.
> >>
> >> I’ve spent days trying various options like adding the module-info.java
> file, moving the main class into a package trying different recommendations
> for the pom and the module-info file and at every turn, failure. So if
> anyone can help with…
> >>
> >> 1. Is there a version of ImageJ that can be used as a library for my
> own Java 11 compliant / JavaFX application and if so where do I get it?
> >
> > Yes, it's extemely painful to setup JavaFX+ImageJ, but as far as I can
> > tell ij.jar itself is no problem (even if compiled with JDK8). I just
> had to
> >
> > 1. Remove MacAdapter.class from ij.jar. JDK9+ confuses it with a
> > module-info.class
>
> > 2. Make sure to have the following line in /META-INF/MANIFEST.MF in
> ij.jar:
> >
> >     Automatic-Module-Name: ij
> >
> > 3. If you have a modular JavaFX app, add the following line to your
> > module-info.java:
> >
> >     requires ij;
> >
> > 4. To run it, include the following options in the command line argument:
> >
> >     --module-path path-to-ij.jar;path-to-other-jars
> >
> --add-modules=ij,javafx.base,javafx.controls,org,whatever-module-else-you-need
> >
> > Note that, for the module path, multiple paths to different jar
> > locations need to be separated by a semicolon (on Windows) or a colon
> > (Linux).
> >
> > Hope it helps,
> >
> > Thomas
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> I am attempting to use Maven for the build process.
>
>
>
>
> Michael Ellis (Managing Director)
> Digital Scientific UK Ltd.
> http://www.dsuk.biz <http://www.dsuk.biz/>
> [hidden email]
> tel: +44(0)1223 911215
>
> The Commercial Centre
> 6 Green End
> Cambridge
> CB23 7DY
>
> === END OF EMAIL ===
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html