Result result = (Result)unmarshaller.unmarshal(f);
ResultTimeSeries timeSeries = result.getResultTimeSeries();
List<ResultState> resultStates = timeSeries.getResultState();
times = new double[resultStates.size()];
for (int i=0; i< resultStates.size(); i++) {
ResultState resultState = (ResultState) resultStates.get(i);
times[i]=resultState.getTimeStamp();
}
//So, get the channels and get a set of cells.
ResultState tempState = (ResultState)resultStates.get(0);
int channelNumbers = tempState.getCell().get(0).getCellProperty().get(0).getChannel().size();
int cellNumbers = tempState.getCell().size();
CellData[] cells = new CellData[cellNumbers];
//Channels...
String[] channelNames = new String[channelNumbers];
for (int i=0; i<channelNumbers; i++) {
channelNames[i]= tempState.getCell().get(0).getCellProperty().get(0).getChannel().get(i).getChannelName();
}
for (int i=0; i< cellNumbers;i++) {
cells[i]= new CellData(channelNames,"bob");
}
//Cells...
for (int i=0; i<resultStates.size();i++) {
tempState = (ResultState)resultStates.get(i);
for (int j=0; j< cellNumbers; j++) {
double[] cytvalue = new double[channelNumbers];
double[] nucvalue = new double[channelNumbers];
for (int k =0; k<channelNumbers;k++) {
cytvalue[k]= tempState.getCell().get(j).getCellularCompartment().get(0).getCellProperty().get(1).getChannel().get(k).getChannelIntensity();
nucvalue[k]= tempState.getCell().get(j).getCellularCompartment().get(1).getCellProperty().get(1).getChannel().get(k).getChannelIntensity();
}
cells[j].addCyt(cytvalue);
cells[j].addNuc(nucvalue);
if (i==resultStates.size()-1) {
cells[j].finalise();