-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Tall Table Writer and Implement Opinionated Data Retrieval
Have a writer function which allows for tall tables, and make data retrieval from reduced data be through an opinionated method.
- Loading branch information
1 parent
62bbb61
commit 0ebb4ec
Showing
8 changed files
with
221 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
view-simulation-results/src/main/java/org/vcell/N5/reduction/DTO/ReducedData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.vcell.N5.reduction.DTO; | ||
|
||
import org.vcell.N5.reduction.SelectMeasurements; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
|
||
// Per Image, contain all ROI data | ||
// Shape: [time * z][channel * roi] | ||
public class ReducedData { | ||
private final int nChannels; | ||
private final int nSlices; | ||
private final HashMap<SelectMeasurements.AvailableMeasurements, double[][]> dataMap = new HashMap<>(); | ||
|
||
public final ArrayList<SelectMeasurements.AvailableMeasurements> measurements; | ||
public final RangeOfImage rangeOfImage; | ||
public final int nROIs; | ||
public final HashMap<Integer, String> roiNames = new HashMap<>(); | ||
public final HashMap<Integer, String> channelNames = new HashMap<>(); | ||
public final String imageName; | ||
public ReducedData(String imageName, RangeOfImage rangeOfImage, int nROIs, ArrayList<SelectMeasurements.AvailableMeasurements> measurements){ | ||
int nFrames = rangeOfImage.timeEnd - rangeOfImage.timeStart + 1; | ||
nSlices = rangeOfImage.zEnd - rangeOfImage.zStart + 1; | ||
this.measurements = measurements; | ||
this.nChannels = rangeOfImage.getNChannels(); | ||
this.nROIs = nROIs; | ||
this.rangeOfImage = rangeOfImage; | ||
this.imageName = imageName; | ||
|
||
for (SelectMeasurements.AvailableMeasurements measurement: measurements){ | ||
dataMap.put(measurement, new double[nFrames * nSlices][nChannels * nROIs]); | ||
} | ||
} | ||
|
||
public void putDataPoint(double data,int time, int z, int channel, int roi, SelectMeasurements.AvailableMeasurements measurementType){ | ||
dataMap.get(measurementType)[(time * nSlices) + z][(roi * nChannels) + channel] = data; | ||
} | ||
|
||
public double getDataPoint(int time, int z, int channel, int roi, SelectMeasurements.AvailableMeasurements measurementType){ | ||
return dataMap.get(measurementType)[(time * nSlices) + z][(roi * nChannels) + channel]; | ||
} | ||
|
||
public String getWideTableHeader(int r, int c){ | ||
return imageName + ":" + roiNames.get(r) + ":" + channelNames.get(c); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.