Image transforms#
Transforms are common image transformations. They can be chained together using ComposeTransforms. You pass a
Transform instance to a data container CrystData. All transform classes are inherited from the
abstract Transform class. Use forward to apply transform to an image.
Transform#
- class cbclib.Transform[source]#
Abstract transform class.
- contents()#
Return a list of the attributes stored in the container that are initialised.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.
ComposeTransforms#
- class cbclib.ComposeTransforms(transforms)[source]#
Composes several transforms together.
- contents()#
Return a list of the attributes stored in the container that are initialised.
- forward(inp)#
Return a transformed image.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- index_array(ss_idxs, fs_idxs)[source]#
Filter the indices of a frame
(ss_idxs, fs_idxs)according to the composed transform.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.