Skip to content

Commit

Permalink
Fixes ##1194
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Dec 3, 2024
1 parent c74ff7d commit 2636091
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/java/org/embl/mobie/lib/create/ImagesCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import net.imglib2.type.numeric.real.FloatType;
import org.apache.commons.io.FileUtils;
import org.embl.mobie.MoBIE;
import org.embl.mobie.MoBIESettings;
import org.embl.mobie.io.ImageDataFormat;
import org.embl.mobie.io.ImageDataOpener;
import org.embl.mobie.io.OMEZarrWriter;
Expand Down Expand Up @@ -372,7 +373,7 @@ private void addDefaultTableForImage ( String imageName, String datasetName ) {
// xml file or zarr file, depending on imageDataFormat
String filePath = getDefaultLocalImagePath( datasetName, imageName );
ImageDataFormat imageDataFormat = ImageDataFormat.fromPath( filePath );
imageDataFormat.setS3SecretAndAccessKey( MoBIE.getInstance().getSettings().values.getS3AccessAndSecretKey() );
addS3keys( imageDataFormat );
ImageData< ? > imageData = ImageDataOpener.open(
filePath,
imageDataFormat,
Expand Down Expand Up @@ -414,6 +415,20 @@ private void addDefaultTableForImage ( String imageName, String datasetName ) {
}
}

private static void addS3keys( ImageDataFormat imageDataFormat )
{
MoBIE instance = MoBIE.getInstance();
if ( instance != null )
{
MoBIESettings settings = instance.getSettings();
if ( settings != null )
{
String[] s3AccessAndSecretKey = settings.values.getS3AccessAndSecretKey();
imageDataFormat.setS3SecretAndAccessKey( s3AccessAndSecretKey );
}
}
}


private void updateTableAndJsonsForNewImage ( String imageName,
File imageFile,
Expand Down

0 comments on commit 2636091

Please sign in to comment.