Skip to content
Snippets Groups Projects
Commit 9a353737 authored by tpylak's avatar tpylak
Browse files

LMS-1645 dynamix: fix and refactor WellContentDialog, fix sql, rename...

LMS-1645 dynamix: fix and refactor WellContentDialog, fix sql, rename ChannelStackImageReference -> ImageChannelStackReference

SVN: 17476
parent a42c9cda
No related branches found
No related tags found
No related merge requests found
Showing
with 472 additions and 356 deletions
...@@ -122,7 +122,11 @@ abstract class AbstractImagesDownloadServlet extends AbstractDatasetDownloadServ ...@@ -122,7 +122,11 @@ abstract class AbstractImagesDownloadServlet extends AbstractDatasetDownloadServ
private static Integer tryGetIntParam(HttpServletRequest request, String paramName) private static Integer tryGetIntParam(HttpServletRequest request, String paramName)
{ {
String value = getParam(request, paramName); String value = request.getParameter(paramName);
if (value == null)
{
return null;
}
try try
{ {
return Integer.valueOf(value); return Integer.valueOf(value);
......
...@@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; ...@@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
...@@ -103,7 +103,7 @@ public interface IScreeningClientService extends IClientService ...@@ -103,7 +103,7 @@ public interface IScreeningClientService extends IClientService
throws UserFailureException; throws UserFailureException;
/** Lists all images for a given well in the given dataset */ /** Lists all images for a given well in the given dataset */
public List<ChannelStackImageReference> listImageChannelStacks(String datasetCode, public List<ImageChannelStackReference> listImageChannelStacks(String datasetCode,
String datastoreCode, WellLocation wellLocation); String datastoreCode, WellLocation wellLocation);
/** /**
......
...@@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; ...@@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
...@@ -92,7 +92,7 @@ public interface IScreeningClientServiceAsync extends IClientServiceAsync ...@@ -92,7 +92,7 @@ public interface IScreeningClientServiceAsync extends IClientServiceAsync
*/ */
public void listImageChannelStacks(String datasetCode, String datastoreCode, public void listImageChannelStacks(String datasetCode, String datastoreCode,
WellLocation wellLocation, WellLocation wellLocation,
AsyncCallback<List<ChannelStackImageReference>> abstractAsyncCallback); AsyncCallback<List<ImageChannelStackReference>> abstractAsyncCallback);
/** /**
* @see IScreeningClientService#registerLibrary(LibraryRegistrationInfo) * @see IScreeningClientService#registerLibrary(LibraryRegistrationInfo)
......
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.renderers.SimpleImageHtmlRenderer;
import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ScreeningConstants;
/**
* Generates URLs pointing to the images on Data Store server.
*
* @author Tomasz Pylak
*/
public class ImageUrlUtils
{
/**
* Creates a widget which displays the URL to the specified image on DSS and adds it to the
* container.
*/
public static void addImageUrlWidget(LayoutContainer container, String sessionId,
WellImages images, String channel, int row, int col, int imageWidth, int imageHeight)
{
String imageURL =
createDatastoreImageUrl(sessionId, images, channel, row, col, imageWidth,
imageHeight);
addUrlWidget(container, imageURL, imageHeight);
}
/**
* Creates a widget which displays the URL to the specified image on DSS and adds it to the
* container.
*/
public static void addImageUrlWidget(LayoutContainer container, String sessionId,
WellImages images, String channel, ImageChannelStackReference channelStackRef,
int imageWidth, int imageHeight)
{
String imageURL =
createDatastoreImageUrl(sessionId, images, channel, channelStackRef, imageWidth,
imageHeight);
addUrlWidget(container, imageURL, imageHeight);
}
/** generates URL of an image on Data Store server */
private static String createDatastoreImageUrl(String sessionID, WellImages images,
String channel, ImageChannelStackReference channelStackRef, int width, int height)
{
URLMethodWithParameters methodWithParameters =
createBasicImageURL(sessionID, images, channel);
methodWithParameters
.addParameter("channelStackId", channelStackRef.getChannelStackTechId());
String linkURL = methodWithParameters.toString();
methodWithParameters.addParameter("mode", "thumbnail" + width + "x" + height);
String imageURL = methodWithParameters.toString();
return SimpleImageHtmlRenderer.createEmbededImageHtml(imageURL, linkURL);
}
/** creates a widget which displays the specified URL and adds it to the container */
private static void addUrlWidget(LayoutContainer container, String url, int height)
{
Component tileContent = new Html(url);
tileContent.setHeight("" + height);
PlateStyleSetter.setPointerCursor(tileContent);
container.add(tileContent);
}
/** generates URL of an image on Data Store server */
private static String createDatastoreImageUrl(String sessionID, WellImages images,
String channel, int tileRow, int tileCol, int width, int height)
{
URLMethodWithParameters methodWithParameters =
createBasicImageURL(sessionID, images, channel);
methodWithParameters.addParameter("wellRow", images.getWellLocation().getRow());
methodWithParameters.addParameter("wellCol", images.getWellLocation().getColumn());
methodWithParameters.addParameter("tileRow", tileRow);
methodWithParameters.addParameter("tileCol", tileCol);
String linkURL = methodWithParameters.toString();
methodWithParameters.addParameter("mode", "thumbnail" + width + "x" + height);
String imageURL = methodWithParameters.toString();
return SimpleImageHtmlRenderer.createEmbededImageHtml(imageURL, linkURL);
}
private static URLMethodWithParameters createBasicImageURL(String sessionID, WellImages images,
String channel)
{
URLMethodWithParameters methodWithParameters =
new URLMethodWithParameters(images.getDownloadUrl() + "/"
+ ScreeningConstants.DATASTORE_SCREENING_SERVLET_URL);
methodWithParameters.addParameter("sessionID", sessionID);
methodWithParameters.addParameter("dataset", images.getDatasetCode());
methodWithParameters.addParameter("channel", channel);
if (channel.equals(ScreeningConstants.MERGED_CHANNELS))
{
methodWithParameters.addParameter("mergeChannels", "true");
}
return methodWithParameters;
}
}
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Map.Entry;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SliderEvent;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Slider;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
/**
* Allows to view timepoint images of the well.
*
* @author Tomasz Pylak
*/
class WellContentTimepointsViewer
{
public static LayoutContainer createTilesGrid(String sessionId,
List<ImageChannelStackReference> channelStackImages, WellImages images, String channel,
int imageWidth, int imageHeight)
{
Map<Float, List<ImageChannelStackReference>> channelStackImagesByTimepoint =
groupImagesByTimepoint(channelStackImages);
List<LayoutContainer> frames =
createTimepointFrames(channelStackImagesByTimepoint, images, channel, sessionId,
imageWidth, imageHeight);
Float[] timepoints = channelStackImagesByTimepoint.keySet().toArray(new Float[0]);
return createMoviePlayer(frames, timepoints);
}
private static LayoutContainer createMoviePlayer(final List<LayoutContainer> frames,
final Float[] timepoints)
{
final LayoutContainer mainContainer = new LayoutContainer();
addAll(mainContainer, frames);
final Slider slider = createTimepointsSlider(frames.size() - 1, new Listener<SliderEvent>()
{
public void handleEvent(SliderEvent e)
{
int oldValue = e.getOldValue();
int newValue = e.getNewValue();
frames.get(oldValue).hide();
frames.get(newValue).show();
mainContainer.remove(mainContainer.getItem(0));
mainContainer.insert(new Label(createTimepointLabel(timepoints, newValue)), 0);
mainContainer.layout();
}
});
mainContainer.insert(slider, 0);
mainContainer.insert(new Label(createTimepointLabel(timepoints, 0)), 0);
slider.setValue(0);
return mainContainer;
}
private static List<LayoutContainer> createTimepointFrames(
Map<Float, List<ImageChannelStackReference>> channelStackImagesByTimepoint,
WellImages images, String channel, String sessionId, int imageWidth, int imageHeight)
{
final List<LayoutContainer> frames = new ArrayList<LayoutContainer>();
int counter = 0;
for (Entry<Float, List<ImageChannelStackReference>> entry : channelStackImagesByTimepoint
.entrySet())
{
List<ImageChannelStackReference> imageReferences = entry.getValue();
final LayoutContainer container =
createTilesGridForTimepoint(imageReferences, images, channel, sessionId,
imageWidth, imageHeight);
frames.add(container);
if (counter > 0)
{
container.setVisible(false);
}
counter++;
}
return frames;
}
private static void addAll(LayoutContainer container, List<LayoutContainer> frames)
{
for (LayoutContainer frame : frames)
{
container.add(frame);
}
}
private static LayoutContainer createTilesGridForTimepoint(
List<ImageChannelStackReference> channelStackReferences, WellImages images,
String channel, String sessionId, int imageWidth, int imageHeight)
{
final LayoutContainer container =
new LayoutContainer(new TableLayout(images.getTileColsNum()));
ImageChannelStackReference[/* tileRow */][/* tileCol */] tilesMap =
createTilesMap(channelStackReferences, images);
for (int row = 1; row <= images.getTileRowsNum(); row++)
{
for (int col = 1; col <= images.getTileColsNum(); col++)
{
ImageChannelStackReference stackRef = tilesMap[row - 1][col - 1];
if (stackRef != null)
{
ImageUrlUtils.addImageUrlWidget(container, sessionId, images, channel,
stackRef, imageWidth, imageHeight);
} else
{
addDummyImage(container, imageWidth, imageHeight);
}
}
}
return container;
}
private static ImageChannelStackReference[][] createTilesMap(
List<ImageChannelStackReference> stackReferences, WellImages images)
{
int rows = images.getTileRowsNum();
int cols = images.getTileColsNum();
ImageChannelStackReference[][] map = new ImageChannelStackReference[rows][cols];
for (ImageChannelStackReference stackRef : stackReferences)
{
map[stackRef.getTileRow() - 1][stackRef.getTileCol() - 1] = stackRef;
}
return map;
}
private static void addDummyImage(LayoutContainer container, int imageWidth, int imageHeight)
{
Label dummy = new Label();
dummy.setWidth(imageWidth);
dummy.setHeight(imageHeight);
container.add(dummy);
}
private static String createTimepointLabel(Float[] timepoints, int sequenceNumber)
{
Float timepoint = timepoints[sequenceNumber];
int numberOfSequences = timepoints.length - 1;
return "Timepoint: " + timepoint + "sec (" + sequenceNumber + "/" + numberOfSequences + ")";
}
private static Map<Float, List<ImageChannelStackReference>> groupImagesByTimepoint(
List<ImageChannelStackReference> channelStackImages)
{
Map<Float, List<ImageChannelStackReference>> result =
new TreeMap<Float, List<ImageChannelStackReference>>();
for (ImageChannelStackReference ref : channelStackImages)
{
Float t = ref.tryGetTimepoint();
List<ImageChannelStackReference> imageReferences = result.get(t);
if (imageReferences == null)
{
imageReferences = new ArrayList<ImageChannelStackReference>();
result.put(t, imageReferences);
}
imageReferences.add(ref);
}
return result;
}
private static final Slider createTimepointsSlider(int maxValue, Listener<SliderEvent> listener)
{
final Slider slider = new Slider();
slider.setWidth(230);
slider.setIncrement(1);
slider.setMaxValue(maxValue);
slider.setClickToChange(true);
slider.addListener(Events.Change, listener);
return slider;
}
}
...@@ -57,7 +57,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.BuildAndEnvironmentInfo; ...@@ -57,7 +57,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.BuildAndEnvironmentInfo;
import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService;
import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer; import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer;
import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames; import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
...@@ -283,7 +283,7 @@ public final class ScreeningClientService extends AbstractClientService implemen ...@@ -283,7 +283,7 @@ public final class ScreeningClientService extends AbstractClientService implemen
return server.getVocabulary(sessionToken, ScreeningConstants.PLATE_GEOMETRY); return server.getVocabulary(sessionToken, ScreeningConstants.PLATE_GEOMETRY);
} }
public List<ChannelStackImageReference> listImageChannelStacks(String datasetCode, public List<ImageChannelStackReference> listImageChannelStacks(String datasetCode,
String datastoreCode, WellLocation wellLocation) String datastoreCode, WellLocation wellLocation)
{ {
final String sessionToken = getSessionToken(); final String sessionToken = getSessionToken();
......
...@@ -59,7 +59,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Plate; ...@@ -59,7 +59,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Plate;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellMaterialMapping; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellMaterialMapping;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellReferenceWithDatasets; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellReferenceWithDatasets;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria;
...@@ -148,7 +148,7 @@ public final class ScreeningServer extends AbstractServer<IScreeningServer> impl ...@@ -148,7 +148,7 @@ public final class ScreeningServer extends AbstractServer<IScreeningServer> impl
materialCriteria, true); materialCriteria, true);
} }
public List<ChannelStackImageReference> listImageChannelStacks(String sessionToken, public List<ImageChannelStackReference> listImageChannelStacks(String sessionToken,
String datasetCode, String datastoreCode, WellLocation wellLocation) String datasetCode, String datastoreCode, WellLocation wellLocation)
{ {
Session session = getSession(sessionToken); Session session = getSession(sessionToken);
......
...@@ -42,7 +42,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Plate; ...@@ -42,7 +42,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Plate;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellMaterialMapping; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellMaterialMapping;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellReferenceWithDatasets; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateWellReferenceWithDatasets;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria;
...@@ -96,7 +96,7 @@ final class ScreeningServerLogger extends AbstractServerLogger implements IScree ...@@ -96,7 +96,7 @@ final class ScreeningServerLogger extends AbstractServerLogger implements IScree
return null; return null;
} }
public List<ChannelStackImageReference> listImageChannelStacks(String sessionToken, public List<ImageChannelStackReference> listImageChannelStacks(String sessionToken,
String datasetCode, String datastoreCode, WellLocation wellLocation) String datasetCode, String datastoreCode, WellLocation wellLocation)
{ {
logAccess(sessionToken, "listImageChannelStacks", "dataset(%s) well(%s)", datasetCode, logAccess(sessionToken, "listImageChannelStacks", "dataset(%s) well(%s)", datasetCode,
......
...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTranslator; ...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTranslator;
import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils;
import ch.systemsx.cisd.openbis.plugin.screening.server.IScreeningBusinessObjectFactory; import ch.systemsx.cisd.openbis.plugin.screening.server.IScreeningBusinessObjectFactory;
import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetImagesReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetImagesReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.DatasetReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
...@@ -96,7 +96,7 @@ public class PlateContentLoader ...@@ -96,7 +96,7 @@ public class PlateContentLoader
/** /**
* Loads information about all channels stacks of a given well in a given dataset. * Loads information about all channels stacks of a given well in a given dataset.
*/ */
public static List<ChannelStackImageReference> loadImageChannelStacks(Session session, public static List<ImageChannelStackReference> loadImageChannelStacks(Session session,
IScreeningBusinessObjectFactory businessObjectFactory, String datasetCode, IScreeningBusinessObjectFactory businessObjectFactory, String datasetCode,
String datastoreCode, WellLocation wellLocation) String datastoreCode, WellLocation wellLocation)
{ {
...@@ -325,7 +325,7 @@ public class PlateContentLoader ...@@ -325,7 +325,7 @@ public class PlateContentLoader
.createForContainer(plateId)); .createForContainer(plateId));
} }
private List<ChannelStackImageReference> loadImageChannelStacks(String datasetCode, private List<ImageChannelStackReference> loadImageChannelStacks(String datasetCode,
String datastoreCode, WellLocation wellLocation) String datastoreCode, WellLocation wellLocation)
{ {
IHCSDatasetLoader datasetLoader = IHCSDatasetLoader datasetLoader =
......
...@@ -38,7 +38,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel; ...@@ -38,7 +38,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary;
import ch.systemsx.cisd.openbis.plugin.screening.shared.authorization.PlateMaterialsSearchCriteriaPredicate; import ch.systemsx.cisd.openbis.plugin.screening.shared.authorization.PlateMaterialsSearchCriteriaPredicate;
import ch.systemsx.cisd.openbis.plugin.screening.shared.authorization.WellContentValidator; import ch.systemsx.cisd.openbis.plugin.screening.shared.authorization.WellContentValidator;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateMaterialsSearchCriteria;
...@@ -79,7 +79,7 @@ public interface IScreeningServer extends IServer ...@@ -79,7 +79,7 @@ public interface IScreeningServer extends IServer
@Transactional @Transactional
@RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER)
public List<ChannelStackImageReference> listImageChannelStacks(String sessionToken, public List<ImageChannelStackReference> listImageChannelStacks(String sessionToken,
@AuthorizationGuard(guardClass = DataSetCodePredicate.class) String datasetCode, @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String datasetCode,
String datastoreCode, WellLocation wellLocation); String datastoreCode, WellLocation wellLocation);
......
...@@ -24,8 +24,7 @@ import com.google.gwt.user.client.rpc.IsSerializable; ...@@ -24,8 +24,7 @@ import com.google.gwt.user.client.rpc.IsSerializable;
* *
* @author Tomasz Pylak * @author Tomasz Pylak
*/ */
public class ChannelStackImageReference implements IsSerializable, public class ImageChannelStackReference implements IsSerializable
Comparable<ChannelStackImageReference>
{ {
// technical id in the imaging db // technical id in the imaging db
private long channelStackTechId; private long channelStackTechId;
...@@ -36,11 +35,11 @@ public class ChannelStackImageReference implements IsSerializable, ...@@ -36,11 +35,11 @@ public class ChannelStackImageReference implements IsSerializable,
// GWT only // GWT only
@SuppressWarnings("unused") @SuppressWarnings("unused")
private ChannelStackImageReference() private ImageChannelStackReference()
{ {
} }
public ChannelStackImageReference(long channelStackTechId, int tileRow, int tileCol, public ImageChannelStackReference(long channelStackTechId, int tileRow, int tileCol,
Float tOrNull, Float zOrNull) Float tOrNull, Float zOrNull)
{ {
this.channelStackTechId = channelStackTechId; this.channelStackTechId = channelStackTechId;
...@@ -91,16 +90,4 @@ public class ChannelStackImageReference implements IsSerializable, ...@@ -91,16 +90,4 @@ public class ChannelStackImageReference implements IsSerializable,
return "channelStack=" + channelStackTechId + ", tile[" + tileRow + "," + tileCol + "]" return "channelStack=" + channelStackTechId + ", tile[" + tileRow + "," + tileCol + "]"
+ desc; + desc;
} }
public int compareTo(ChannelStackImageReference other)
{
if (this.tileRow == other.tileRow)
{
return this.tileCol < other.tileCol ? -1 : (this.tileCol == other.tileCol ? 0 : 1);
} else
{
return this.tileRow < other.tileRow ? -1 : 1;
}
}
} }
...@@ -21,7 +21,7 @@ import java.util.Arrays; ...@@ -21,7 +21,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import ch.systemsx.cisd.bds.hcs.Geometry; import ch.systemsx.cisd.bds.hcs.Geometry;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.IImagingQueryDAO; import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.IImagingQueryDAO;
import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.ImgChannelStackDTO; import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.ImgChannelStackDTO;
...@@ -119,7 +119,7 @@ public class HCSDatasetLoader implements IHCSDatasetLoader ...@@ -119,7 +119,7 @@ public class HCSDatasetLoader implements IHCSDatasetLoader
return dataset.getIsMultidimensional(); return dataset.getIsMultidimensional();
} }
public List<ChannelStackImageReference> listImageChannelStacks(WellLocation wellLocation) public List<ImageChannelStackReference> listImageChannelStacks(WellLocation wellLocation)
{ {
int spotYRow = wellLocation.getRow(); int spotYRow = wellLocation.getRow();
int spotXColumn = wellLocation.getColumn(); int spotXColumn = wellLocation.getColumn();
...@@ -128,9 +128,9 @@ public class HCSDatasetLoader implements IHCSDatasetLoader ...@@ -128,9 +128,9 @@ public class HCSDatasetLoader implements IHCSDatasetLoader
return convert(stacks); return convert(stacks);
} }
private static List<ChannelStackImageReference> convert(List<ImgChannelStackDTO> stacks) private static List<ImageChannelStackReference> convert(List<ImgChannelStackDTO> stacks)
{ {
List<ChannelStackImageReference> result = new ArrayList<ChannelStackImageReference>(); List<ImageChannelStackReference> result = new ArrayList<ImageChannelStackReference>();
for (ImgChannelStackDTO stack : stacks) for (ImgChannelStackDTO stack : stacks)
{ {
result.add(convert(stack)); result.add(convert(stack));
...@@ -138,9 +138,9 @@ public class HCSDatasetLoader implements IHCSDatasetLoader ...@@ -138,9 +138,9 @@ public class HCSDatasetLoader implements IHCSDatasetLoader
return result; return result;
} }
private static ChannelStackImageReference convert(ImgChannelStackDTO stack) private static ImageChannelStackReference convert(ImgChannelStackDTO stack)
{ {
return new ChannelStackImageReference(stack.getId(), stack.getRow(), stack.getColumn(), return new ImageChannelStackReference(stack.getId(), stack.getRow(), stack.getColumn(),
stack.getT(), stack.getZ()); stack.getT(), stack.getZ());
} }
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.shared.imaging; ...@@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.shared.imaging;
import java.util.List; import java.util.List;
import ch.systemsx.cisd.bds.hcs.Geometry; import ch.systemsx.cisd.bds.hcs.Geometry;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ChannelStackImageReference; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageChannelStackReference;
import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
/** /**
...@@ -44,5 +44,5 @@ public interface IHCSDatasetLoader ...@@ -44,5 +44,5 @@ public interface IHCSDatasetLoader
/** /**
* Loads information about all channels stacks of a given well. * Loads information about all channels stacks of a given well.
*/ */
List<ChannelStackImageReference> listImageChannelStacks(WellLocation wellLocation); List<ImageChannelStackReference> listImageChannelStacks(WellLocation wellLocation);
} }
\ No newline at end of file
...@@ -98,7 +98,7 @@ public interface IImagingQueryDAO extends TransactionQuery ...@@ -98,7 +98,7 @@ public interface IImagingQueryDAO extends TransactionQuery
@Select("select * from CONTAINERS where ID = ?{1}") @Select("select * from CONTAINERS where ID = ?{1}")
public ImgContainerDTO getContainerById(long containerId); public ImgContainerDTO getContainerById(long containerId);
@Select("select * from CHANNEL_STACKS cs join SPOTS s on s.id = cs.spot_id where " @Select("select cs.* from CHANNEL_STACKS cs join SPOTS s on s.id = cs.spot_id where "
+ "cs.ds_id = ?{1} and s.x = ?{2} and s.y = ?{3}") + "cs.ds_id = ?{1} and s.x = ?{2} and s.y = ?{3}")
public List<ImgChannelStackDTO> listChannelStacks(long datasetId, int spotX, int spotY); public List<ImgChannelStackDTO> listChannelStacks(long datasetId, int spotX, int spotY);
......
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