Skip to content

Commit

Permalink
Merge pull request ome#4040 from sbesson/lurawave_removal
Browse files Browse the repository at this point in the history
Remove support for proprietary LuraWave license
  • Loading branch information
dgault authored Jul 27, 2023
2 parents 65db5eb + 1b16e9a commit 6c25c68
Show file tree
Hide file tree
Showing 23 changed files with 10 additions and 704 deletions.
2 changes: 0 additions & 2 deletions .classpath-template
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<classpathentry kind="src" path="components/formats-bsd/src"/>
<classpathentry kind="src" path="components/formats-gpl/build/src"/>
<classpathentry kind="src" path="components/formats-gpl/src"/>
<classpathentry kind="src" path="components/stubs/lwf-stubs/build/src"/>
<classpathentry kind="src" path="components/stubs/lwf-stubs/src"/>
<classpathentry kind="src" path="components/test-suite/build/src"/>
<classpathentry kind="src" path="components/test-suite/src"/>
<classpathentry kind="src" path="components/formats-api/test"/>
Expand Down
18 changes: 1 addition & 17 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Bio-Formats
JAR file: bio-formats.jar
Path: components/bio-formats
Project deps: Formats Common, OME-XML Java library, JAI Image I/O Tools,
MDB Tools (Java port), Apache Jakarta POI,
Luratech LuraWave stubs
MDB Tools (Java port), Apache Jakarta POI
Library deps: JGoodies Forms, Logback, NetCDF,
Simple Logging Facade for Java API, TestNG
Optional: Xalan Serializer, Xalan
Expand Down Expand Up @@ -76,21 +75,6 @@ JAI Image I/O Tools
This component will be removed once our changes have been
added to the official JAI CVS repository.
===============================================================================
The following components are stubs of third party projects:
Luratech LuraWave stubs
Stub of proprietary Java API to handle Luratech LWF compression
-=-
JAR file: lwf-stubs.jar
Path: components/stubs/lwf-stubs
Project deps: (none)
Optional: (none)
License: BSD
Project URL: http://www.luratech.com/
Notes: required to compile Bio-Formats's support for Luratech LWF
compression for the Opera Flex format
===============================================================================
The following external dependencies (in the jar folder) may be required:
Ant-Contrib
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,3 @@ url = http://www.loci.wisc.edu/software/ome-notes
license = GPL
notes = OME Notes library for flexible organization and presentation
of OME-XML metadata.

[LuraWave decoder SDK]
type = Java library
class = com.luratech.lwf.lwfDecoder
url = http://www.luratech.com/
license = Commercial
notes = Used by Bio-Formats to decode Flex files
compressed with the LuraWave JPEG2000 codec.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import loci.plugins.util.BFVirtualStack;
import loci.plugins.util.ImageProcessorReader;
import loci.plugins.util.LociPrefs;
import loci.plugins.util.LuraWave;
import loci.plugins.util.VirtualImagePlus;
import ome.units.UNITS;
import ome.units.quantity.Time;
Expand Down Expand Up @@ -385,7 +384,13 @@ private ImageStack readPlanes(ImportProcess process, int s, List<LUT> luts,
updateTiming(s, current, current++, total);

// get image processor for ith plane
final ImageProcessor[] p = readProcessors(process, i, region, thumbnail);
ImageProcessor[] p;
if (thumbnail) {
p = reader.openThumbProcessors(i);
} else {
p = reader.openProcessors(i, region.x, region.y, region.width, region.height);
}

if (p == null || p.length == 0) {
throw new FormatException("Cannot read plane #" + i);
}
Expand All @@ -401,40 +406,6 @@ private ImageStack readPlanes(ImportProcess process, int s, List<LUT> luts,
return createStack(procs, labels, luts);
}

/**
* HACK: This method mainly exists to prompt the user for a missing
* LuraWave license code, in the case of LWF-compressed Flex.
*
* @see ImportProcess#setId()
*/
private ImageProcessor[] readProcessors(ImportProcess process,
int no, Region r, boolean thumbnail) throws FormatException, IOException
{
final ImageProcessorReader reader = process.getReader();
final ImporterOptions options = process.getOptions();

boolean first = true;
for (int i=0; i<LuraWave.MAX_TRIES; i++) {
String code = LuraWave.initLicenseCode();
try {
if (thumbnail) {
return reader.openThumbProcessors(no);
}
return reader.openProcessors(no, r.x, r.y, r.width, r.height);
}
catch (FormatException exc) {
if (options.isQuiet() || options.isWindowless()) throw exc;
if (!LuraWave.isLicenseCodeException(exc)) throw exc;

// prompt user for LuraWave license code
code = LuraWave.promptLicenseCode(code, first);
if (code == null) throw exc;
if (first) first = false;
}
}
throw new FormatException(LuraWave.TOO_MANY_TRIES);
}

// -- Helper methods - image post processing --

private List<ImagePlus> concatenate(List<ImagePlus> imps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import loci.plugins.BF;
import loci.plugins.util.ImageProcessorReader;
import loci.plugins.util.LociPrefs;
import loci.plugins.util.LuraWave;
import loci.plugins.util.VirtualReader;
import loci.plugins.util.WindowTools;
import ome.xml.model.enums.DimensionOrder;
Expand Down Expand Up @@ -544,7 +543,7 @@ private void initializeStack() throws FormatException, IOException {
baseReader.getMetadataOptions().setMetadataLevel(
MetadataLevel.NO_OVERLAYS);
}
setId();
reader.setId(options.getId());

computeSeriesLabels(reader);
}
Expand Down Expand Up @@ -687,34 +686,6 @@ private void saveDefaults() {

// -- Helper methods -- ImportStep.STACK --

/**
* HACK: This method mainly exists to prompt the user for a missing
* LuraWave license code, in the case of LWF-compressed Flex.
*
* @see ImagePlusReader#readProcessors(ImportProcess, int, Region, boolean)
*/
private void setId() throws FormatException, IOException {
boolean first = true;
for (int i=0; i<LuraWave.MAX_TRIES; i++) {
String code = LuraWave.initLicenseCode();
try {
reader.setId(options.getId());
return;
}
catch (FormatException exc) {
if (options.isQuiet() || options.isWindowless()) throw exc;
if (!LuraWave.isLicenseCodeException(exc)) throw exc;

// prompt user for LuraWave license code
code = LuraWave.promptLicenseCode(code, first);
if (code == null) throw exc;
if (first) first = false;
reader.close();
}
}
throw new FormatException(LuraWave.TOO_MANY_TRIES);
}

private void computeSeriesLabels(IFormatReader r) {
final int seriesCount = r.getSeriesCount();
seriesLabels = new String[seriesCount];
Expand Down
89 changes: 0 additions & 89 deletions components/bio-formats-plugins/src/loci/plugins/util/LuraWave.java

This file was deleted.

7 changes: 0 additions & 7 deletions components/bundles/bioformats_package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.openmicroscopy</groupId>
<artifactId>lwf-stubs</artifactId>
<version>${lwf-stubs.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmicroscopy</groupId>
<artifactId>mipav-stubs</artifactId>
Expand Down
Loading

0 comments on commit 6c25c68

Please sign in to comment.