use of ubic.gemma.web.image.aba.ImageValueObject in project Gemma by PavlidisLab.
the class GeneController method loadAllenBrainImages.
/**
* AJAX NOTE: this method updates the value object passed in
*/
public Collection<ImageValueObject> loadAllenBrainImages(Long geneId) {
Collection<ImageValueObject> images = new ArrayList<>();
GeneValueObject gene = geneService.loadValueObjectById(geneId);
String queryGeneSymbol = gene.getOfficialSymbol();
GeneValueObject mouseGene = gene;
boolean usingHomologue = false;
if (!gene.getTaxonCommonName().equals("mouse")) {
mouseGene = this.homologeneService.getHomologueValueObject(geneId, "mouse");
usingHomologue = true;
}
if (mouseGene != null) {
Collection<ImageSeries> imageSeries;
try {
imageSeries = allenBrainAtlasService.getRepresentativeSaggitalImages(mouseGene.getOfficialSymbol());
String abaGeneUrl = allenBrainAtlasService.getGeneUrl(mouseGene.getOfficialSymbol());
Collection<Image> representativeImages = allenBrainAtlasService.getImagesFromImageSeries(imageSeries);
images = ImageValueObject.convert2ValueObjects(representativeImages, abaGeneUrl, new GeneValueObject(mouseGene), queryGeneSymbol, usingHomologue);
} catch (IOException e) {
log.warn("Could not get ABA data: " + e);
}
}
return images;
}
Aggregations