@Platform(include="<nix/MultiTag.hpp>") @Platform(value="linux",link="nix@.1",preload="hdf5@.7") @Platform(value="windows",link="nix",preload={"hdf5","msvcp120","msvcr120","szip","zlib"}) @Namespace(value="nix") public class MultiTag extends EntityWithSources
Besides the DataArray
the tag entities can be considered as the other
core entities of the data model.
They are meant to attach annotations directly to the data and to establish meaningful
links between different kinds of stored data.
Most importantly tags allow the definition of points or regions of interest in data
that is stored in other DataArray
entities. The data array entities the
tag applies to are defined by its property setReferences(List)
.
Further the referenced data is defined by an origin vector called setPositions(DataArray)
and an optional setExtents(DataArray)
vector that defines its size.
Therefore position and extent of a tag, together with the references field
defines a group of points or regions of interest collected from a subset of all
available DataArray
entities.
Further tags have a field called getFeatures(Predicate)
which makes it possible to associate
other data with the tag. Semantically a feature of a tag is some additional data that
contains additional information about the points of hyperslabs defined by the tag.
This could be for example data that represents a stimulus (e.g. an image or a
signal) that was applied in a certain interval during the recording.
Constructor and Description |
---|
MultiTag()
Constructor that creates an uninitialized MultiTag.
|
Modifier and Type | Method and Description |
---|---|
void |
addReference(DataArray reference)
Adds a new DataArray to the list of referenced data.
|
void |
addReference(String nameOrId)
Add a new DataArray to the list of referenced data.
|
void |
addSource(Source source)
Associate a new source with the entity.
|
void |
addSource(String id)
Associate a new source with the entity.
|
Feature |
createFeature(DataArray data,
int linkType)
Create a new feature.
|
Feature |
createFeature(String dataArrayId,
int linkType)
Create a new feature.
|
boolean |
deleteFeature(Feature feature)
Delete a feature from the tag.
|
boolean |
deleteFeature(String nameOrId)
Delete a feature from the tag.
|
void |
forceCreatedAt(Date date)
Sets the creation date to the provided value even if the attribute is set.
|
void |
forceUpdatedAt()
Sets the time of the last update to the current time.
|
Date |
getCreatedAt()
Get the creation date of the multitag.
|
String |
getDefinition()
Getter for the definition of the multitag.
|
DataArray |
getExtents()
Getter for the extents of a tag.
|
Feature |
getFeature(long index)
Retrieves a specific feature from the tag.
|
Feature |
getFeature(String nameOrId)
Retrieves a specific feature from the tag.
|
long |
getFeatureCount()
Returns the number of features in this block.
|
List<Feature> |
getFeatures()
Get all Feature entities contained in the tag.
|
List<Feature> |
getFeatures(java.util.function.Predicate<Feature> filter)
Get all Features of this tag.
|
String |
getId()
Get id of the multitag
|
Section |
getMetadata()
Get metadata associated with this entity.
|
String |
getName()
Getter for the name of the multitag.
|
DataArray |
getPositions()
Getter for the positions of a tag.
|
DataArray |
getReference(long index)
Get a referenced DataArray by its index.
|
DataArray |
getReference(String nameOrId)
Get a referenced DataArray by its name or id.
|
long |
getReferenceCount()
Get the number of DataArray entities that are referenced by the tag.
|
List<DataArray> |
getReferences()
Get all referenced data arrays associated with the tag.
|
List<DataArray> |
getReferences(java.util.function.Predicate<DataArray> filter)
Get referenced data arrays associated with this tag.
|
Source |
getSource(long index)
Retrieves an associated source identified by its index.
|
Source |
getSource(String id)
Returns an associated source identified by its id.
|
long |
getSourceCount()
Get the number of sources associated with this entity.
|
List<Source> |
getSources()
Get all sources associated with this entity.
|
String |
getType()
Getter for the type of the multitag.
|
List<String> |
getUnits()
Gets for the units of the tag.
|
Date |
getUpdatedAt()
Get the date of the last update.
|
boolean |
hasFeature(Feature feature)
Checks if a specific feature exists on the tag.
|
boolean |
hasFeature(String nameOrId)
Checks if a specific feature exists on the tag.
|
boolean |
hasPositions()
Determine whether this DataArray contains positions.
|
boolean |
hasReference(DataArray reference)
Checks if the specified DataArray is referenced by the tag.
|
boolean |
hasReference(String nameOrId)
Checks if the specified DataArray is referenced in this tag.
|
boolean |
hasSource(Source source)
Checks if a specific source is associated with this entity.
|
boolean |
hasSource(String id)
Checks if a specific source is associated with this entity.
|
boolean |
isNone()
Check if entity is null
|
void |
removeExtents()
Deleter for the reference to the extents DataArray.
|
void |
removeMetadata()
Removes metadata associated with the entity.
|
boolean |
removeReference(DataArray reference)
Remove a DataArray from the list of referenced data.
|
boolean |
removeReference(String nameOrId)
Remove a DataArray from the list of referenced data.
|
boolean |
removeSource(Source source)
Remove a source from the list of associated sources.
|
boolean |
removeSource(String id)
Remove a source from the list of associated sources.
|
DataView |
retrieveData(long positionIndex,
long referenceIndex)
Retrieves the data slice tagged by a certain position and extent
of a certain reference.
|
DataView |
retrieveFeatureData(long positionIndex,
long featureIndex)
Retrieves the data stored in a feature related to a certain
position of this tag.
|
void |
setCreatedAt()
Sets the creation time to the current time if the field is not set.
|
void |
setDefinition(String definition)
Setter for the definition of the multitag.
|
void |
setExtents(DataArray extents)
Sets the extents DataArray of the tag.
|
void |
setExtents(String nameOrId)
Setter for the positions of the tag.
|
void |
setMetadata(Section metadata)
Associate the entity with some metadata.
|
void |
setMetadata(String id)
Associate the entity with some metadata.
|
void |
setPositions(DataArray positions)
Setter for the positions of the tag.
|
void |
setPositions(String nameOrId)
Setter for the positions of the tag.
|
void |
setReferences(List<DataArray> references)
Setter for all referenced DataArrays.
|
void |
setSources(List<Source> sources)
Set all sources associations for this entity.
|
void |
setType(String type)
Setter for the type of the multitag.
|
void |
setUnits(List<String> units)
Setter for the units of a tag.
|
void |
setUpdatedAt()
Sets the time of the last update to the current time if the field is not set.
|
String |
toString() |
compareTo
isInitialized
public MultiTag()
Calling any method on an uninitialized MultiTag will throw a RuntimeException
exception.
@Cast(value="bool") public boolean isNone()
ImplContainer
isNone
in class ImplContainer
@Name(value="id") @StdString public String getId()
public Date getCreatedAt()
getCreatedAt
in class Entity
public Date getUpdatedAt()
getUpdatedAt
in class Entity
public void setUpdatedAt()
setUpdatedAt
in class Entity
public void forceUpdatedAt()
forceUpdatedAt
in class Entity
public void setCreatedAt()
setCreatedAt
in class Entity
public void forceCreatedAt(Date date)
forceCreatedAt
in class Entity
date
- The creation date to set.@Name(value="type") public void setType(@StdString String type)
setType
in class NamedEntity
type
- The type of the multitag.@Name(value="type") @StdString public String getType()
getType
in class NamedEntity
@Name(value="name") @StdString public String getName()
getName
in class NamedEntity
public void setDefinition(String definition)
setDefinition
in class NamedEntity
definition
- definition of multitag.public String getDefinition()
getDefinition
in class NamedEntity
@Name(value="metadata") public Section getMetadata()
getMetadata
in class EntityWithMetadata
Section
@Name(value="metadata") public void setMetadata(@Const @ByRef Section metadata)
Calling this method will replace previously stored information.
setMetadata
in class EntityWithMetadata
metadata
- The Section
that should be associated
with this entity.Section
@Name(value="metadata") public void setMetadata(@StdString String id)
Calling this method will replace previously stored information.
setMetadata
in class EntityWithMetadata
id
- The id of the Section
that should be associated
with this entity.Section
public void removeMetadata()
removeMetadata
in class EntityWithMetadata
Section
@Name(value="sourceCount") public long getSourceCount()
getSourceCount
in class EntityWithSources
Source
@Cast(value="bool") public boolean hasSource(@StdString String id)
hasSource
in class EntityWithSources
id
- The source id to check.Source
@Cast(value="bool") public boolean hasSource(@Const @ByRef Source source)
hasSource
in class EntityWithSources
source
- The source to check.Source
public Source getSource(String id)
getSource
in class EntityWithSources
id
- The id of the associated source.Source
public Source getSource(long index)
getSource
in class EntityWithSources
index
- The index of the associated source.Source
public List<Source> getSources()
getSources
in class EntityWithSources
Source
public void setSources(List<Source> sources)
All previously existing associations will be overwritten.
setSources
in class EntityWithSources
sources
- A list with all sources.Source
public void addSource(@StdString String id)
If a source with the given id already is associated with the entity, the call will have no effect.
addSource
in class EntityWithSources
id
- The id of the source.Source
public void addSource(@Const @ByRef Source source)
Calling this method will have no effect if the source is already associated to this entity.
addSource
in class EntityWithSources
source
- The source to add.Source
@Cast(value="bool") public boolean removeSource(@StdString String id)
This method just removes the association between the entity and the source. The source itself will not be deleted from the file.
removeSource
in class EntityWithSources
id
- The id of the source to remove.Source
@Cast(value="bool") public boolean removeSource(@Const @ByRef Source source)
This method just removes the association between the entity and the source. The source itself will not be deleted from the file.
removeSource
in class EntityWithSources
source
- The source to remove.Source
public DataArray getPositions()
The positions of a multi tag are defined in a DataArray. This array has to define a set of origin vectors, each defining a point inside the referenced data or the beginning of a region of interest.
DataArray
@Name(value="positions") public void setPositions(@StdString String nameOrId)
nameOrId
- Name or id of the DataArray that defines the positions for this tag.DataArray
@Name(value="positions") public void setPositions(@Const @ByRef DataArray positions)
positions
- The DataArray containing the positions of the tag.DataArray
@Cast(value="bool") public boolean hasPositions()
public DataArray getExtents()
The extents of a multi tag are defined in an associated DataArray. This array has to define a set of extent vectors, each defining the size of the corresponding region of interest.
DataArray
@Name(value="extents") public void setExtents(@Const @ByRef DataArray extents)
extents
- The DataArray containing the extents of the tag.DataArray
@Name(value="extents") public void setExtents(@StdString String nameOrId)
nameOrId
- Name or id of the DataArray that defines the extents of the tag.DataArray
public void removeExtents()
This function only removes the association between the tag and the data array, but does not delete the data array itself.
DataArray
public List<String> getUnits()
The units are applied to all values for position and extent in order to calculate the right position vectors in referenced data arrays.
public void setUnits(List<String> units)
All previously defined units will be replaced by the ones passed to the units parameter.
units
- All units as a list. If null removes the units.@Cast(value="bool") public boolean hasReference(@Const @ByRef DataArray reference)
reference
- The data array to check.DataArray
@Cast(value="bool") public boolean hasReference(@StdString String nameOrId)
nameOrId
- Name or id of the data array to check.DataArray
@Name(value="referenceCount") public long getReferenceCount()
DataArray
public DataArray getReference(String nameOrId)
nameOrId
- Name or id of the data array.DataArray
public DataArray getReference(long index)
index
- The index of the data array.DataArray
public void addReference(@StdString String nameOrId)
nameOrId
- Name or id of the data array.DataArray
public void addReference(@Const @ByRef DataArray reference)
reference
- The DataArray that should be referenced.DataArray
@Cast(value="bool") public boolean removeReference(@StdString String nameOrId)
This function only removes the association between the tag and the data array, but does not delete the data array itself.
nameOrId
- Name or id of the data array.DataArray
@Cast(value="bool") public boolean removeReference(@Const @ByRef DataArray reference)
This function only removes the association between the tag and the data array, but does not delete the data array itself.
reference
- The DataArray to remove.DataArray
public List<DataArray> getReferences()
Always uses filter that accepts all sources.
DataArray
public List<DataArray> getReferences(java.util.function.Predicate<DataArray> filter)
The parameter filter can be used to filter data arrays by various criteria.
filter
- A filter function.DataArray
public void setReferences(List<DataArray> references)
Previously referenced data will be replaced. removed.
references
- All referenced arrays.DataArray
@ByVal public DataView retrieveData(@Cast(value="size_t") long positionIndex, @Cast(value="size_t") long referenceIndex)
positionIndex
- the index of the requested position.referenceIndex
- the index of the requested reference.DataView
@Cast(value="bool") public boolean hasFeature(@StdString String nameOrId)
nameOrId
- Name or id of a feature.Feature
@Cast(value="bool") public boolean hasFeature(@Const @ByRef Feature feature)
feature
- The Feature to check.Feature
@Name(value="featureCount") public long getFeatureCount()
Feature
public Feature getFeature(String nameOrId)
nameOrId
- Name or id of the feature.Feature
public Feature getFeature(long index)
index
- The index of the feature.Feature
public List<Feature> getFeatures()
Feature
public List<Feature> getFeatures(java.util.function.Predicate<Feature> filter)
The parameter filter can be used to filter features by various criteria.
filter
- A filter function.Feature
public Feature createFeature(DataArray data, int linkType)
data
- Data arraylinkType
- The link type of this feature.Feature
public Feature createFeature(String dataArrayId, int linkType)
dataArrayId
- The data array that is part of the new feature.linkType
- The link type of this feature.Feature
@Cast(value="bool") public boolean deleteFeature(@StdString String nameOrId)
nameOrId
- Name or id of the feature to remove.Feature
@Cast(value="bool") public boolean deleteFeature(@Const @ByRef Feature feature)
feature
- The feature to remove.Feature
@ByVal public DataView retrieveFeatureData(@Cast(value="size_t") long positionIndex, @Cast(value="size_t") long featureIndex)
positionIndex
- The index of the requested positionfeatureIndex
- The index of the selected featureDataView
public String toString()
toString
in class org.bytedeco.javacpp.Pointer
Copyright © 2016. All rights reserved.