diff --git a/src/ui/parcellationRegion/region.base.ts b/src/ui/parcellationRegion/region.base.ts index 04bb45e52c959f54fb446c76ba680606a5a30c5d..cec5a668c416bc6c4012831cb92e3f03635ef671 100644 --- a/src/ui/parcellationRegion/region.base.ts +++ b/src/ui/parcellationRegion/region.base.ts @@ -100,14 +100,22 @@ export class RegionBase { this.parcellationRegions.forEach(pr => { if (JSON.stringify(pr.fullId) === JSON.stringify(this.region.fullId)) { const baseAreaHemisphere = - this.region.name.includes(' - right hemisphere')? 'right' : - this.region.name.includes(' - left hemisphere')? 'left' + this.region.name.includes(' - right hemisphere')? 'Right' : + this.region.name.includes(' - left hemisphere')? 'Left' : null const areaHemisphere = - pr.name.includes(' - right hemisphere')? 'right' - : pr.name.includes(' - left hemisphere')? 'left' + pr.name.includes(' - right hemisphere')? 'Right' + : pr.name.includes(' - left hemisphere')? 'Left' : null + const sameRegionSpace = {template: template, parcellation: parcellation, region: pr} + + if (!baseAreaHemisphere && areaHemisphere) { + this.sameRegionTemplate.push({ + ...sameRegionSpace, + hemisphere: areaHemisphere + }) + } else if (!this.sameRegionTemplate.map(sr => sr.template).includes(template)) { if (!(baseAreaHemisphere && areaHemisphere && baseAreaHemisphere !== areaHemisphere)) { this.sameRegionTemplate.push(sameRegionSpace) @@ -131,7 +139,6 @@ export class RegionBase { }) } - public getAllRegionsFromParcellation = (regions) => { for (const region of regions) { if (region.children && region.children.length) { @@ -142,9 +149,4 @@ export class RegionBase { } } - - - - - } diff --git a/src/ui/parcellationRegion/regionMenu/regionMenu.template.html b/src/ui/parcellationRegion/regionMenu/regionMenu.template.html index 1d41973993ef1356fcd9583cc4032f44013a14ab..fc3758057d2bf6587e2aa027e89a11a9d0255da0 100644 --- a/src/ui/parcellationRegion/regionMenu/regionMenu.template.html +++ b/src/ui/parcellationRegion/regionMenu/regionMenu.template.html @@ -64,10 +64,9 @@ <mat-menu #additionalActions="matMenu" xPosition="before" (click)="$event.stopPropagation()" hasBackdrop="false"> <div> - <button mat-menu-item *ngFor="let sameRegion of sameRegionTemplate; let i = index" (click)="changeView(i)"> - <span> - {{sameRegion.template.name}} - </span> + <button mat-menu-item *ngFor="let sameRegion of sameRegionTemplate; let i = index" (click)="changeView(i)" class="d-flex"> + <span class="overflow-x-hidden text-truncate"> {{sameRegion.template.name}} </span> + <span *ngIf="sameRegion.hemisphere"> - {{sameRegion.hemisphere}}</span> </button> </div> </mat-menu>