public class Dataset
extends Object
The list of images in the dataset can also be sorted following a custom order at the creation of the Dataset.
The list of ImagePlane[] contains in the dataset is available as a public field.
Any modification of this list directly impact the dataset.
For more safety, one can get a copy of the list of images in the dataset, with a custom sorting order using getListOfImagePlanes.
The preferred approach to create a Dataset is to use the corresponding DatasetBuilder.build() method, although new Dataset(datasetBuilder) also works.
The DatasetBuilder acts as an intermediate to carry the Dataset constructor parameters, which include many optional parameters.
It thus uses the Builder pattern recommended in "Effective Java" by Joshua Bloch (Item 2), except that the Builder is here not a subclass of Dataset, which is simpler.
Modifier and Type | Field and Description |
---|---|
ImagePlane[] |
listImages
List of ImagePlanes, no specific order is assumed, unless a sort order was specified in the dataset constructor.
|
Constructor and Description |
---|
Dataset(DatasetBuilder builder)
Construct a finalised Dataset from a pre-configured DatasetBuilder.
This constructor is used by DatasetBuilder.build, which offer more flexibility when defining dimensions filters. |
Dataset(ImagePlane[] listImagePlanes,
Comparator<ImagePlane> sortOrder)
Create a Dataset from a list of ImagePlanes.
|
Dataset(String path,
MetadataParser metadataParser,
FilenameFilter filenameFilter)
Create a dataset from a directory, taking all images in the directory.
|
Modifier and Type | Method and Description |
---|---|
File |
getDirectory()
Return the File object for the directory.
|
String |
getDirectoryName()
Return the name of the directory associated to this dataset.
|
String |
getDirectoryPath()
Return the path to the Dataset directory as a string.
|
ImagePlane |
getImagePlane(int index)
Return the ImagePlane at a given position index (0-based).
|
ImagePlane[] |
getListOfImagePlanes()
Return the list of images in this Dataset.
|
ImagePlane[] |
getListOfImagePlanes(Comparator<ImagePlane> sortOrder)
Return the list of images in this Dataset.
|
int |
getNumberOfChannels()
Return the expected number of channels for each well/subposition of this dataset.
|
int |
getNumberOfExistingImagePlanes()
Return the total number of images planes in the dataset.
|
int |
getNumberOfImageSeries()
Return the number of ImageSeries (hyperstacks) in this dataset.
|
int |
getNumberOfPlanesPerSeries()
Return the expected number of planes per ImageSeries (hyperstack).
|
int |
getNumberOfSubpositions()
Return the expected number of subpositions for each well in this dataset.
|
int |
getNumberOfTimepoints()
Return the expected number of timepoints for each well/subposition of this dataset.
|
int |
getNumberOfWells()
Return the number of unique wells in this dataset.
|
int |
getNumberOfZslices()
Return the expected number of Z-slices for each well/subposition of this dataset.
|
Set<Integer> |
getSetChannels()
Return the set of channels present in this dataset.
|
Set<Integer> |
getSetPlateColumns()
Return the set of plate columns present in this dataset (starting with column 1).
|
Set<Character> |
getSetPlateRows()
Return the set of plate rows present in this dataset.
|
Set<Integer> |
getSetSubpositions()
Return the set of well-subpositions present in this dataset.
|
Set<Integer> |
getSetTimepoints()
Return the set of timepoints present in this dataset.
|
Set<Well> |
getSetWells()
Return the set of wells present in this dataset.
|
Set<Integer> |
getSetZ()
Return the set of Z-slices present in this dataset.
|
Comparator<ImagePlane> |
getSortOrder() |
ImageSeries[] |
groupByImageSeries()
Group images belonging to the same well and subposition into ImageSeries (ie belonging to the same multi-dimensional image-sequence).
|
String |
toString() |
public final ImagePlane[] listImages
getListOfImagePlanes(Comparator)
public Dataset(String path, MetadataParser metadataParser, FilenameFilter filenameFilter) throws InstantiationException, IOException
InstantiationException
IOException
- if directory does not exist or is not a directorypublic Dataset(DatasetBuilder builder) throws InstantiationException
IllegalArgumentException
- if no images match the selected dimensions.InstantiationException
public Dataset(ImagePlane[] listImagePlanes, Comparator<ImagePlane> sortOrder)
sortOrder
- can be nullIllegalArgumentException
- if an empty or 0-length list is passed to the constructor.public String toString()
toString
in class Object
public String getDirectoryName()
public File getDirectory()
public String getDirectoryPath()
public ImagePlane[] getListOfImagePlanes()
public ImagePlane[] getListOfImagePlanes(Comparator<ImagePlane> sortOrder)
sortOrder
- optional order to sort the list of images. Impact only the returned list of images, not the list stored in the Dataset. Can be null.public ImagePlane getImagePlane(int index)
public Set<Well> getSetWells()
public Set<Character> getSetPlateRows()
public Set<Integer> getSetPlateColumns()
public Set<Integer> getSetSubpositions()
public Set<Integer> getSetChannels()
public Set<Integer> getSetZ()
public Set<Integer> getSetTimepoints()
public Comparator<ImagePlane> getSortOrder()
public int getNumberOfExistingImagePlanes()
getNumberOfPlanesPerSeries()
to count potentially missing planes and get the number of planes for the resulting hyperstacks.public int getNumberOfWells()
public int getNumberOfSubpositions()
public int getNumberOfChannels()
public int getNumberOfZslices()
public int getNumberOfTimepoints()
public int getNumberOfImageSeries()
public int getNumberOfPlanesPerSeries()
public ImageSeries[] groupByImageSeries()