Skip to content

Commit

Permalink
Rename to ZarrPixelsService
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-allan committed May 2, 2024
1 parent a9ec2fe commit 80fbbee
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.glencoesoftware.omero.ms.core;
package com.glencoesoftware.omero.zarr;

import java.net.URI;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.glencoesoftware.omero.ms.core;
package com.glencoesoftware.omero.zarr;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.glencoesoftware.omero.ms.core;
package com.glencoesoftware.omero.zarr;


import java.io.ByteArrayInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

package com.glencoesoftware.omero.ms.core;
package com.glencoesoftware.omero.zarr;

import java.awt.Dimension;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

package com.glencoesoftware.omero.ms.core;
package com.glencoesoftware.omero.zarr;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -58,10 +58,10 @@
* @author Chris Allan <[email protected]>
*
*/
public class PixelsService extends ome.io.nio.PixelsService {
public class ZarrPixelsService extends ome.io.nio.PixelsService {

private static final org.slf4j.Logger log =
LoggerFactory.getLogger(PixelsService.class);
LoggerFactory.getLogger(ZarrPixelsService.class);

public static final String NGFF_ENTITY_TYPE = "com.glencoesoftware.ngff:multiscales";
public static final long NGFF_ENTITY_ID = 3;
Expand All @@ -85,7 +85,7 @@ public class PixelsService extends ome.io.nio.PixelsService {
/** Array path vs. ZarrArray cache */
private final AsyncLoadingCache<Path, ZarrArray> zarrArrayCache;

public PixelsService(
public ZarrPixelsService(
String path, boolean isReadOnlyRepo, File memoizerDirectory,
long memoizerWait, FilePathResolver resolver, BackOff backOff,
TileSizes sizes, IQuery iQuery,
Expand All @@ -102,10 +102,10 @@ public PixelsService(
this.iQuery = iQuery;
zarrMetadataCache = Caffeine.newBuilder()
.maximumSize(this.zarrCacheSize)
.buildAsync(PixelsService::getZarrMetadata);
.buildAsync(ZarrPixelsService::getZarrMetadata);
zarrArrayCache = Caffeine.newBuilder()
.maximumSize(this.zarrCacheSize)
.buildAsync(PixelsService::getZarrArray);
.buildAsync(ZarrPixelsService::getZarrArray);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import java.util.Properties;
import java.util.Set;

import com.glencoesoftware.omero.ms.core.OmeroAmazonS3ClientFactory;
import com.glencoesoftware.omero.ms.core.OmeroS3FileSystem;
import com.glencoesoftware.omero.ms.core.OmeroS3ReadOnlySeekableByteChannel;
import com.glencoesoftware.omero.zarr.OmeroAmazonS3ClientFactory;
import com.glencoesoftware.omero.zarr.OmeroS3FileSystem;
import com.glencoesoftware.omero.zarr.OmeroS3ReadOnlySeekableByteChannel;
import com.google.common.base.Preconditions;
import com.upplication.s3fs.attribute.S3BasicFileAttributes;

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/blitz/blitz-ZarrPixelBuffer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<alias name="${omero.pixeldata.pixels_service:ZarrPixelsService}" alias="/OMERO/Pixels"/>

<bean name="ZarrPixelsService" class="com.glencoesoftware.omero.ms.core.PixelsService"
<bean name="ZarrPixelsService" class="com.glencoesoftware.omero.zarr.ZarrPixelsService"
parent="filesystem">
<!-- note constructor-args from parent bean -->
<constructor-arg value="${omero.pixeldata.memoizer.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.junit.Before;
import org.junit.Test;

import com.glencoesoftware.omero.zarr.ZarrPixelsService;

import omero.ApiUsageException;
import omero.model.ExternalInfo;
import omero.model.ExternalInfoI;
Expand All @@ -43,7 +45,7 @@

public class PixelsServiceTest {

private PixelsService pixelsService;
private ZarrPixelsService pixelsService;
private String uuid = UUID.randomUUID().toString();
private String imageUri = "/data/ngff/image.zarr";
private String labelUri = imageUri + "/0/labels/" + uuid;
Expand All @@ -58,7 +60,7 @@ public void setUp() throws IOException {
pixelsDir.deleteOnExit();
File memoDir = Files.createTempDirectory("memoizer").toFile();
memoDir.deleteOnExit();
pixelsService = new PixelsService(
pixelsService = new ZarrPixelsService(
pixelsDir.getAbsolutePath(), false, memoDir, 0L, null, null, null, null, 0, 0, 0);
mask = new MaskI();
image = new ImageI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

import picocli.CommandLine;
import com.glencoesoftware.bioformats2raw.Converter;
import com.glencoesoftware.omero.zarr.ZarrPixelsService;
import com.glencoesoftware.omero.zarr.ZarrPixelBuffer;

import loci.formats.FormatTools;
import loci.formats.in.FakeReader;
Expand All @@ -68,10 +70,10 @@ public ZarrPixelBuffer createPixelBuffer(
pixels, path, maxPlaneWidth, maxPlaneHeight,
Caffeine.newBuilder()
.maximumSize(0)
.buildAsync(PixelsService::getZarrMetadata),
.buildAsync(ZarrPixelsService::getZarrMetadata),
Caffeine.newBuilder()
.maximumSize(0)
.buildAsync(PixelsService::getZarrArray)
.buildAsync(ZarrPixelsService::getZarrArray)
);
}

Expand Down

0 comments on commit 80fbbee

Please sign in to comment.