Skip to content
Snippets Groups Projects
viewerCmp.template.html 38.2 KiB
Newer Older
Xiao Gui's avatar
Xiao Gui committed
                <i class="sxplr-list-like-button-body-line text-muted">
                  (Not selectable at the moment)
                </i>
Xiao Gui's avatar
Xiao Gui committed
          </ng-template>
        </ng-template>
        
      </ng-container>

      <ng-container *ngSwitchDefault>
        DEFAULT
    </ng-container>
Xiao Gui's avatar
Xiao Gui committed
  </ng-template>
Xiao Gui's avatar
Xiao Gui committed
</ng-template>
Xiao Gui's avatar
Xiao Gui committed

<!-- viewer state hover ctx menu -->
Xiao Gui's avatar
Xiao Gui committed
<ng-template #viewerStatusRegionCtxMenu let-data>
  <!-- hovered ROIs -->
  <ng-template ngFor [ngForOf]="data.metadata.hoveredRegions"
    let-region
    let-first="first">
    <mat-divider class="top-0" *ngIf="!first"></mat-divider>
Xiao Gui's avatar
Xiao Gui committed

    <button mat-button
      (click)="$event.ctrlKey ? toggleRoi(region) : selectRoi(region)"
      class="sxplr-list-like-button">
      
      <div class="sxplr-list-like-button-icon">
        <i class="fas fa-brain"></i>
      </div>
      <div class="sxplr-list-like-button-body">
Xiao Gui's avatar
Xiao Gui committed

        <span class="sxplr-list-like-button-body-line">
Xiao Gui's avatar
Xiao Gui committed
          {{ region.name }}
        </span>
        <span class="sxplr-list-like-button-body-line text-muted">
          Brain region
Xiao Gui's avatar
Xiao Gui committed
        </span>
      </div>    
    </button>
Xiao Gui's avatar
Xiao Gui committed

  </ng-template>
Xiao Gui's avatar
Xiao Gui committed
</ng-template>

<!-- general feature tmpl -->
<ng-template let-feature="feature" #selectedFeatureTmpl>
  <!-- TODO differentiate between features (spatial, regional etc) -->
  
  <sxplr-feature-view class="sxplr-z-2 mat-elevation-z2"
    [feature]="feature">

    <div header>
      <!-- back btn -->
      <button mat-button
        (click)="clearSelectedFeature()"
        [attr.aria-label]="ARIA_LABELS.CLOSE"
        class="sxplr-mb-2"
        >
        <i class="fas fa-chevron-left"></i>
        <span class="ml-1">
          Back
        </span>
      </button>
    </div>

  </sxplr-feature-view>
Xiao Gui's avatar
Xiao Gui committed
</ng-template>
Xiao Gui's avatar
Xiao Gui committed
<!-- general point tmpl -->
<ng-template let-view="view" #selectedPointTmpl>
  <sxplr-side-panel>
    <div class="sxplr-custom-cmp lighttheme" header>
      
      <!-- back btn -->
      <button mat-button
        (click)="clearPoint()"
        [attr.aria-label]="ARIA_LABELS.CLOSE"
        class="sxplr-mb-2"
        >
        <i class="fas fa-chevron-left"></i>
        <span class="ml-1">
          Back
        </span>
      </button>
    </div>
    <div title>
      {{ view.spatialObjectTitle }}
    </div>
    <div subtitle>
      {{ view.spatialObjectSubtitle }}
    </div>
  </sxplr-side-panel>
  <sxplr-point-assignment
    [point]="view.selectedPoint"
    [template]="view.selectedTemplate"
    [parcellation]="view.selectedParcellation"
    (clickOnRegion)="$event.event.ctrlKey ? toggleRoi($event.target) : selectRoi($event.target)">
Xiao Gui's avatar
Xiao Gui committed
  </sxplr-point-assignment>
Xiao Gui's avatar
Xiao Gui committed
</ng-template>

<!-- spatial search tmpls -->
Xiao Gui's avatar
Xiao Gui committed
<ng-template #spatialFeatureListTmpl let-view="view">
  <mat-card class="sxplr-pe-all"
    [ngClass]="{
      'sxplr-d-none': !(voiSwitch.switchState$ | async) || (voiFeatureEntryCmp.totals$ | async) === 0
