Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot tracks in latent space and real space #135

Merged
merged 9 commits into from
Aug 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,43 @@
)
mattersoflight marked this conversation as resolved.
Show resolved Hide resolved
dataset

# %%
# Extract a track from the dataset
all_tracks_FOV = dataset.sel(fov_name="/A/4/0")
a_track_in_FOV = all_tracks_FOV.sel(track_id=23)
# Why is sample dimension ~22000 long after the dataset is sliced by FOV and by track_id?
indices = np.arange(a_track_in_FOV.sizes["sample"])
features_track = a_track_in_FOV["features"]
time_stamp = features_track["t"][indices].astype(str)

px.imshow(
features_track.values[indices],
labels={
"x": "feature",
"y": "t",
"color": "value",
}, # change labels to match our metadata
y=time_stamp,
# show fov_name as y-axis
)
# %%
# normalize individual features.

scaled_features = StandardScaler().fit_transform(features_track.values)
px.imshow(
scaled_features,
labels={
"x": "feature",
"y": "t",
"color": "value",
}, # change labels to match our metadata
y=time_stamp,
# show fov_name as y-axis
)
# Scaled features are centered around 0 with a standard deviation of 1.
# Each feature is individually normalized along the time dimension.


# %%
# load all unprojected features:
features = dataset["features"]
Expand Down
Loading