Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate improvements #52

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public static class SimulationExportDataRepresentation {
public ArrayList<String> differentParameterValues;
public String savedFileName;

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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.google.gson.GsonBuilder;
import ij.ImagePlus;
import ij.plugin.ContrastEnhancer;
import ij.plugin.frame.ContrastAdjuster;
import net.imglib2.cache.img.CachedCellImg;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.type.numeric.real.DoubleType;
Expand Down Expand Up @@ -134,6 +136,9 @@ public ImagePlus getImgPlusFromN5File() throws IOException {
setUnits(n5AmazonS3Reader, imagePlus);
imagePlus.setProperty("channelInfo", n5AmazonS3Reader.getAttribute(dataSetChosen, "channelInfo", HashMap.class));
imagePlus.setProperty("maskInfo", n5AmazonS3Reader.getAttribute(dataSetChosen, "maskMapping", HashMap.class));
imagePlus.setZ(Math.floorDiv(imagePlus.getNSlices(), 2));

new ContrastEnhancer().stretchHistogram(imagePlus, 1);
return imagePlus;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public class ImageIntoMemory extends EventListenerList implements ActionListener

private static final Logger logger = N5ImageHandler.getLogger(ImageIntoMemory.class);

public ImageIntoMemory(double cDim, double tDim, double zDim, SimResultsLoader simResultsLoader){
public ImageIntoMemory(double cDim, double zDim, double tDim, SimResultsLoader simResultsLoader){
this.simResultsLoader = simResultsLoader;
channelStartTextField = new HintTextField("1");
channelEndTextField = new HintTextField("" + (int) cDim);

timeStartTextField = new HintTextField("1");
timeEndTextField = new HintTextField("" + (int) tDim);

zStartTextField = new HintTextField("1");
zEndTextField = new HintTextField("" + (int) zDim);

timeStartTextField = new HintTextField("1");
timeEndTextField = new HintTextField("" + (int) tDim);

// Create the frame
frame = new JFrame("Select " + simResultsLoader.userSetFileName + " Dimensions");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Expand Down Expand Up @@ -113,8 +113,8 @@ public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(okayButton)){
frame.dispose();

startC = Integer.parseInt(channelStartTextField.getText()) - 1;
endC = Integer.parseInt(channelEndTextField.getText()) - 1;
startC = Integer.parseInt(channelStartTextField.getText());
endC = Integer.parseInt(channelEndTextField.getText());
startT = Integer.parseInt(timeStartTextField.getText()) - 1;
endT = Integer.parseInt(timeEndTextField.getText()) - 1;
startZ = Integer.parseInt(zStartTextField.getText()) - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private JPanel topPanel(){
includeExampleExports.setSelected(!N5ImageHandler.exportedDataExists());

GridBagConstraints gridBagConstraints = new GridBagConstraints();

JPanel topRow = new JPanel(new GridBagLayout());
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
Expand Down Expand Up @@ -271,6 +271,7 @@ private JPanel topPanel(){
monthInterval = new JCheckBox("Past Month");
yearlyInterval = new JCheckBox("Past Year");
anyInterval = new JCheckBox("Any Time");
anyInterval.setSelected(true);

ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(todayInterval);
Expand All @@ -281,10 +282,10 @@ private JPanel topPanel(){
JPanel filters = new JPanel();
filters.setLayout(new BorderLayout());
timeFilter = new JPanel(new GridBagLayout());
timeFilter.add(anyInterval);
timeFilter.add(todayInterval);
timeFilter.add(monthInterval);
timeFilter.add(yearlyInterval);
timeFilter.add(anyInterval);
// timeFilter.setBorder(BorderFactory.createTitledBorder(lowerEtchedBorder, " Time "));
filters.add(timeFilter, BorderLayout.NORTH);
filters.add(includeExampleExports, BorderLayout.SOUTH);
Expand Down Expand Up @@ -490,7 +491,7 @@ static class N5ExportTableModel extends AbstractTableModel {
add("BioModel");
add("Application");
add("Simulation");
add("Time Slice");
add("Channel,Z,Time");
add("Date Exported");
add("N5 File Name");
}};
Expand Down Expand Up @@ -524,8 +525,8 @@ public Object getValueAt(int rowIndex, int columnIndex) {
return data.biomodelName;
} else if (columnIndex == headers.indexOf("Simulation")) {
return data.simulationName;
} else if (columnIndex == headers.indexOf("Time Slice")) {
return data.startAndEndTime;
} else if (columnIndex == headers.indexOf("Channel,Z,Time")) {
return String.format("%s,%s,%s", data.numVariables, data.zSlices, data.tSlices);
} else if (columnIndex == headers.indexOf("Date Exported")) {
return data.exportDate;
} else if (columnIndex == headers.indexOf("N5 File Name")) {
Expand Down
Loading