Xiao Gui's avatar
Xiao Gui committed
      <mat-card-title>
Xiao Gui's avatar
Xiao Gui committed
        Anchored to current view
Xiao Gui's avatar
Xiao Gui committed
      </mat-card-title>
      <mat-card-subtitle>
Xiao Gui's avatar
Xiao Gui committed
        <div *ngIf="view.selectedTemplate">
          {{ view.selectedTemplate.name }}
        </div>
        <ng-template [ngIf]="bbox.bbox$ | async | getProperty : 'bbox'" let-bbox>
          <div>
            from {{ bbox[0] | numbers | addUnitAndJoin : '' }}
          </div>
          <div>
            to {{ bbox[1] | numbers | addUnitAndJoin : '' }}
          </div>
Xiao Gui's avatar
Xiao Gui committed
        </ng-template>
      </mat-card-subtitle>
    </mat-card-header>
    <div class="loadingText">

      <ng-template [ngIf]="voiFeatureEntryCmp.busy$ | async">
        <spinner-cmp class="sxplr-d-inline-block"></spinner-cmp>
        <span>
          Loading Wireframes ...
        </span>
      </ng-template>
    </div>
  <sxplr-feature-entry
    [ngClass]="(voiSwitch.switchState$ | async) ? 'sxplr-d-block' : 'sxplr-d-none'"
    class="sxplr-pe-all mat-elevation-z8"
Xiao Gui's avatar
Xiao Gui committed
    [template]="view.selectedTemplate"
    [bbox]="bbox.bbox$ | async | getProperty : 'bbox'"
Xiao Gui's avatar
Xiao Gui committed
    [attr.data-feature-length]="((voiFeatureEntryCmp.features$ | async) || []).length"
    #voiFeatureEntryCmp="featureEntryCmp">
  </sxplr-feature-entry>
  <mat-card [ngClass]="{
    'sxplr-d-none': (voiFeatureEntryCmp.totals$ | async) > 0
  }">
    No spatial features found.
  </mat-card>

  <button mat-raised-button
    [ngClass]="{
      'sxplr-d-none': (voiFeatureEntryCmp.totals$ | async) === 0
    }"
    class="sxplr-pe-all sxplr-w-100"
    iav-switch
    [iav-switch-state]="false"
    #voiSwitch="iavSwitch"
Xiao Gui's avatar
Xiao Gui committed
    (iav-switch-event)="$event && pullAllVoi()"
    (click)="voiSwitch.toggle()">
    <ng-template [ngIf]="voiSwitch.switchState$ | async" [ngIfElse]="chevronCollapseTmpl">
      <i class="fas fa-chevron-up"></i>
      <span>
        Collapse
      </span>
    </ng-template>
    <ng-template #chevronCollapseTmpl>
      <i class="fas fa-chevron-down"></i>
      <span>
        Explore {{ voiFeatureEntryCmp.totals$ | async }} spatial features
      </span>
    </ng-template>
  </button>
Xiao Gui's avatar
Xiao Gui committed

  <!-- TODO voiBbox directive is used to draw outlines for VOI
  this has been temporarily disabled, since datasource is paginated 
  and how bounding boxes are drawn needs to be reconsidered -->
  
Xiao Gui's avatar
Xiao Gui committed
  <div
    *ngIf="voiSwitch.switchState$| async"
    voiBbox
    [features]="voiFeatureEntryCmp.features$ | async">

Xiao Gui's avatar
Xiao Gui committed
  </div>
  sxplr-sapiviews-core-space-boundingbox
Xiao Gui's avatar
Xiao Gui committed
  (sxplr-sapiviews-core-space-boundingbox-changed)="pullAllVoi()"
  [sxplr-sapiviews-core-space-boundingbox-atlas]="selectedAtlas$ | async"
  [sxplr-sapiviews-core-space-boundingbox-space]="templateSelected$ | async"
  [sxplr-sapiviews-core-space-boundingbox-spec]="viewerCtx$ | async | nehubaVCtxToBbox"
  #bbox="sxplrSapiViewsCoreSpaceBoundingBox">
</div>