sfftkrw.schema Adapters¶
The version-specific APIs which are dynamically imported.
adapter_v0_8_0_dev1¶
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFBiologicalAnnotation(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeBiological annotation
-
as_hff(parent_group, name='biological_annotation', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
description¶ a brief description for this segment
-
external_references¶ the set of external references
-
classmethod
from_hff(parent_group, name='biological_annotation', args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
name¶ the name of this segment
-
number_of_instances¶ the number of instances of this segment
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFBoundingBox(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeDimensions of bounding box
-
as_hff(parent_group, name='bounding_box', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='bounding_box', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
xmax¶ maximum x co-ordinate value
-
xmin¶ minimum x co-ordinate value
-
ymax¶ maximum y co-ordinate value
-
ymin¶ minimum y co-ordinate value
-
zmax¶ maximum z co-ordinate value
-
zmin¶ minimum z co-ordinate value
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFCone(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapeCone shape class
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
bottom_radius¶ cone bottom radius
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
height¶ cone height
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFCuboid(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapeCuboid shape class
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶ alias of
sfftkrw.schema.v0_8_0_dev1.cuboid
-
x¶ length in x
-
y¶ length in y
-
z¶ length in z
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFCylinder(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapeCylinder shape class
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
diameter¶ cylinder diameter
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
height¶ cylinder height
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFEllipsoid(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapeEllipsoid shape class
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶ alias of
sfftkrw.schema.v0_8_0_dev1.ellipsoid
-
x¶ length in x
-
y¶ length in y
-
z¶ length in z
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFEncodedSequence(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeAbstract base class for SFFVertices, SFFNormals and SFFTriangles
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
data_array¶ The data as a
numpy.ndarray
-
classmethod
from_array(data, mode=None, endianness=None)¶ Create a
SFFVerticesobject from a numpy array inferring size and assuming certain defaultsParameters: - data (
numpy.ndarray) – the data as anumpy.ndarrayobject - mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFVerticesobjectReturn type: - data (
-
classmethod
from_bytes(byte_seq, num_items, mode=None, endianness=None)¶ Create a
SFFVerticesobject using a bytes objectParameters: - byte_seq (bytes or unicode) – the data as a base64-encoded sequence; can be bytes or unicode
- num_vertices (int) – the number of vertices contained (for validation)
- mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFVerticesobjectReturn type:
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
num_items_kwarg= None¶ the name of the attribute with the size
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFExternalReference(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexType-
accession¶ the accession for this external reference
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
description¶ a long description of this external reference
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
id¶ this external reference’s ID
-
label¶ a short description of this external reference
-
resource¶ the ontology/archive name
-
url¶ a URL/IRI where data for this external reference may be obtained
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFExternalReferenceList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for external references
-
as_hff(parent_group, name='external_references', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='external_references', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFGlobalExternalReferenceList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for global external references
-
as_hff(parent_group, name='global_external_references', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='global_external_references', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFLattice(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass representing 3D
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
data¶ data provided by a
numpy.ndarray, byte-sequence or unicode string; the dimensions should correspond with those specified in the ‘size’ attribute
-
data_array¶ The data as a
numpy.ndarray
-
endianness¶ endianness; either ‘little’ (default) or ‘big’
-
classmethod
from_array(data, size=None, mode='uint32', endianness='little', start=SFFVolumeIndex(rows=0, cols=0, sections=0))¶ Create a
SFFLatticeobject from a numpy array inferring size and assuming certain defaultsParameters: - data (
numpy.ndarray) – the data as anumpy.ndarrayobject - size (
SFFVolumeStructure) – the size of the lattice as aSFFVolumeStructureobject - start (
SFFVolumeIndex) – the values of the corner voxel - mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFLatticeobjectReturn type: - data (
-
classmethod
from_bytes(byte_seq, size, mode='uint32', endianness='little', start=SFFVolumeIndex(rows=0, cols=0, sections=0))¶ Create a
SFFLatticeobject using a bytes objectParameters: - byte_seq (bytes or unicode) – the data as a base64-encoded, zipped sequence; can be bytes or unicode
- size (
SFFVolumeStructure) – the size of the lattice as aSFFVolumeStructureobject - start (
SFFVolumeIndex) – the values of the corner voxel - mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFLatticeobjectReturn type:
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
id¶ the ID for this lattice (referenced by 3D volumes)
-
mode¶ type of data for each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64
-
size¶ size of the lattice described using a
sfftkrw.schema.adapter.SFFVolumeStructureobject
-
start¶ starting index of the lattices described using a:py:class:sfftkrw.schema.adapter.SFFVolumeIndex object
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFLatticeList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeA container for lattice objects
-
as_hff(parent_group, name='lattice_list', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='lattice_list', args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFMesh(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeSingle mesh
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
id¶ the mesh ID
-
normals¶ a list of normals which correspond to vertices
-
transform_id¶ a transform applied to the mesh
-
triangles¶ a list of triangles; each triangle is represented by a trio of vertex indices
-
vertices¶ a list of vertices
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFMeshList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeMesh list representation
-
as_hff(parent_group, name='mesh_list', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='mesh_list', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFNormals(**kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFEncodedSequenceNormals
-
as_hff(parent_group, name='normals', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
data¶ base64-encoded packed binary data
-
endianness¶ binary packing endianness [default: ‘little’]
-
classmethod
from_hff(parent_group, name='normals', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
gds_type¶
-
mode¶ data type; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64 [default: ‘float32’]
-
num_normals¶ the number of normals contained
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFRGBA(random_colour=False, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeColours
-
alpha¶ alpha (opacity) channel
-
as_hff(parent_group, name='colour', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ Export as JSON
-
blue¶ blue channel
-
classmethod
from_hff(parent_group, name='colour', args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
green¶ green channel
-
red¶ red channel
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSegment(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass that encapsulates segment data
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ Format this segment as JSON
-
biological_annotation¶ the biological annotation for this segment; described using a
sfftkrw.schema.adapter.SFFBiologicalAnnotationobject
-
colour¶ this segments colour; described using a
sfftkrw.schema.adapter.SFFRGBAobject
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶
-
id¶ the ID for this segment; segment IDs begin at 1 with the value of 0 implying the segmentation i.e. all segments are children of the root segment (the segmentation)
-
mesh_list¶ the list of mesh_list (if any) that describe this segment; a
sfftkrw.schema.adapter.SFFMeshListobject
-
parent_id¶ the ID for the segment that contains this segment; defaults to 0 (the whole segmentation)
-
shape_primitive_list¶ the list of shape primitives that describe this segment; a
sfftkrw.schema.adapter.SFFShapePrimitiveListobject
-
three_d_volume¶ the 3D volume (if any) that describes this segment; a
sfftkrw.schema.adapter.SFFThreeDVolumeobject
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSegmentList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for segments
-
as_hff(parent_group, name='segment_list', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='segment_list', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSegmentation(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeAdapter class to make using the output of
generateDSeasier to use-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
bounding_box¶ the bounding box in which the segmentation sits; a
sfftkrw.schema.adapter.SFFBoundingBoxobject
-
clear_annotation(from_id)¶ Clear all annotations from the segment with ID specified
Parameters: from_id – segment ID Returns:
-
copy_annotation(from_id, to_id)¶ Copy annotation across segments
Parameters: - from_id (int/list) – segment ID to get notes from; use -1 for for global notes
- to_id (int/list) – segment ID to copy notes to; use -1 for global notes
-
details¶ any other details about this segmentation (free text)
-
classmethod
from_file(fn, args=None)¶ Instantiate an
SFFSegmentationsobject from a file nameThe file suffix determines how the data is extracted.
Parameters: fn (str) – name of a file hosting an EMDB-SFF-structured segmentation Return seg: the corresponding SFFSegmentationobjectRtype seg: SFFSegmentation
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶
-
global_external_references¶ a list of external references that apply to the whole segmentation (global); a
sfftkrw.schema.adapter.SFFGlobalexternal_referencesobject
-
lattice_list¶ the list of lattices (if any) containing 3D volumes referred to; a
sfftkrw.schema.adapter.SFFLatticeListobject
-
merge_annotation(other_seg, include_colour=False)¶ Merge the annotation from another sff_seg to this one
Parameters: - other_seg (
sfftkrw.SFFSegmentation) – segmentation to get annotations from - include_colour (bool) – copy the colours from the source (useful if you want control over the colours)
- other_seg (
-
name¶ the name of this segmentation
-
primary_descriptor¶ the main type of representation used for this segmentation; can be one of ‘mesh_list’, ‘shape_primitive_list’ or ‘threeDVolume’
-
segment_list¶ the list of annotated segments; a
sfftkrw.schema.adapter.SFFSegmentListobject
-
software_list¶ the list of software tools used to crate this segmentation a
sfftkrw.schema.adapter.SFFSoftwareListobject
-
to_file(*args, **kwargs)¶ Alias for
export()method. Passes all args and kwargs ontoSFFSegmentation.export()
-
transform_list¶ a list of transforms; a
sfftkrw.schema.adapter.SFFTransformListobject
-
version¶ EMDB-SFF version
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShape(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeBase shape class
-
attribute¶ extra attribute information e.g. ‘FOM’
-
id¶ the ID of this shape
-
transform_id¶ the transform applied to this shape to position it in the space
-
classmethod
update_counter(value)¶ Update the index for all subclasses sequentially for sibling classes
This method works alongside the index_in_super class attribute.
The superclass must specify this method to ensure correct sequencing of shared indices.
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapePrimitiveList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for shapes
-
as_hff(parent_group, name='shape_primitive_list', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='shape_primitive_list', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
num_cones¶ The number of cones in this container
-
num_cuboids¶ The number of cuboids in this container
-
num_cylinders¶ The number of cylinders in this container
-
num_ellipsoids¶ The number of ellipsoids in this container
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSoftware(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass definition for specifying software used to create this segmentation
-
name¶ The name of the software used
-
version¶ The version string
-
processing_details¶ Details of how the segmentation was produced
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
id¶ the software ID
-
name the software/programmeu’s name
-
processing_details a description of how the data was processed to produce the segmentation
-
version the version used
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSoftwareList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeList of SFFSoftware objects
-
as_hff(parent_group, name='software_list', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='software_list', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFSubtomogramAverage(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFShapeSubtomogram average class
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
lattice_id¶ the ID of the lattice holding the subtomogram average
-
transform_id¶ the transform applied to this shape to position it in the space
-
value¶ the value at which the contour is defined
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFThreeDVolume(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeClass representing segments described using a 3D volume
-
as_hff(parent_group, name='three_d_volume', args=None)¶ Return an SFFType object given an HDF5 object
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='three_d_volume', args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
lattice_id¶ the ID of the lattice that has the data for this 3D volume
-
transform_id¶ a transform applied to this 3D volume [optional]
-
value¶ the voxel values associated with this 3D volume
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFTransformList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for transforms
-
as_hff(parent_group, name='transform_list', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(parent_group, name='transform_list', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFTransformationMatrix(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeTransformation matrix transform
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
cols¶ the number of columns in this matrix
-
data¶ a string sequence by row of the data in this matrix
-
classmethod
from_array(ndarray, **kwargs)¶ Construct an SFFTransformationMatrix object from a numpy numpy.ndarray array
Parameters: ndarray ( numpy.ndarray) – a numpy arrayReturns: a SFFTransformationMatrixobject
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶ alias of
sfftkrw.schema.v0_8_0_dev1.transformation_matrix_type
-
id¶ an ID for this transform
-
rows¶ the number of rows in this matrix
-
static
stringify(array)¶ Convert a
numpy.ndarrayto a space-separated list of numbers
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFTriangles(**kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFEncodedSequenceTriangles
-
as_hff(parent_group, name='triangles', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
data¶ base64-encoded packed binary data
-
endianness¶ binary packing endianness [default: ‘little’]
-
classmethod
from_hff(parent_group, name='triangles', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
gds_type¶
-
mode¶ data type; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64 [default: ‘float32’]
-
num_triangles¶ the number of triangles contained
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVertices(**kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFEncodedSequenceVertices: neither a list nor an index type but is encoded
Suggests the need for an SFFCodedType which has encoded data with _encode and _decode services/methods.
-
as_hff(parent_group, name='vertices', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
data¶ base64-encoded packed binary data
-
endianness¶ binary packing endianness [default: ‘little’]
-
classmethod
from_hff(parent_group, name='vertices', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
gds_type¶
-
mode¶ data type; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64 [default: ‘float32’]
-
num_vertices¶ the number of vertices contained
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVolume(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeClass for represention 3-space dimension
-
as_hff(parent_group, name=None, args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
cols¶ number of columns
-
classmethod
from_hff(parent_group, name=None, args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
rows¶ number of rows
-
sections¶ number of sections (sets of congruent row-column collections)
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVolumeIndex(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVolumeClass representing volume indices
-
as_hff(parent_group, name='start', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
classmethod
from_hff(parent_group, name='start', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
-
class
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVolumeStructure(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_8_0_dev1.SFFVolume-
as_hff(parent_group, name='size', args=None)¶ Returns the current object as a group in an HDF5 file with the given name
For instances which are subclasses of
base.SFFIndexTypename will be a string version of the index (id). If id is None then we will generate a unique one so as to write the object to file. Therefore, the process of writing to HDF5 could end up looking slightly different from the original if the original had missing indexes for some objects.Parameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the populated parent group
Return type: Group- parent_group (
-
classmethod
from_hff(parent_group, name='size', args=None)¶ Convert HDF5 objects into EMDB-SFF objects It should either return a valid object or raise an
SFFValueErrordue to failed validationParameters: - parent_group (
Group) – an HDF5 Group that will contain the objects in this object - args (
argparse.Namespace) – command line arguments - name (str or None) – the name to be given to this object in the object hierarchy (default: None)
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass- parent_group (
-
voxel_count¶ The number of voxels in this volume
-
adapter_v0_7_0_dev0¶
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFBiologicalAnnotation(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeBiological annotation
-
as_hff(parent_group, name='biologicalAnnotation', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
description¶ a brief description for this segment
-
external_references¶ the set of external references
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
name¶ the name of this segment
-
number_of_instances¶ the number of instances of this segment
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFBoundingBox(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeDimensions of bounding box
-
as_hff(parent_group, name='boundingBox', args=None)¶ Bounding box as HDF5 group
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Bounding box from HDF5 group
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
xmax¶ maximum x co-ordinate value
-
xmin¶ minimum x co-ordinate value
-
ymax¶ maximum y co-ordinate value
-
ymin¶ minimum y co-ordinate value
-
zmax¶ maximum z co-ordinate value
-
zmin¶ minimum z co-ordinate value
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFComplexList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeClass that encapsulates complex
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
ids¶ the list of complex ids
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFComplexesAndMacromolecules(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeComplexes and macromolecules
-
as_hff(parent_group, name='complexesAndMacromolecules', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
complexes¶ a list of complex accessions
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
gds_type¶ alias of
sfftkrw.schema.v0_7_0_dev0.macromoleculesAndComplexesType
-
macromolecules¶ a list of macromolecule accessions
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFCone(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShapeCone shape class
-
bottom_radius¶ cone bottom radius
-
height¶ cone height
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFCuboid(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShapeCuboid shape class
-
gds_type¶ alias of
sfftkrw.schema.v0_7_0_dev0.cuboid
-
x¶ length in x
-
y¶ length in y
-
z¶ length in z
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFCylinder(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShapeCylinder shape class
-
diameter¶ cylinder diameter
-
height¶ cylinder height
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFEllipsoid(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShapeEllipsoid shape class
-
gds_type¶ alias of
sfftkrw.schema.v0_7_0_dev0.ellipsoid
-
x¶ length in x
-
y¶ length in y
-
z¶ length in z
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFExternalReference(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass that encapsulates an external reference
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
description¶ a long description of this external reference
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
id¶ this external reference’s ID
-
label¶ a short description of this external reference
-
other_type¶ a URL/IRI where data for this external reference may be obtained
-
type¶ the ontology/archive name
-
value¶ the accession for this external reference
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFExternalReferenceList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for external references
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFGlobalExternalReferenceList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for global external references
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFLattice(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass representing 3D
-
as_hff(parent_group, name='{}', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
data¶ data provided by a
numpy.ndarray, byte-sequence or unicode string; the dimensions should correspond with those specified in the ‘size’ attribute
-
endianness¶ endianness; either ‘little’ (default) or ‘big’
-
classmethod
from_array(data, size=None, mode='uint32', endianness='little', start=SFFVolumeIndex(cols=0, rows=0, sections=0))¶ Create a
SFFLatticeobject from a numpy array inferring size and assuming certain defaultsParameters: - data (
numpy.ndarray) – the data as anumpy.ndarrayobject - size (
SFFVolumeStructure) – the size of the lattice as aSFFVolumeStructureobject - start (
SFFVolumeIndex) – the values of the corner voxel - mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFLatticeobjectReturn type: - data (
-
classmethod
from_bytes(byte_seq, size, mode='uint32', endianness='little', start=SFFVolumeIndex(cols=0, rows=0, sections=0))¶ Create a
SFFLatticeobject using a bytes objectParameters: - byte_seq (bytes or unicode) – the data as a base64-encoded, zipped sequence; can be bytes or unicode
- size (
SFFVolumeStructure) – the size of the lattice as aSFFVolumeStructureobject - start (
SFFVolumeIndex) – the values of the corner voxel - mode (bytes or str or unicode) – the size of each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64``float32, float64
- endianness (bytes or str or unicode) – byte ordering:
little(default) orbig
Returns: a
SFFLatticeobjectReturn type:
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
id¶ the ID for this lattice (referenced by 3D volumes)
-
mode¶ type of data for each voxel; valid values are: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64
-
size¶ size of the lattice described using a
sfftkrw.schema.adapter.SFFVolumeStructureobject
-
start¶ starting index of the lattices described using a:py:class:sfftkrw.schema.adapter.SFFVolumeIndex object
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFLatticeList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeA container for lattice objects
-
as_hff(parent_group, name='lattices', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFMacromoleculeList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeClass that encapsulates macromolecule
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
ids¶ the list of macromolecule ids
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFMesh(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeSingle mesh
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
num_polygons¶ The number of polygons in this mesh
-
num_vertices¶ The number of vertices in this mesh
-
polygons¶ a list of derived polygons (object of class
sfftkrw.schema.adapter.SFFPolygonList)
-
transform_id¶ a transform applied to the mesh
-
vertices¶ a list of vertices (object of class
sfftkrw.schema.adapter.SFFVertexList)
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFMeshList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeMesh list representation
-
as_hff(parent_group, name='meshes', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFPolygon(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListType,sfftkrw.schema.base.SFFIndexTypeSingle polygon
-
id¶ the ID for this polygon
-
vertices¶ the list of vertices
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFPolygonList(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeList of polygons
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
num_polygons¶ The number of polygons in this list of polygons
-
polygon_ids¶ An iterable over the polygon IDs of the contained polygons
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFRGBA(random_colour=False, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeRGBA colour
-
alpha¶ alpha (opacity) channel
-
as_hff(parent_group, name='colour', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ Export as JSON
-
blue¶ blue channel
-
classmethod
from_hff(hff_data, name='colour', args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
green¶ green channel
-
red¶ red channel
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFSegment(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeClass that encapsulates segment data
-
as_hff(parent_group, name='{}', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ Format this segment as JSON
-
biological_annotation¶ the biological annotation for this segment; described using a
sfftkrw.schema.adapter.SFFBiologicalAnnotationobject
-
colour¶ this segments colour; described using a
sfftkrw.schema.adapter.SFFRGBAobject
-
complexes_and_macromolecules¶ the complexes and macromolecules associated with this segment; described using a
sfftkrw.schema.adapter.SFFComplexesAndMacromoleculesobject
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
classmethod
from_json(data, args=None)¶ Deserialise the given json object into an EMDB-SFF object
Parameters: - data (dict) – the data to be converted into SFF* objects
- args (
argparse.Namespace) – command line arguments
Returns: the corresponding SFF* object
Return type: base.SFFTypesubclass
-
gds_type¶
-
id¶ the ID for this segment; segment IDs begin at 1 with the value of 0 implying the segmentation i.e. all segments are children of the root segment (the segmentation)
-
meshes¶ the list of meshes (if any) that describe this segment; a
sfftkrw.schema.adapter.SFFMeshListobject
-
parent_id¶ the ID for the segment that contains this segment; defaults to 0 (the whole segmentation)
-
shapes¶ the list of shape primitives that describe this segment; a
sfftkrw.schema.adapter.SFFShapePrimitiveListobject
-
volume¶ the 3D volume (if any) that describes this segment; a
sfftkrw.schema.adapter.SFFThreeDVolumeobject
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFSegmentList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for segments
-
as_hff(parent_group, name='segments', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFSegmentation(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeAdapter class to make using the output of
generateDSeasier to use-
as_hff(parent_group, name=None, args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(f, args=None)¶ Render an EMDB-SFF to JSON
Parameters:
-
bounding_box¶ the bounding box in which the segmentation sits; a
sfftkrw.schema.adapter.SFFBoundingBoxobject
-
clear_annotation(from_id)¶ Clear all annotations from the segment with ID specified
Parameters: from_id – segment ID Returns:
-
copy_annotation(from_id, to_id)¶ Copy annotation across segments
Parameters: - from_id (int/list) – segment ID to get notes from; use -1 for for global notes
- to_id (int/list) – segment ID to copy notes to; use -1 for global notes
-
details¶ any other details about this segmentation (free text)
-
classmethod
from_file(fn, args=None)¶ Instantiate an
SFFSegmentationsobject from a file nameThe file suffix determines how the data is extracted.
Parameters: fn (str) – name of a file hosting an EMDB-SFF-structured segmentation Return seg: the corresponding SFFSegmentationobjectRtype seg: SFFSegmentation
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Create an
sfftkrw.schema.adapter.SFFSegmentationobject from HDF5 formatted dataParameters: hff_data ( h5py.File) – an HDF5 File objectReturn sff_seg: an EMDB-SFF segmentation Rtype sff_seg: sfftkrw.schema.adapter.SFFSegmentation
-
classmethod
from_json(json_file, args=None)¶ Create an
sfftkrw.schema.adapter.SFFSegmentationobject from JSON formatted dataParameters: json_file (str) – name of a JSON-formatted file Return sff_seg: an EMDB-SFF segmentation Rtype sff_seg: sfftkrw.schema.adapter.SFFSegmentation
-
gds_type¶
-
global_external_references¶ a list of external references that apply to the whole segmentation (global); a
sfftkrw.schema.adapter.SFFGlobalExternalReferencesobject
-
lattices¶ the list of lattices (if any) containing 3D volumes referred to; a
sfftkrw.schema.adapter.SFFLatticeListobject
-
merge_annotation(other_seg)¶ Merge the annotation from another sff_seg to this one
Parameters: other_seg ( sfftk.schema.SFFSegmentation) – segmentation to get annotations from
-
name¶ the name of this segmentation
-
num_global_external_references¶ The number of global external references
-
primary_descriptor¶ the main type of representation used for this segmentation; can be one of ‘meshList’, ‘shapePrimitiveList’ or ‘threeDVolume’
-
segments¶ the list of annotated segments; a
sfftkrw.schema.adapter.SFFSegmentListobject
-
software¶ the software details used to generate this segmentation a
sfftkrw.schema.adapter.SFFSoftwareobject
-
transforms¶ a list of transforms; a
sfftkrw.schema.adapter.SFFTransformListobject
-
version¶ EMDB-SFF version
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShape(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeBase shape class
-
attribute¶ extra attribute information e.g. ‘FOM’
-
id¶ the ID of this shape
-
transform_id¶ the transform applied to this shape to position it in the space
-
classmethod
update_counter(value)¶ Update the index for all subclasses sequentially for sibling classes
This method works alongside the index_in_super class attribute.
The superclass must specify this method to ensure correct sequencing of shared indices.
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFShapePrimitiveList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for shapes
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
num_cones¶ The number of cones in this container
-
num_cuboids¶ The number of cuboids in this container
-
num_cylinders¶ The number of cylinders in this container
-
num_ellipsoids¶ The number of ellipsoids in this container
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFSoftware(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeClass definition for specifying software used to create this segmentation
-
name¶ The name of the software used
-
version¶ The version string
-
processing_details¶ Details of how the segmentation was produced
-
as_hff(parent_group, name='software', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
as_json(args=None)¶ For all contained classes this method returns a dictionary which will be serialised into JSON. Only at the top level (SFFSegmentation) will the final serialisation be done.
Parameters: args ( argparse.Namespace) – command line argumentsReturns: a set of nested dictionaries Return type: dict
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
name the software/programmeu’s name
-
processing_details a description of how the data was processed to produce the segmentation
-
version the version used
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFThreeDVolume(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeClass representing segments described using a 3D volume
-
as_hff(parent_group, name='volume', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
lattice_id¶ the ID of the lattice that has the data for this 3D volume
-
transform_id¶ a transform applied to this 3D volume [optional]
-
value¶ the voxel values associated with this 3D volume
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFTransformList(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeContainer for transforms
-
as_hff(parent_group, name='transforms', args=None)¶ Return the data of this object as an HDF5 group in the given parent group
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
num_tranformation_matrices¶ The number of
SFFTransformationMatrixobjects in this transform container
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFTransformationMatrix(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeTransformation matrix transform
-
cols¶ the number of columns in this matrix
-
data¶ a string sequence by row of the data in this matrix
-
classmethod
from_array(ndarray, **kwargs)¶ Construct an SFFTransformationMatrix object from a numpy numpy.ndarray array
Parameters: ndarray ( numpy.ndarray) – a numpy arrayReturns: a SFFTransformationMatrixobject
-
gds_type¶ alias of
sfftkrw.schema.v0_7_0_dev0.transformationMatrixType
-
id¶ an ID for this transform
-
rows¶ the number of rows in this matrix
-
static
stringify(array)¶ Convert a
numpy.ndarrayto a space-separated list of numbers
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVertex(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFIndexTypeSingle vertex
-
designation¶ type of vertex (‘surface’ (default) or ‘normal’)
-
id¶ vertex ID; referenced by polygons
-
point¶ The co-ordinates for this vertex
-
x¶ x co-ordinate
-
y¶ y co-ordinate
-
z¶ z co-ordinate
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVertexList(**kwargs)¶ Bases:
sfftkrw.schema.base.SFFListTypeList of vertices
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
num_vertices¶ The number of vertices in this vertex container
-
vertex_ids¶ Iterable of vertex IDs contained in this vertex container
-
classmethod
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVolume(*args, **kwargs)¶ Bases:
sfftkrw.schema.base.SFFTypeClass for represention 3-space dimension
-
cols¶ number of columns
-
classmethod
from_hff(hff_data, name=None, args=None)¶ Return an SFFType object given an HDF5 object
-
rows¶ number of rows
-
sections¶ number of sections (sets of congruent row-column collections)
-
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVolumeIndex(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVolumeClass representing volume indices
-
class
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVolumeStructure(*args, **kwargs)¶ Bases:
sfftkrw.schema.adapter_v0_7_0_dev0.SFFVolume-
voxel_count¶ The number of voxels in this volume
-