Skip to content

Commit

Permalink
MarsOpenN5asImagePlusCommand: set image title to datasetpath
Browse files Browse the repository at this point in the history
  • Loading branch information
karlduderstadt committed Nov 2, 2023
1 parent d2bd994 commit caa5594
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public void run() {
parser.populateMetadata(jsonData, source, source, false);
source.populateImageMetadata();

Dataset dataset = getImage(n5, datasetMeta, source, selectionDialog.isVirtual());
dataset.setSource(rootPath + datasetPath);
Dataset dataset = getImage(n5, datasetMeta, source, datasetPath, selectionDialog.isVirtual());
dataset.setSource(rootPath + (datasetPath.startsWith("/") ? datasetPath.substring(1) : datasetPath));
uiService.show(dataset);
} catch (final IOException e) {
IJ.error("failed to read n5");
Expand All @@ -184,7 +184,7 @@ public void run() {
}

@SuppressWarnings({"rawtypes", "unchecked"})
private <T extends NumericType<T> & NativeType<T>> Dataset getImage(final N5Reader n5, final N5DatasetMetadata datasetMeta, final Metadata metadata, final boolean asVirtual) {
private <T extends NumericType<T> & NativeType<T>> Dataset getImage(final N5Reader n5, final N5DatasetMetadata datasetMeta, final Metadata metadata, final String datasetPath, final boolean asVirtual) {
ExecutorService exec = Executors.newFixedThreadPool(8);

final CachedCellImg imgRaw = N5Utils.open(n5, datasetMeta.getPath());
Expand All @@ -208,7 +208,7 @@ private <T extends NumericType<T> & NativeType<T>> Dataset getImage(final N5Read
img = planarImg;
}

final SCIFIOImgPlus<T> imgPlus = new SCIFIOImgPlus(img, datasetMeta.getName(), axes);
final SCIFIOImgPlus<T> imgPlus = new SCIFIOImgPlus(img, datasetPath.startsWith("/") ? datasetPath.substring(1) : datasetPath, axes);
imgPlus.setMetadata(metadata);
imgPlus.setImageMetadata(metadata.get(0));

Expand Down

0 comments on commit caa5594

Please sign in to comment.