You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get xml file into a format: track_id,t,z,y,x (if not, z, then just id,t,y,x)
example (can optimize this)
Use pandas for saving table as csv
import pandas as pd
#read xml into variable tracks
df = pd.DataFrame.from_dict(tracks).T
#explode trackdata and create a column so each row is the original index value
df = df.explode('trackData').reset_index()
#convert trackData to columns
df[['t', 'x', 'y', 'z']] = pd.DataFrame(df['trackData'].tolist(), index=df.index)
df = df[['index', 't', 'z', 'y', 'x']]
#save as csv without index
df.to_csv('./tracking.csv', index=False)
Read tracking layer into napari (can only be done programmatically)
a = pd.read_csv('tracking.csv',index_col=None)
b = a[['index','t','y','x']]
tracks = np.array(b)
#remember to use scaling when adding tracks so it matches the image scale
viewer.add_tracks(tr, name='tracks',scale=[1,, 0.14499219, 0.14499219]) #(dz,dy,dx)
The text was updated successfully, but these errors were encountered:
Ability to read tracking data so moving cells can be processed..
Potentially use Trackmate to track MIP generated at end of lattice acquisition.
xml file can be generated containing centroids and time
Importing tracks into python
https://forum.image.sc/t/reading-trackmate-xml-file-in-python/59262/4
Info on napari tracks layer:
https://napari.org/stable/howtos/layers/tracks.html
Example code for reading into napari:
Get xml file into a format: track_id,t,z,y,x (if not, z, then just id,t,y,x)
example (can optimize this)
Use pandas for saving table as csv
Read tracking layer into napari (can only be done programmatically)
The text was updated successfully, but these errors were encountered: