Skip to content

Commit

Permalink
Align with Export
Browse files Browse the repository at this point in the history
Align the files that depend on the N5 export service to work with its new configuration.
  • Loading branch information
AvocadoMoon committed Nov 7, 2023
1 parent 8592401 commit 3a8b669
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public N5Specs getN5Specs(){
int[] paramScanIndexes = simulationSelector == null ? null : simulationSelector.getselectedParamScanIndexes();
String dataSetName = getJTextFieldDataSetName().getText();

return new N5Specs(simDataID, DataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, dataSetName);
return new N5Specs(DataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, dataSetName);
}

private JLabel lblSeeVcellHelp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer
fileFormat = "NRRD";
break;
case N5:
fileFormat = "N5";
fileFormat = "n5";
break;
// case IMAGEJ:
// fileFormat = "IMAGEJ";
Expand Down Expand Up @@ -314,7 +314,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer
case N5:
n5Exporter.initalizeDataControllers(exportSpecs.getVCDataIdentifier().getDataKey().toString() ,user.getName(), user.getID().toString(), newExportJob.getJobID());
ExportOutput exportOutput = n5Exporter.makeN5Data(outputContext, newExportJob, exportSpecs, fileDataContainerManager);
return makeRemoteN5File(fileFormat, n5Exporter.n5FileNameHash(), exportN5Dir, "s3://", exportOutput, exportSpecs, newExportJob, fileDataContainerManager);
return makeRemoteN5File(fileFormat, n5Exporter.getN5FileNameHash(), exportN5Dir, "s3://", exportOutput, exportSpecs, newExportJob, fileDataContainerManager);
default:
throw new DataAccessException("Unknown export format requested");
}
Expand Down
16 changes: 4 additions & 12 deletions vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

import cbit.vcell.math.MathException;
import cbit.vcell.simdata.VCData;
import org.janelia.saalfeldlab.n5.Bzip2Compression;
import org.janelia.saalfeldlab.n5.Compression;
import org.janelia.saalfeldlab.n5.GzipCompression;
import org.janelia.saalfeldlab.n5.N5FSWriter;
import org.janelia.saalfeldlab.n5.*;
import org.vcell.util.Compare;
import org.vcell.util.DataAccessException;

Expand All @@ -30,7 +27,6 @@
public class N5Specs extends FormatSpecificSpecs implements Serializable {
private final ExportFormat format;
private final ExportConstants.DataType dataType;
private final ExportSpecs.SimNameSimDataID[] simNameSimDataIDs;
private final CompressionLevel compression;

public final String dataSetName;
Expand All @@ -44,16 +40,12 @@ public static enum CompressionLevel{
/**
* TextSpecs constructor comment.
*/
public N5Specs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportConstants.DataType dataType, ExportFormat format, CompressionLevel compressionLevel, String dataSetName) {
public N5Specs(ExportConstants.DataType dataType, ExportFormat format, CompressionLevel compressionLevel, String dataSetName) {
this.format = format;
this.dataType = dataType;
this.simNameSimDataIDs = simNameSimDataIDs;
this.compression = compressionLevel;
this.dataSetName = dataSetName;
}
public ExportSpecs.SimNameSimDataID[] getSimNameSimDataIDs(){
return simNameSimDataIDs;
}
/**
* This method was created in VisualAge.
* @return int
Expand All @@ -72,13 +64,13 @@ public ExportFormat getFormat() {
public Compression getCompression(){
switch (compression){
case RAW:
return null;
return new RawCompression();
case BZIP:
return new Bzip2Compression();
case GZIP:
return new GzipCompression();
default:
return null;
return new RawCompression();
}
}

Expand Down

0 comments on commit 3a8b669

Please sign in to comment.