Skip to content

Commit

Permalink
Landmark widget: allow creation of mappings involving prev. used land…
Browse files Browse the repository at this point in the history
…marks

So far landmarks were allowed only to be used once in multiple mappings.
Sometimes it can happen that a single landmark is useful in multiple
mappings. This is possible now.
  • Loading branch information
tomka committed Dec 18, 2024
1 parent 57214d6 commit 6f85489
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
modelClass = CATMAID.transform.AffineModel3D, useReverseMatches = false) {
this.projectId = projectId;
this.skeletons = skeletons;
let seenSourceIds = new Set(), seenTargetIds = new Set();
let seenSourceTargetCombos = new Set();
this.mappings = mappings ? mappings.map(m => [{
id: parseInt(m[0].id, 10),
name: m[0].name
Expand All @@ -737,9 +737,9 @@
name: m[1].name
}])
.reduce((o, m) => {
if (!seenSourceIds.has(m[0].id) && !seenTargetIds.has(m[1].id)) {
seenSourceIds.add(m[0].id);
seenTargetIds.add(m[1].id);
const comboKey = `${m[0].id}-${m[1].id}`;
if (!seenSourceTargetCombos.has(comboKey)) {
seenSourceTargetCombos.add(comboKey);
o.push(m);
}
return o;
Expand Down

0 comments on commit 6f85489

Please sign in to comment.