Skip to content

Commit

Permalink
Merge pull request #110 from melissalinkert/jzarr-switch
Browse files Browse the repository at this point in the history
Update to new jzarr 0.4.2
  • Loading branch information
sbesson authored Nov 16, 2023
2 parents 4d2a79f + 6d6c558 commit 51d15e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: "gradle"
- name: Install libraries
run: |
sudo apt-get install -y libblosc1
Expand Down
10 changes: 2 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,18 @@ repositories {
maven {
url 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/'
}
maven {
url 'https://nexus.senbox.net/nexus/content/groups/public'
}
maven {
url 'https://repo.glencoesoftware.com/repository/jzarr-snapshots'
}
maven {
url 'https://maven.scijava.org/content/groups/public'
}
}

dependencies {
implementation 'net.java.dev.jna:jna:5.10.0'
implementation 'com.bc.zarr:jzarr:0.3.5'
implementation 'dev.zarr:jzarr:0.4.2'
implementation 'info.picocli:picocli:4.2.0'
implementation 'me.tongfei:progressbar:0.9.0'
implementation 'ome:formats-bsd:7.0.0'
implementation 'com.glencoesoftware:bioformats2raw:0.7.0'
implementation 'com.glencoesoftware:bioformats2raw:0.8.0-rc1'
implementation 'org.json:json:20230227'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.4'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.3.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,20 +1150,35 @@ public void convertToPyramid()
throws FormatException, IOException,
InterruptedException, DependencyException
{
for (PyramidSeries s : series) {
convertPyramid(s);
long tileCount = 0;
int[] seriesTileCount = new int[series.size()];
for (int s=0; s<series.size(); s++) {
PyramidSeries ps = series.get(s);
seriesTileCount[s] = 0;
for (int resolution=0; resolution<ps.numberOfResolutions; resolution++) {
ResolutionDescriptor descriptor = ps.resolutions.get(resolution);
int resTiles = descriptor.numberOfTilesY * descriptor.numberOfTilesX;
seriesTileCount[s] += resTiles * ps.planeCount;
}
tileCount += seriesTileCount[s];
}
getProgressListener().notifyStart(series.size(), tileCount);

for (int s=0; s<series.size(); s++) {
convertPyramid(series.get(s), seriesTileCount[s]);
}
StopWatch t0 = new Slf4JStopWatch("writeIFDs");
writeIFDs();
t0.stop();
binaryOnly = null;
}

private void convertPyramid(PyramidSeries s)
private void convertPyramid(PyramidSeries s, int totalTileCount)
throws FormatException, IOException,
InterruptedException, DependencyException
{
getProgressListener().notifySeriesStart(s.index);
getProgressListener().notifySeriesStart(
s.index, s.numberOfResolutions, totalTileCount);

// convert every resolution in the pyramid
s.ifds = new IFDList[s.numberOfResolutions];
Expand All @@ -1185,9 +1200,9 @@ private void convertPyramid(PyramidSeries s)
LOG.info("Converting resolution #{}", resolution);
ResolutionDescriptor descriptor = s.resolutions.get(resolution);
int tileCount = descriptor.numberOfTilesY * descriptor.numberOfTilesX;
int totalTileCount = tileCount * s.planeCount;
int resTileCount = tileCount * s.planeCount;

getProgressListener().notifyResolutionStart(resolution, totalTileCount);
getProgressListener().notifyResolutionStart(resolution, resTileCount);

int plane = 0;
for (int t=0; t<s.t; t++) {
Expand Down

0 comments on commit 51d15e2

Please sign in to comment.