diff --git a/src/arcade_collection/convert/convert_to_projection.py b/src/arcade_collection/convert/convert_to_projection.py index 149b20c..0e18a45 100644 --- a/src/arcade_collection/convert/convert_to_projection.py +++ b/src/arcade_collection/convert/convert_to_projection.py @@ -18,6 +18,36 @@ def convert_to_projection( scale: int, colors: dict[str, str], ) -> mpl.figure.Figure: + """ + Convert data to projection figure. + + Parameters + ---------- + series_key + Simulation series key. + locations_tar + Archive of location data. + frame + Frame number. + regions + List of regions. + box + Size of bounding box. + ds + Spatial scaling in um/voxel. + dt + Temporal scaling in hours/tick. + scale + Size of scale bar (in um). + colors + Map of region to colors. + + Returns + ------- + : + Projection figure. + """ + fig = plt.figure(figsize=(10, 10), constrained_layout=True) length, width, height = box @@ -73,6 +103,25 @@ def convert_to_projection( def add_frame_timestamp( ax: mpl.axes.Axes, length: int, width: int, dt: float, frame: int, color: str ) -> None: + """ + Add a frame timestamp to figure axes. + + Parameters + ---------- + ax + Axes object. + length + Length of bounding box. + width + Width of bounding box. + dt + Temporal scaling in hours/tick. + frame + Frame number. + color + Timestamp color. + """ + hours, minutes = divmod(round(frame * dt, 2), 1) timestamp = f"{int(hours):02d}H:{round(minutes*60):02d}M" @@ -90,6 +139,25 @@ def add_frame_timestamp( def add_frame_scalebar( ax: mpl.axes.Axes, length: int, width: int, ds: float, scale: int, color: str ) -> None: + """ + Add a frame scalebar to figure axes. + + Parameters + ---------- + ax + Axes object. + length + Length of bounding box. + width + Width of bounding box. + ds + Spatial scaling in um/voxel. + scale + Size of scale bar (in um). + color + Scalebar color. + """ + scalebar = scale / ds ax.add_patch( diff --git a/src/arcade_collection/convert/convert_to_simularium.py b/src/arcade_collection/convert/convert_to_simularium.py index 6a83998..6c436e0 100644 --- a/src/arcade_collection/convert/convert_to_simularium.py +++ b/src/arcade_collection/convert/convert_to_simularium.py @@ -67,7 +67,7 @@ def convert_to_simularium( height Bounding box height. ds - Spatial scaling in units/um. + Spatial scaling in um/voxel. dt Temporal scaling in hours/tick. colors @@ -150,11 +150,11 @@ def get_meta_data( height Bounding box height. dx - Spatial scaling in the X direction in units/um. + Spatial scaling in the X direction in um/voxel. dy - Spatial scaling in the Y direction in units/um. + Spatial scaling in the Y direction in um/voxel. dz - Spatial scaling in the Z direction in units/um. + Spatial scaling in the Z direction in um/voxel. Returns ------- diff --git a/src/arcade_collection/convert/convert_to_simularium_objects.py b/src/arcade_collection/convert/convert_to_simularium_objects.py index 30865ee..61386cf 100644 --- a/src/arcade_collection/convert/convert_to_simularium_objects.py +++ b/src/arcade_collection/convert/convert_to_simularium_objects.py @@ -36,7 +36,7 @@ def convert_to_simularium_objects( box Size of bounding box. ds - Spatial scaling in units/um. + Spatial scaling in um/voxel. dt Temporal scaling in hours/tick. colors diff --git a/src/arcade_collection/convert/convert_to_simularium_shapes.py b/src/arcade_collection/convert/convert_to_simularium_shapes.py index 8847064..243d5c7 100644 --- a/src/arcade_collection/convert/convert_to_simularium_shapes.py +++ b/src/arcade_collection/convert/convert_to_simularium_shapes.py @@ -64,7 +64,7 @@ def convert_to_simularium_shapes( box Size of bounding box. ds - Spatial scaling in units/um. + Spatial scaling in um/voxel. dt Temporal scaling in hours/tick. colors