Open carshadi opened 2 years ago
Update: I got it to work by adding the following to https://github.com/saalfeldlab/stitching-spark/blob/e1b6d2e6fa06c5735b2a7b1dd3583d5d5f31f734/src/main/java/org/janelia/dataaccess/googlecloud/GoogleCloudDataProvider.java#L201-L207
@Override
public ImagePlus loadImage( final String link ) throws IOException
{
if ( link.endsWith( ".tif" ) || link.endsWith( ".tiff" ) )
{
if (link.startsWith("gs:"))
{
Path tempPath = null;
ImagePlus imp = null;
try
{
tempPath = Files.createTempFile( null, ".tif");
final GoogleCloudStorageURI googleCloudUri = new GoogleCloudStorageURI( link );
final Blob blob = storage.get( BlobId.of( googleCloudUri.getBucket(), googleCloudUri.getKey() ) );
blob.downloadTo(tempPath);
imp = ImageImporter.openImage(tempPath.toString());
}
finally
{
if ( tempPath != null )
tempPath.toFile().delete();
}
return imp;
}
else
{
return ImageImporter.openImage( link );
}
}
throw new NotImplementedException( "Only TIFF images are supported at the moment" );
}
Please let me know if there are any anticipated issues
Thanks, Cameron
Hi there,
I am trying to run the
ConvertTIFFTilesToN5Spark
step on a Dataproc cluster, where the tiff tiles and json configuration file are both located in a google storage bucket.The issue is that it fails to load the tiff tiles from the bucket. Error:
My
tile_config.json
looks like this (bucket name redacted)My job looks like this
It appears that the
GoogleCloudDataProvider
simply callsIJ.openImage()
on the Tiff path, without downloading the blob to a temporary directory first. Am I correct in assuming that the way I'm running this isn't supported? Or do I just need to format things differently? https://github.com/saalfeldlab/stitching-spark/blob/e118564b283fc2b375303516a78f8f3909bc5d6e/src/main/java/org/janelia/util/ImageImporter.java#L19-L27Thank you!