API reference: Transforms¶
The transform engine and the dataset transform factories.
TransformSequence¶
TransformSequence ¶
Bases: object
invert ¶
Invert points post-transform back into the original coordinate system
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pts_tf
|
array - like
|
Points in the post-transform coordinate system |
required |
as_int
|
bool
|
Return locations as integers, by default False |
False
|
Returns:
| Type | Description |
|---|---|
array - like
|
Points in the original coordinate system |
Source code in standard_transform/base.py
apply_project ¶
Apply transform and extract one dimension (e.g. depth)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
projection
|
str or int
|
Which dimension to project out of the transformed data. One of "x","y", or "z" (or 0,1,2 equivalently). |
required |
pts
|
ndarray or Series
|
Either an n x 3 array or pandas Series object with 3-element arrays as elements. |
required |
as_int
|
bool
|
Return locations as integers, by default False |
False
|
Returns:
| Type | Description |
|---|---|
array
|
N-length array |
Source code in standard_transform/base.py
apply_dataframe ¶
apply_dataframe(
col,
df,
projection=None,
return_array=False,
as_int=False,
) -> "Union[np.ndarray, list]"
Apply transformation on a dataframe position column (or prefix of a split position column).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col
|
str
|
Column name or prefix of a split position column. e.g. |
required |
df
|
DataFrame
|
Dataframe with data |
required |
projection
|
str
|
If specified as 'x', 'y', or 'z' return only one element, by default None. |
None
|
as_int
|
bool
|
If True, cast values to integers, by default False |
False
|
Source code in standard_transform/base.py
apply_skeleton ¶
Apply transformation to a meshparty Skeleton
.. deprecated::
Transforming morphology objects is moving to Ossify
(https://csdashm.com/ossify/), where the transformation is passed to the
object. Use :meth:apply on sk.vertices for coordinate arrays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sk
|
Skeleton
|
Skeleton to transform |
required |
inplace
|
bool
|
If True, transform vertices in place, by default False |
False
|
Returns:
| Type | Description |
|---|---|
Skeleton
|
Skeleton with transformed vertices |
Source code in standard_transform/base.py
apply_meshwork_vertices ¶
Apply transformation to mesh and skeleton vertices of a meshparty Meshwork
.. deprecated::
Transforming morphology objects is moving to Ossify
(https://csdashm.com/ossify/), where the transformation is passed to the
object. Use :meth:apply on coordinate arrays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nrn
|
Meshwork
|
Object to transform |
required |
inplace
|
bool
|
If True, transform vertices in place, by default False |
False
|
Returns:
| Type | Description |
|---|---|
Skeleton
|
Skeleton with transformed vertices |
Source code in standard_transform/base.py
apply_meshwork_annotations ¶
Apply transformations to annotations in a meshwork
.. deprecated::
Transforming morphology objects is moving to Ossify
(https://csdashm.com/ossify/), where the transformation is passed to the
object. Use :meth:apply on coordinate arrays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nrn
|
Meshwork
|
Object to transform |
required |
anno_dict
|
dict
|
Dictionary whose keys are annotation tables in the meshwork and whose values are the columns to transform (string or list of strings) |
required |
inplace
|
bool
|
If True, transform vertices in place, by default False |
False
|
Returns:
| Type | Description |
|---|---|
meshwork
|
Object with transformed annotation positions. |
Source code in standard_transform/base.py
identity_transform¶
identity_transform ¶
Factory functions¶
minnie_transform ¶
Transform for the minnie65 dataset into oriented microns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resolution
|
str or array - like
|
Units of the input points: |
'nm'
|
version
|
str
|
Transform version; by default the latest. See :func: |
None
|
Source code in standard_transform/datasets.py
v1dd_transform ¶
Transform for the v1dd dataset into oriented microns. See :func:minnie_transform.
Version discovery¶
available_versions ¶
List the available transform and streamline versions for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
str
|
Dataset name, one of |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|