...
 
Commits (2)
import numpy; np=numpy
import pandas; pd=pandas
import pathlib
from xml.etree import cElementTree as ET
def tm_xml_tracks(fn):
......@@ -41,4 +42,34 @@ def imaris_tracks(fn):
data = data.reset_index()
del data["index"]
return data
\ No newline at end of file
return data
def imaris_tracks_custom(in_dir):
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
root = pathlib.Path(in_dir)
all_data = []
trackid = 0
for d in root.glob('**/*'):
if d.is_file() and d.name.endswith(".csv"):
treatment = d.stem.split("_")[-1]
if treatment == "Control": treatment = treatment.lower()
print("Reading file", d.name)
data = imaris_tracks(d.absolute())
data["Group"] = treatment
data["Slice"] = d.stem
for tid in data["TrackID"].unique():
cur_data = data.loc[data["TrackID"] == tid]
cur_data["TrackID"] = trackid
trackid +=1
all_data.append(cur_data)
return pandas.concat(all_data, axis=0)
\ No newline at end of file