Skip to content
Snippets Groups Projects
Commit dc046852 authored by fsdavid's avatar fsdavid
Browse files

region exploring hemispheres

parent 06828e9c
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
}
}
}
......@@ -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>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment