Skip to content

Commit

Permalink
Merge branch 'master' into flatlaf
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
#	src/main/java/org/janelia/saalfeldlab/View.java
  • Loading branch information
axtimwalde committed Sep 3, 2024
2 parents 9c3e5b9 + 4613089 commit be65582
Show file tree
Hide file tree
Showing 16 changed files with 345 additions and 645 deletions.
4 changes: 2 additions & 2 deletions .travis/build.sh → .github/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/travis-build.sh
sh travis-build.sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-build.sh
sh ci-build.sh
3 changes: 3 additions & 0 deletions .github/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh
sh ci-setup-github-actions.sh
32 changes: 32 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on:
push:
branches:
- master
tags:
- "*-[0-9]+.*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
cache: 'maven'
- name: Set up CI environment
run: .github/setup.sh
- name: Execute the build
run: .github/build.sh
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
SIGNING_ASC: ${{ secrets.SIGNING_ASC }}
23 changes: 23 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build PR

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
cache: 'maven'
- name: Set up CI environment
run: .github/setup.sh
- name: Execute the build
run: .github/build.sh
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# n5-utils [![Build Status](https://travis-ci.com/saalfeldlab/n5-utils.svg?branch=master)](https://travis-ci.com/saalfeldlab/n5-utils)
[![Build Status](https://github.com/saalfeldlab/n5-utils/actions/workflows/build-main.yml/badge.svg)](https://github.com/saalfeldlab/n5-utils/actions/workflows/build-main.yml)

# n5-utils

Simple standalone BigDataViewer for multiple N5 (or HDF5) datasets
or mipmap pyramids and also a copy, rechunking, and recompressing
tool for N5 and HDF5.
Expand Down
8 changes: 4 additions & 4 deletions install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="0.0.6-SNAPSHOT"
VERSION="0.0.7-SNAPSHOT"
INSTALL_DIR=${1:-$(pwd)}

echo "Installing into $INSTALL_DIR"
Expand Down Expand Up @@ -48,7 +48,7 @@ echo 'java \' >> n5-view-cosem
echo " -Xmx${MEM}g \\" >> n5-view-cosem
if [[ $(java -version 2>&1 | grep version) =~ 1.8 ]]
then
echo ' -XX:+UseConcMarkSweepGC \' >> n5-view
echo ' -XX:+UseConcMarkSweepGC \' >> n5-view-cosem
fi
echo -n ' -cp $JAR:' >> n5-view-cosem
echo -n $(cat cp.txt) >> n5-view-cosem
Expand All @@ -64,7 +64,7 @@ echo 'java \' >> n5-copy
echo " -Xmx${MEM}g \\" >> n5-copy
if [[ $(java -version 2>&1 | grep version) =~ 1.8 ]]
then
echo ' -XX:+UseConcMarkSweepGC \' >> n5-view
echo ' -XX:+UseConcMarkSweepGC \' >> n5-copy
fi
echo -n ' -cp $JAR:' >> n5-copy
echo -n $(cat cp.txt) >> n5-copy
Expand All @@ -80,7 +80,7 @@ echo 'java \' >> n5-equals
echo " -Xmx${MEM}g \\" >> n5-equals
if [[ $(java -version 2>&1 | grep version) =~ 1.8 ]]
then
echo ' -XX:+UseConcMarkSweepGC \' >> n5-view
echo ' -XX:+UseConcMarkSweepGC \' >> n5-equals
fi
echo -n ' -cp $JAR:' >> n5-equals
echo -n $(cat cp.txt) >> n5-equals
Expand Down
56 changes: 32 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>31.1.0</version>
<version>37.0.0</version>
</parent>

<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-utils</artifactId>
<version>0.0.6-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>

<name>N5 Utils</name>
<description>simple standalone BigDataViewer for multiple N5 (or HDF5) datasets.</description>
<description>simple standalone BigDataViewer for multiple N5 (or HDF5)
datasets.</description>
<url>https://github.com/saalfeldlab/n5-utils</url>
<inceptionYear>2017</inceptionYear>
<organization>
Expand Down Expand Up @@ -105,8 +106,8 @@
<url>https://github.com/saalfeldlab/n5-utils/issues</url>
</issueManagement>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.com/saalfeldlab/n5-utils</url>
<system>GitHub Actions</system>
<url>https://github.com/saalfeldlab/n5-utils/actions</url>
</ciManagement>

<properties>
Expand All @@ -117,27 +118,21 @@
<license.copyrightOwners>Stephan Saalfeld</license.copyrightOwners>

<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

<!-- TODO remove when pom-scijava-base is updated -->
<scijava.jvm.version>8</scijava.jvm.version>
<scijava.jvm.build.version>[1.8.0-101,)</scijava.jvm.build.version>

<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>

<enforcer.skip>true</enforcer.skip>
<bigdataviewer-core.version>10.3.2-SNAPSHOT</bigdataviewer-core.version>
<bigdataviewer-vistools.version>1.0.0-beta-30-SNAPSHOT</bigdataviewer-vistools.version>
<n5.version>2.4.0</n5.version>
<n5-imglib2.version>3.5.1</n5-imglib2.version>
<n5-hdf5.version>1.2.0</n5-hdf5.version>
<n5-aws-s3.version>3.2.0</n5-aws-s3.version>
<n5-blosc.version>1.1.0</n5-blosc.version>
<n5-zarr.version>0.0.6</n5-zarr.version>
<n5.version>3.2.0</n5.version>
<n5-aws-s3.version>4.2.0</n5-aws-s3.version>
<n5-blosc.version>1.1.1</n5-blosc.version>
<n5-google-cloud.version>4.1.0</n5-google-cloud.version>
<n5-hdf5.version>2.2.0</n5-hdf5.version>
<n5-ij.version>4.2.1</n5-ij.version>
<n5-imglib2.version>7.0.0</n5-imglib2.version>
<n5-jpeg.version>0.0.1-beta1</n5-jpeg.version>
<n5-google-cloud>3.3.1</n5-google-cloud>
<ui-behaviour.version>2.0.5</ui-behaviour.version>
<n5-universe.version>1.6.0</n5-universe.version>
<n5-viewer_fiji.version>6.1.1</n5-viewer_fiji.version>
<n5-zarr.version>1.3.4</n5-zarr.version>
<n5-zstandard.version>1.0.2</n5-zstandard.version>
<imagej-legacy.version>1.2.2</imagej-legacy.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -170,6 +165,11 @@
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-hdf5</artifactId>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-algorithm-gpl</artifactId>
</dependency>

<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-aws-s3</artifactId>
Expand Down Expand Up @@ -223,6 +223,14 @@
<artifactId>n5-jpeg</artifactId>
<version>${n5-jpeg.version}</version>
</dependency>
<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-universe</artifactId>
</dependency>
<dependency>
<groupId>cisd</groupId>
<artifactId>jhdf5</artifactId>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
Expand Down
25 changes: 15 additions & 10 deletions src/main/java/org/janelia/saalfeldlab/Copy.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
*/
package org.janelia.saalfeldlab;

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -129,12 +128,12 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.janelia.saalfeldlab.N5Factory.N5Options;
import org.janelia.saalfeldlab.n5.Bzip2Compression;
import org.janelia.saalfeldlab.n5.Compression;
import org.janelia.saalfeldlab.n5.DatasetAttributes;
import org.janelia.saalfeldlab.n5.GzipCompression;
import org.janelia.saalfeldlab.n5.Lz4Compression;
import org.janelia.saalfeldlab.n5.N5Exception;
import org.janelia.saalfeldlab.n5.N5Reader;
import org.janelia.saalfeldlab.n5.N5Writer;
import org.janelia.saalfeldlab.n5.RawCompression;
Expand All @@ -143,6 +142,7 @@
import org.janelia.saalfeldlab.n5.hdf5.N5HDF5Writer;
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
import org.janelia.saalfeldlab.n5.jpeg.JPEGCompression;
import org.janelia.saalfeldlab.n5.universe.N5Factory;

import net.imglib2.RandomAccessibleInterval;
import net.imglib2.type.NativeType;
Expand Down Expand Up @@ -236,7 +236,7 @@ protected void reorderIfNecessary(final long[] array) {
reorder(array);
}

protected <T extends NativeType<T>> void copyDataset(final String datasetName) throws IOException, InterruptedException, ExecutionException {
protected <T extends NativeType<T>> void copyDataset(final String datasetName) throws InterruptedException, ExecutionException {

System.out.println(datasetName);

Expand Down Expand Up @@ -272,8 +272,7 @@ protected <T extends NativeType<T>> void copyDataset(final String datasetName) t
copyAttributes(datasetName);
}

protected void copyAttributes(final String groupName)
throws IOException {
protected void copyAttributes(final String groupName) {

System.out.println(" attributes:");

Expand All @@ -291,14 +290,14 @@ protected void copyAttributes(final String groupName)

try {
n5Writer.setAttribute(groupName, key, n5Reader.getAttribute(groupName, key, clazz));
} catch (final IOException e) {
} catch (final N5Exception e) {
e.printStackTrace(System.err);
}
}
});
}

protected <T extends NativeType<T>> void copyGroup(final String groupName) throws IOException, InterruptedException, ExecutionException {
protected <T extends NativeType<T>> void copyGroup(final String groupName) throws InterruptedException, ExecutionException {

System.out.println(groupName);

Expand All @@ -315,7 +314,7 @@ protected <T extends NativeType<T>> void copyGroup(final String groupName) throw
}

@Override
public Void call() throws IOException, InterruptedException, ExecutionException {
public Void call() throws InterruptedException, ExecutionException {

blockSize = blockSizeString == null ? null : parseCSIntArray(blockSizeString);

Expand Down Expand Up @@ -349,8 +348,14 @@ public Void call() throws IOException, InterruptedException, ExecutionException
}
}

n5Reader = N5Factory.createN5Reader(new N5Options(inputContainerPath, blockSize, compression));
n5Writer = N5Factory.createN5Writer(new N5Options(outputContainerPath, blockSize, compression));
final N5Factory n5Factory = new N5Factory()
.hdf5DefaultBlockSize(blockSize)
.zarrDimensionSeparator(".")
.zarrMapN5Attributes(false)
.zarrMergeAttributes(false);

n5Reader = n5Factory.openReader(inputContainerPath);
n5Writer = n5Factory.openWriter(outputContainerPath);

if (groupNames == null)
copyGroup("");
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/janelia/saalfeldlab/Equals.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@
*/
package org.janelia.saalfeldlab;

import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;

import org.janelia.saalfeldlab.N5Factory.N5Options;
import org.janelia.saalfeldlab.n5.DatasetAttributes;
import org.janelia.saalfeldlab.n5.N5Exception;
import org.janelia.saalfeldlab.n5.N5Reader;
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
import org.janelia.saalfeldlab.n5.universe.N5Factory;

import net.imglib2.Cursor;
import net.imglib2.RandomAccessibleInterval;
Expand Down Expand Up @@ -179,18 +179,18 @@ protected <T extends Type<T>> Boolean datasetEquals() {

return equals;
}
catch (final IOException e) {
catch (final N5Exception e) {

return false;
}
}


@Override
public Boolean call() throws IOException, InterruptedException, ExecutionException {
public Boolean call() throws InterruptedException, ExecutionException {

n5Reader1 = N5Factory.createN5Reader(new N5Options(inputContainerPath1, null, null));
n5Reader2 = N5Factory.createN5Reader(new N5Options(inputContainerPath2, null, null));
n5Reader1 = new N5Factory().openReader(inputContainerPath1);
n5Reader2 = new N5Factory().openReader(inputContainerPath2);

return datasetEquals();
}
Expand Down
Loading

0 comments on commit be65582

Please sign in to comment.