Skip to content

Commit

Permalink
Merge branch 'ome:develop' into xlefreader
Browse files Browse the repository at this point in the history
  • Loading branch information
XLEFReaderForBioformats authored Oct 28, 2024
2 parents dfaf67f + df36e69 commit 53a7a99
Show file tree
Hide file tree
Showing 123 changed files with 2,606 additions and 1,381 deletions.
2 changes: 1 addition & 1 deletion components/bio-formats-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>ome</groupId>
<artifactId>pom-bio-formats</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public void run() {
log.println("-- Formats --");
try {
Class<?> irClass = Class.forName("loci.formats.ImageReader");
Object ir = irClass.newInstance();
Object ir = irClass.getDeclaredConstructor().newInstance();
Method getClasses = irClass.getMethod("getReaders");
Object[] readers = (Object[]) getClasses.invoke(ir);
for (int i=0; i<readers.length; i++) {
Expand Down Expand Up @@ -395,7 +395,7 @@ public void run() {
String matlabVersion = null;
try {
Class<?> matlabClass = Class.forName("com.mathworks.jmi.Matlab");
Object matlab = matlabClass.newInstance();
Object matlab = matlabClass.getDeclaredConstructor().newInstance();
Method eval = matlabClass.getMethod("eval", new Class[] {String.class});

String ans = (String) eval.invoke(matlab, new Object[] {"version"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public FormatEntry(PrintWriter log, Object reader) {
String fwClassName = "loci.plugins.config." + readerName + "Widgets";
try {
Class<?> fwClass = Class.forName(fwClassName);
fw = (IFormatWidgets) fwClass.newInstance();
fw = (IFormatWidgets) fwClass.getDeclaredConstructor().newInstance();
log.println("Initialized extra widgets for " + readerName + " reader.");
}
catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ else if (options.isOMERO()) {
String group = gd.getNextString();
Long groupID = null;
try {
groupID = new Long(group);
groupID = Long.parseLong(group);
}
catch (NumberFormatException e) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ public ImporterMetadata(IFormatReader r, ImportProcess process,

// merge core values
final String pad = " "; // puts core values first when alphabetizing
put(pad + s + "SizeX", new Integer(r.getSizeX()));
put(pad + s + "SizeY", new Integer(r.getSizeY()));
put(pad + s + "SizeZ", new Integer(r.getSizeZ()));
put(pad + s + "SizeT", new Integer(r.getSizeT()));
put(pad + s + "SizeC", new Integer(r.getSizeC()));
put(pad + s + "IsRGB", new Boolean(r.isRGB()));
put(pad + s + "SizeX", Integer.valueOf(r.getSizeX()));
put(pad + s + "SizeY", Integer.valueOf(r.getSizeY()));
put(pad + s + "SizeZ", Integer.valueOf(r.getSizeZ()));
put(pad + s + "SizeT", Integer.valueOf(r.getSizeT()));
put(pad + s + "SizeC", Integer.valueOf(r.getSizeC()));
put(pad + s + "IsRGB", Boolean.valueOf(r.isRGB()));
put(pad + s + "PixelType",
FormatTools.getPixelTypeString(r.getPixelType()));
put(pad + s + "LittleEndian", new Boolean(r.isLittleEndian()));
put(pad + s + "LittleEndian", Boolean.valueOf(r.isLittleEndian()));
put(pad + s + "DimensionOrder", r.getDimensionOrder());
put(pad + s + "IsInterleaved", new Boolean(r.isInterleaved()));
put(pad + s + "BitsPerPixel", new Integer(r.getBitsPerPixel()));
put(pad + s + "IsInterleaved", Boolean.valueOf(r.isInterleaved()));
put(pad + s + "BitsPerPixel", Integer.valueOf(r.getBitsPerPixel()));

String seriesName = process.getOMEMetadata().getImageName(i);
put(pad + "Series " + i + " Name", seriesName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,25 @@ public void getVersionNumber(String[] version) {
// -- LociFunctions API methods - loci.formats.IFormatReader --

public void getImageCount(Double[] imageCount) {
imageCount[0] = new Double(r.getImageCount());
imageCount[0] = Double.valueOf(r.getImageCount());
}

public void getSizeX(Double[] sizeX) { sizeX[0] = new Double(r.getSizeX()); }
public void getSizeY(Double[] sizeY) { sizeY[0] = new Double(r.getSizeY()); }
public void getSizeZ(Double[] sizeZ) { sizeZ[0] = new Double(r.getSizeZ()); }
public void getSizeC(Double[] sizeC) { sizeC[0] = new Double(r.getSizeC()); }
public void getSizeT(Double[] sizeT) { sizeT[0] = new Double(r.getSizeT()); }
public void getSizeX(Double[] sizeX) { sizeX[0] = Double.valueOf(r.getSizeX()); }
public void getSizeY(Double[] sizeY) { sizeY[0] = Double.valueOf(r.getSizeY()); }
public void getSizeZ(Double[] sizeZ) { sizeZ[0] = Double.valueOf(r.getSizeZ()); }
public void getSizeC(Double[] sizeC) { sizeC[0] = Double.valueOf(r.getSizeC()); }
public void getSizeT(Double[] sizeT) { sizeT[0] = Double.valueOf(r.getSizeT()); }

public void getPixelType(String[] pixelType) {
pixelType[0] = FormatTools.getPixelTypeString(r.getPixelType());
}

public void getEffectiveSizeC(Double[] effectiveSizeC) {
effectiveSizeC[0] = new Double(r.getEffectiveSizeC());
effectiveSizeC[0] = Double.valueOf(r.getEffectiveSizeC());
}

public void getRGBChannelCount(Double[] rgbChannelCount) {
rgbChannelCount[0] = new Double(r.getRGBChannelCount());
rgbChannelCount[0] = Double.valueOf(r.getRGBChannelCount());
}

public void isIndexed(String[] indexed) {
Expand All @@ -154,33 +154,33 @@ public void isIndexed(String[] indexed) {

public void getChannelDimCount(Double[] channelDimCount) {
Modulo moduloC = r.getModuloC();
channelDimCount[0] = new Double(moduloC.length() > 1 ? 2 : 1);
channelDimCount[0] = Double.valueOf(moduloC.length() > 1 ? 2 : 1);
}

public void getChannelDimLength(Double i, Double[] channelDimLength) {
Modulo moduloC = r.getModuloC();
if (i.intValue() == 0) { // index 0
channelDimLength[0] = new Double(moduloC.length() > 1 ? r.getSizeC() / moduloC.length() : r.getSizeC());
channelDimLength[0] = Double.valueOf(moduloC.length() > 1 ? r.getSizeC() / moduloC.length() : r.getSizeC());
} else { // index 1
channelDimLength[0] = new Double(moduloC.length());
channelDimLength[0] = Double.valueOf(moduloC.length());
}
}

public void getChannelDimType(Double i, Double[] channelDimType) {
Modulo moduloC = r.getModuloC();
if (i.intValue() == 0) { // index 0
channelDimType[0] = new Double(moduloC.length() > 1 ? moduloC.parentType : FormatTools.CHANNEL);
channelDimType[0] = Double.valueOf(moduloC.length() > 1 ? moduloC.parentType : FormatTools.CHANNEL);
} else { // index 1
channelDimType[0] = new Double(moduloC.type);
channelDimType[0] = Double.valueOf(moduloC.type);
}
}

// public void getThumbSizeX(Double[] thumbSizeX) {
// thumbSizeX[0] = new Double(r.getThumbSizeX());
// thumbSizeX[0] = Double.valueOf(r.getThumbSizeX());
// }

// public void getThumbSizeY(Double[] thumbSizeY) {
// thumbSizeY[0] = new Double(r.getThumbSizeY());
// thumbSizeY[0] = Double.valueOf(r.getThumbSizeY());
// }

public void isLittleEndian(String[] littleEndian) {
Expand Down Expand Up @@ -270,7 +270,7 @@ public void openImage(String title, Double no)
throws FormatException, IOException
{
openSubImage(title, no, 0d, 0d,
new Double(r.getSizeX()), new Double(r.getSizeY()));
Double.valueOf(r.getSizeX()), Double.valueOf(r.getSizeY()));
}

public void openSubImage(String title, Double no, Double x, Double y,
Expand Down Expand Up @@ -310,7 +310,7 @@ public void openSubImage(String title, Double no, Double x, Double y,
public void closeFileOnly() throws IOException { r.close(true); }

public void getSeriesCount(Double[] seriesCount) {
seriesCount[0] = new Double(r.getSeriesCount());
seriesCount[0] = Double.valueOf(r.getSeriesCount());
}

public void setSeries(Double seriesNum) {
Expand All @@ -323,23 +323,23 @@ public void setSeries(Double seriesNum) {
}

public void getSeries(Double[] seriesNum) {
seriesNum[0] = new Double(r.getSeries());
seriesNum[0] = Double.valueOf(r.getSeries());
}

public void setNormalized(Boolean normalize) {
r.setNormalized(normalize.booleanValue());
}

public void isNormalized(Boolean[] normalize) {
normalize[0] = new Boolean(r.isNormalized());
normalize[0] = Boolean.valueOf(r.isNormalized());
}

public void setOriginalMetadataPopulated(Boolean populate) {
r.setOriginalMetadataPopulated(populate.booleanValue());
}

public void isOriginalMetadataPopulated(Boolean[] populate) {
populate[0] = new Boolean(r.isOriginalMetadataPopulated());
populate[0] = Boolean.valueOf(r.isOriginalMetadataPopulated());
}

public void setGroupFiles(String groupFiles) {
Expand Down Expand Up @@ -373,7 +373,7 @@ public void fileGroupOption(String id, String[] fileGroupOption)
}

public void getUsedFileCount(Double[] count) {
count[0] = new Double(r.getUsedFiles().length);
count[0] = Double.valueOf(r.getUsedFiles().length);
}

public void getUsedFile(Double i, String[] used) {
Expand All @@ -385,14 +385,14 @@ public void getCurrentFile(String[] file) {
}

public void getIndex(Double z, Double c, Double t, Double[] index) {
index[0] = new Double(r.getIndex(z.intValue(), c.intValue(), t.intValue()));
index[0] = Double.valueOf(r.getIndex(z.intValue(), c.intValue(), t.intValue()));
}

public void getZCTCoords(Double index, Double[] z, Double[] c, Double[] t) {
int[] zct = r.getZCTCoords(index.intValue());
z[0] = new Double(zct[0]);
c[0] = new Double(zct[1]);
t[0] = new Double(zct[2]);
z[0] = Double.valueOf(zct[0]);
c[0] = Double.valueOf(zct[1]);
t[0] = Double.valueOf(zct[2]);
}

public void getMetadataValue(String field, String[] value) {
Expand Down Expand Up @@ -472,7 +472,7 @@ public void getPlaneTimingExposureTime(Double[] exposureTime, Double no) {
val = valTime.value(UNITS.SECOND).doubleValue();
}
}
exposureTime[0] = val == null ? new Double(Double.NaN) : val;
exposureTime[0] = val == null ? Double.NaN : val;
}

public void getPlanePositionX(Double[] positionX, Double no) {
Expand Down Expand Up @@ -524,7 +524,7 @@ public void getPixelsPhysicalSizeX(Double[] sizeX) {
if (x != null) {
sizeX[0] = x.value(UNITS.MICROMETER).doubleValue();
}
if (sizeX[0] == null) sizeX[0] = new Double(Double.NaN);
if (sizeX[0] == null) sizeX[0] = Double.NaN;
}

public void getPixelsPhysicalSizeY(Double[] sizeY) {
Expand All @@ -534,7 +534,7 @@ public void getPixelsPhysicalSizeY(Double[] sizeY) {
if (y != null) {
sizeY[0] = y.value(UNITS.MICROMETER).doubleValue();
}
if (sizeY[0] == null) sizeY[0] = new Double(Double.NaN);
if (sizeY[0] == null) sizeY[0] = Double.NaN;
}

public void getPixelsPhysicalSizeZ(Double[] sizeZ) {
Expand All @@ -544,14 +544,14 @@ public void getPixelsPhysicalSizeZ(Double[] sizeZ) {
if (z != null) {
sizeZ[0] = z.value(UNITS.MICROMETER).doubleValue();
}
if (sizeZ[0] == null) sizeZ[0] = new Double(Double.NaN);
if (sizeZ[0] == null) sizeZ[0] = Double.NaN;
}

public void getPixelsTimeIncrement(Double[] sizeT) {
int imageIndex = r.getSeries();
MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore();
sizeT[0] = retrieve.getPixelsTimeIncrement(imageIndex).value(UNITS.SECOND).doubleValue();
if (sizeT[0] == null) sizeT[0] = new Double(Double.NaN);
if (sizeT[0] == null) sizeT[0] = Double.NaN;
}

// -- PlugIn API methods --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ else if (FormatTools.isSigned(originalType)) {
String lsid = MetadataTools.createLSID("Channel", 0, c);
store.setChannelID(lsid, 0, c);
}
store.setChannelSamplesPerPixel(new PositiveInteger(channels), 0, 0);
store.setChannelSamplesPerPixel(new PositiveInteger(channels), 0, c);

if (imp instanceof CompositeImage) {
luts[c] = ((CompositeImage) imp).getChannelLut(c + 1);
Expand All @@ -517,7 +517,7 @@ else if (FormatTools.isSigned(originalType)) {
store.setPixelsPhysicalSizeX(FormatTools.getPhysicalSizeX(cal.pixelWidth, cal.getXUnit()), 0);
store.setPixelsPhysicalSizeY(FormatTools.getPhysicalSizeY(cal.pixelHeight, cal.getYUnit()), 0);
store.setPixelsPhysicalSizeZ(FormatTools.getPhysicalSizeZ(cal.pixelDepth, cal.getZUnit()), 0);
store.setPixelsTimeIncrement(FormatTools.getTime(new Double(cal.frameInterval), cal.getTimeUnit()), 0);
store.setPixelsTimeIncrement(FormatTools.getTime(Double.valueOf(cal.frameInterval), cal.getTimeUnit()), 0);

if (imp.getImageStackSize() !=
imp.getNChannels() * imp.getNSlices() * imp.getNFrames())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@ private static void storePoint(PointRoi roi, MetadataStore store,
private static void storeLine(Line roi, MetadataStore store,
int roiNum, int shape, int c, int z, int t)
{
store.setLineX1(new Double(roi.x1), roiNum, shape);
store.setLineX2(new Double(roi.x2), roiNum, shape);
store.setLineY1(new Double(roi.y1), roiNum, shape);
store.setLineY2(new Double(roi.y2), roiNum, shape);
store.setLineX1(Double.valueOf(roi.x1), roiNum, shape);
store.setLineX2(Double.valueOf(roi.x2), roiNum, shape);
store.setLineY1(Double.valueOf(roi.y1), roiNum, shape);
store.setLineY2(Double.valueOf(roi.y2), roiNum, shape);
if (c >= 0) {
store.setLineTheC(unwrap(c), roiNum, shape);
}
Expand Down Expand Up @@ -787,10 +787,10 @@ private static void storeRectangle(Roi roi, MetadataStore store,
int roiNum, int shape, int c, int z, int t)
{
Rectangle bounds = roi.getBounds();
store.setRectangleX(new Double(bounds.x), roiNum, shape);
store.setRectangleY(new Double(bounds.y), roiNum, shape);
store.setRectangleWidth(new Double(bounds.width), roiNum, shape);
store.setRectangleHeight(new Double(bounds.height), roiNum, shape);
store.setRectangleX(Double.valueOf(bounds.x), roiNum, shape);
store.setRectangleY(Double.valueOf(bounds.y), roiNum, shape);
store.setRectangleWidth(Double.valueOf(bounds.width), roiNum, shape);
store.setRectangleHeight(Double.valueOf(bounds.height), roiNum, shape);
if (c >= 0) {
store.setRectangleTheC(unwrap(c), roiNum, shape);
}
Expand Down
Loading

0 comments on commit 53a7a99

Please sign in to comment.