Skip to content
Snippets Groups Projects
Commit 949377b6 authored by tpylak's avatar tpylak
Browse files

LMS-1555 show analysis results in Well Reviewing Panel: deal with the case...

LMS-1555 show analysis results in Well Reviewing Panel: deal with the case when there is one image dataset with unconnected analysis datasets

SVN: 17883
parent 718d3d63
No related branches found
No related tags found
No related merge requests found
......@@ -363,6 +363,11 @@ public class PlateMaterialLocationsLoader
List<WellContent> clonedWellContents = new ArrayList<WellContent>();
List<ExternalData> featureVectoreDatasets = plateToFeatureVectoreDatasetMap.get(plateId);
List<ExternalData> childlessImageDatasets = plateToChildlessImageDatasetMap.get(plateId);
DatasetImagesReference singleImageDatasetOrNull =
tryGetSingleImageDataset(childlessImageDatasets, imageParams);
boolean singleImageAlreadyUsed = false;
if (featureVectoreDatasets != null)
{
for (ExternalData featureVectoreDataset : featureVectoreDatasets)
......@@ -371,6 +376,14 @@ public class PlateMaterialLocationsLoader
ScreeningUtils.createDatasetReference(featureVectoreDataset);
DatasetImagesReference imagesDatasetReference =
tryGetImageDatasetReference(featureVectoreDataset, imageParams);
if (imagesDatasetReference == null && singleImageDatasetOrNull != null)
{
// If the plate has only one childless image dataset, then we assume that it
// must have been the one which has been analysed. We need such a heuristic
// because some analysis dataset may have no parent dataset assigned.
imagesDatasetReference = singleImageDatasetOrNull;
singleImageAlreadyUsed = true;
}
clonedWellContents.add(wellContent.cloneWithDatasets(imagesDatasetReference,
featureVectoreDatasetReference));
}
......@@ -378,8 +391,7 @@ public class PlateMaterialLocationsLoader
// there can be more than one dataset with images for each well - in such a case we will
// have one well content duplicated for each dataset
List<ExternalData> childlessImageDatasets = plateToChildlessImageDatasetMap.get(plateId);
if (childlessImageDatasets != null)
if (childlessImageDatasets != null && singleImageAlreadyUsed == false)
{
for (ExternalData childlessImageDataset : childlessImageDatasets)
{
......@@ -391,6 +403,19 @@ public class PlateMaterialLocationsLoader
return clonedWellContents;
}
private static DatasetImagesReference tryGetSingleImageDataset(
List<ExternalData> childlessImageDatasets, Map<String, PlateImageParameters> imageParams)
{
if (childlessImageDatasets != null && childlessImageDatasets.size() == 1)
{
ExternalData singleImageDataset = childlessImageDatasets.get(0);
return createDatasetImagesReference(singleImageDataset, imageParams);
} else
{
return null;
}
}
private static DatasetImagesReference tryGetImageDatasetReference(
ExternalData featureVectoreDataset, Map<String, PlateImageParameters> imageParams)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment