diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/BasicDataSetInformation.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/BasicDataSetInformation.java new file mode 100644 index 0000000000000000000000000000000000000000..84e475238305917f81b2015dc3e1b314abde5ed2 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/BasicDataSetInformation.java @@ -0,0 +1,82 @@ +/* + * Copyright 2011 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.dss.etl.dto.api.v1; + +import java.util.Arrays; + +import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; +import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; + +/** + * Basic attributes of a dataset connected to a sample and optionally to one parent dataset. + * + * @author Tomasz Pylak + */ +public class BasicDataSetInformation extends DataSetInformation +{ + private static final long serialVersionUID = IServer.VERSION; + + private String fileFormatTypeCode; + + // marks if a dataset is measured or derived from measured data + private boolean isMeasured = true; + + /** Sets code of the dataset type */ + public void setDatasetTypeCode(String datasetTypeCode) + { + DataSetType dataSetType = new DataSetType(); + dataSetType.setCode(datasetTypeCode); + super.setDataSetType(dataSetType); + } + + /** Mandatory: sets file format code. */ + public void setFileFormatCode(String fileFormatCode) + { + this.fileFormatTypeCode = fileFormatCode; + } + + /** Mandatory: sets attributes of the connected sample */ + public void setSample(String sampleSpaceCode, String sampleCode) + { + super.setSpaceCode(sampleSpaceCode); + super.setSampleCode(sampleCode); + } + + /** attributes of the parent dataset - optional */ + public void setParentDatasetCode(String parentDatasetCode) + { + super.setParentDataSetCodes(Arrays.asList(parentDatasetCode)); + } + + /** marks if a dataset is measured or derived from measured data */ + public void setMeasured(boolean isMeasured) + { + this.isMeasured = isMeasured; + } + + public String getFileFormatTypeCode() + { + return fileFormatTypeCode; + } + + public boolean isMeasured() + { + return isMeasured; + } + +} diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java index 65208142bb29a583eb6cc5b91b3c80f5ce512ff0..3107de89fdcb7382463b3cc8c35583db7b80f40a 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java @@ -20,6 +20,7 @@ public final class Channel extends AbstractHashable private Integer wavelength; + /** Constructs a channel with a specified code and label. */ public Channel(String code, String label) { assert code != null : "code is null"; @@ -48,11 +49,13 @@ public final class Channel extends AbstractHashable return label; } + /** Optional. Sets the description of the channel. */ public void setDescription(String description) { this.description = description; } + /** Optional. Sets the wavelength of the channel. */ public void setWavelength(Integer wavelength) { this.wavelength = wavelength; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ChannelColorComponent.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ChannelColorComponent.java index b270a8d3ce46225a7ee86e62eea7ab603014b0d4..76ed3f99f42ffc6e87d713fc2ca38f856ce151ad 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ChannelColorComponent.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ChannelColorComponent.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1; /** - * Color component of an image which constitutes one channel (if the image consists of all channels - * merged). + * Color component of an image which constitutes one channel. Useful if the image consists of all + * channels merged together. * * @author Tomasz Pylak */ diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageDataSetInformation.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageDataSetInformation.java index ed350b0aadee8331b8a67f4e58bea2fd3a0fc7dd..3d51fa509ffc3af0ed5c667f36a127120cd02a4a 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageDataSetInformation.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageDataSetInformation.java @@ -27,7 +27,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; * * @author Tomasz Pylak */ -public class ImageDataSetInformation extends DataSetInformation +public class ImageDataSetInformation extends BasicDataSetInformation { private static final long serialVersionUID = IServer.VERSION; @@ -77,17 +77,20 @@ public class ImageDataSetInformation extends DataSetInformation // ------ setters + /** Sets location of the tile (a.k.a. filed or side) on the 'well matrix'. */ public void setTileGeometry(int tileRowsNumber, int tileColumnsNumber) { this.tileRowsNumber = tileRowsNumber; this.tileColumnsNumber = tileColumnsNumber; } + /** Sets detailed description of the images in the dataset. */ public void setImages(List<ImageFileInfo> images) { this.images = images; } + /** Sets all channels available in the dataset. */ public void setChannels(List<Channel> channels) { this.channels = channels; @@ -111,8 +114,8 @@ public class ImageDataSetInformation extends DataSetInformation } /** - * Allows to configure various image storage parameters. Set to null if the global configuration - * of the storage processor should be used. + * Allows to configure various image storage parameters. Set to null if the configuration of the + * storage processor should be used. */ public void setImageStorageConfiguraton(ImageStorageConfiguraton imageStorageConfiguratonOrNull) { @@ -130,8 +133,8 @@ public class ImageDataSetInformation extends DataSetInformation @Override public String toString() { - return "[ dataset code = " + getDataSetCode() + ", tile Rows Number: " + tileRowsNumber - + ", tile Columns Number: " + tileColumnsNumber + ", channels: " + return "[ dataset code: " + super.getDataSetCode() + ", tile Rows Number: " + + tileRowsNumber + ", tile Columns Number: " + tileColumnsNumber + ", channels: " + CollectionUtils.abbreviate(channels, -1) + ", images: " + CollectionUtils.abbreviate(images, 20); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java index fa1fcc9a06921754fcfe44c7d8e6d06005cefe0f..7dde8735f4be60b114029b91cda334299bc99f62 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java @@ -54,6 +54,15 @@ public class ImageStorageConfiguraton this.thumbnailsStorageFormatOrNull = thumbnailsStorageFormatOrNull; } + /** + * Convenience method to switch on thumbnails generation with default settings. Overrides the + * results of {@link #setThumbnailsStorageFormat(ThumbnailsStorageFormat)}!. + */ + public void switchOnThumbnailsGeneration() + { + this.thumbnailsStorageFormatOrNull = new ThumbnailsStorageFormat(); + } + public OriginalDataStorageFormat getOriginalDataStorageFormat() { return originalDataStorageFormat; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java index 1fab6f760ac8b47be594afd82c57459ca9cc62cf..75c26090baae1b7274ead73fc53f3faf14bd5fba 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java @@ -37,6 +37,14 @@ public class ThumbnailsStorageFormat private boolean storeCompressed = DEFAULT_COMPRESS_THUMBNAILS; + /** + * Creates empty object which instructs that the thumbnails should be generated with default + * settings. Use setters to change default behaviour (you will probably not have to). + */ + public ThumbnailsStorageFormat() + { + } + public int getMaxWidth() { return maxWidth;