Skip to content

Commit

Permalink
Merge pull request #1357 from virtualcell/improve-n5-experience
Browse files Browse the repository at this point in the history
Improve n5 experience
  • Loading branch information
AvocadoMoon authored Sep 24, 2024
2 parents aa528ca + d2a6b0b commit 3fe68ce
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,10 @@ private static void updateExportMetaData(final ExportEvent exportEvent){
humanReadableExportData.differentParameterValues,
humanReadableExportData.serverSavedFileName,
humanReadableExportData.applicationType,
humanReadableExportData.nonSpatial
humanReadableExportData.nonSpatial,
humanReadableExportData.zSlices,
humanReadableExportData.tSlices,
humanReadableExportData.numChannels
);

formatData.simulationDataMap.put(stringJobID, simulationExportDataRepresentation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ public static class SimulationExportDataRepresentation {
public String savedFileName;
public String applicationType;
public boolean nonSpatial;
public int zSlices;
public int tSlices;
public int numVariables;

public SimulationExportDataRepresentation(String exportDate, String uri, String jobID, String dataID, String simulationName,
String applicationName, String biomodelName, String variables, String startAndEndTime,
ArrayList<String> differentParameterValues,
String savedFileName, String applicationType, boolean nonSpatial){
String savedFileName, String applicationType, boolean nonSpatial, int zSlices, int tSlices,
int numVariables){
this.exportDate = exportDate;
this.uri = uri;
this.jobID = jobID;
Expand All @@ -56,6 +60,9 @@ public SimulationExportDataRepresentation(String exportDate, String uri, String
this.savedFileName = savedFileName;
this.applicationType = applicationType;
this.nonSpatial = nonSpatial;
this.zSlices = zSlices;
this.tSlices = tSlices;
this.numVariables = numVariables;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2252,12 +2252,18 @@ private void updateChoiceVariableType(PDEDataContext pdeDataContext){
TreeSet<String> dataIdentifierTreeSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);

DataIdentifier[] dataIDArr = pdeDataContext.getDataIdentifiers();
boolean onlyPostProcessingVariables = true;
for (DataIdentifier dataIdentifier : dataIDArr) {
VariableType variableType = dataIdentifier.getVariableType();
onlyPostProcessingVariables = onlyPostProcessingVariables && variableType.equals(VariableType.POSTPROCESSING);
}
for (int i = 0; i < dataIDArr.length; i++) {
VariableType variableType = dataIDArr[i].getVariableType();

String varListName = dataIDArr[i].getName();//"("+vmPrefix+") "+dataIDArr[i].getName();
boolean allowedVolumeExport = variableType.equals(VariableType.VOLUME) ||
(variableType.equals(VariableType.POSTPROCESSING) && !getSelectedFormat().equals(ExportFormat.N5));
(variableType.equals(VariableType.POSTPROCESSING) && !getSelectedFormat().equals(ExportFormat.N5)) ||
(onlyPostProcessingVariables);
if(getBothVarRadioButton().isSelected()){
dataIdentifierTreeSet.add(varListName);
}else if(getVolVarRadioButton().isSelected() && allowedVolumeExport){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class HumanReadableExportData implements Serializable {
public String serverSavedFileName;
public boolean nonSpatial;
public HashMap<Integer, String> subVolume;
public int zSlices;
public int tSlices;
public int numChannels;
public HumanReadableExportData(String simulationName, String applicationName, String biomodelName,
ArrayList<String> differentParameterValues,
String serverSavedFileName, String applicationType, boolean nonSpatial, HashMap<Integer, String> subVolume){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ private ExportOutput exportToN5(OutputContext outputContext, long jobID, N5Specs
timeLoops += 1;
}
n5FSWriter.close();
exportSpecs.getHumanReadableExportData().numChannels = (int) dimensions[2];
exportSpecs.getHumanReadableExportData().zSlices = (int) dimensions[3];
exportSpecs.getHumanReadableExportData().tSlices = (int) dimensions[4];
ExportOutput exportOutput = new ExportOutput(true, "." + N5Specs.n5Suffix, vcDataID.getID(), getN5FileNameHash(), fileDataContainerManager);
return exportOutput;
}
Expand Down

0 comments on commit 3fe68ce

Please sign in to comment.