diff --git a/src/tracker/long_tracker.jl b/src/tracker/long_tracker.jl index 86b944aa..b40f311f 100644 --- a/src/tracker/long_tracker.jl +++ b/src/tracker/long_tracker.jl @@ -22,9 +22,9 @@ Trajectories are built in two steps: - "orientation" - "perimeter" - "mask": 2D array of booleans - - "ID": unique identifier - "passtime": A timestamp for the floe - "psi": the psi-s curve for the floe + - "uuid": a universally unique identifier for each segmented floe - `condition_thresholds`: 3-tuple of thresholds (each a named tuple) for deciding whether to match floe `i` from day `k` to floe j from day `k+1` - `mc_thresholds`: thresholds for area mismatch and psi-s shape correlation diff --git a/src/tracker/tracker-funcs.jl b/src/tracker/tracker-funcs.jl index 093b55f2..a43b13ca 100644 --- a/src/tracker/tracker-funcs.jl +++ b/src/tracker/tracker-funcs.jl @@ -683,3 +683,15 @@ function dropcols!(df, colstodrop) select!(df, Not(colstodrop)) return nothing end + +function adduuid!(df::DataFrame) + df.uuid = [randstring(12) for _ in 1:nrow(df)] + return df +end + +function adduuid!(dfs::Vector{DataFrame}) + for (i, df) in enumerate(dfs) + adduuid!(dfs[i]) + end + return dfs +end \ No newline at end of file diff --git a/src/tracker/tracker.jl b/src/tracker/tracker.jl index 3b7fe6a0..b899c47a 100644 --- a/src/tracker/tracker.jl +++ b/src/tracker/tracker.jl @@ -56,9 +56,7 @@ function _pairfloes( sort_floes_by_area!(props) # Assign a unique ID to each floe in each image - for (i, prop) in enumerate(props) - props[i].uuid = [randstring(12) for _ in 1:nrow(prop)] - end + adduuid!(props) add_passtimes!(props, passtimes)