diff --git a/deploy/bkwdCompat/urlState.js b/deploy/bkwdCompat/urlState.js index 66f92c3dc4f6b375fcfe0c70f16a685b43c30e0d..8bd701a231181bf4e6bd53db2fa1f9568483188a 100644 --- a/deploy/bkwdCompat/urlState.js +++ b/deploy/bkwdCompat/urlState.js @@ -114,7 +114,7 @@ const WARNING_STRINGS = { REGION_SELECT_ERROR: 'Region selected cannot be processed properly.', TEMPLATE_ERROR: 'Template not found.', } - +const pliPreviewUrl = `/a:juelich:iav:atlas:v1.0.0:1/t:minds:core:referencespace:v1.0.0:a1655b99-82f1-420f-a3c2-fe80fd4c8588/p:juelich:iav:atlas:v1.0.0:4/@:0.0.0.-W000.._eCwg.2-FUe3._-s_W.2_evlu..7LIy..1qI1a.D31U~.i-Os~..HRE/f:siibra:features:voi:19c437087299dd62e7c507200f69aea6` module.exports = (query, _warningCb) => { const { standaloneVolumes, @@ -163,7 +163,17 @@ module.exports = (query, _warningCb) => { if (Array.isArray(parsedDsp)) { if (parsedDsp.length === 1) { const { datasetId, filename } = parsedDsp[0] - dsp = `/dsp:${encodeId(datasetId)}::${encodeURI(filename)}` + if (datasetId === "minds/core/dataset/v1.0.0/b08a7dbc-7c75-4ce7-905b-690b2b1e8957") { + /** + * if preview pli link, return hardcoded link + */ + return pliPreviewUrl + } else { + /** + * TODO deprecate dsp + */ + dsp = `/dsp:${encodeId(datasetId)}::${encodeURI(filename)}` + } } else { searchParam.set(`previewingDatasetFiles`, previewingDatasetFiles) } diff --git a/src/atlasComponents/sapiViews/core/index.ts b/src/atlasComponents/sapiViews/core/index.ts index 6db4628176e571f0a50adca091dc02c5d51801de..cb3d0ffce18ea93d534e44866392f0fc819b0ae8 100644 --- a/src/atlasComponents/sapiViews/core/index.ts +++ b/src/atlasComponents/sapiViews/core/index.ts @@ -1,3 +1,7 @@ export { SapiViewsCoreModule -} from "./module" \ No newline at end of file +} from "./module" + +export { + SapiViewsCoreSpaceBoundingBox +} from "./space" \ No newline at end of file diff --git a/src/atlasComponents/sapiViews/core/space/index.ts b/src/atlasComponents/sapiViews/core/space/index.ts index 46f783b69e03bdae2ef01144ba731e0b264c1c12..26c7eed07b1e454d4eac3bcbdf0c77bb9fe4f162 100644 --- a/src/atlasComponents/sapiViews/core/space/index.ts +++ b/src/atlasComponents/sapiViews/core/space/index.ts @@ -1 +1,4 @@ -export { SapiViewsCoreSpaceModule } from "./module" \ No newline at end of file +export { SapiViewsCoreSpaceModule } from "./module" +export { + SapiViewsCoreSpaceBoundingBox +} from "./boundingBox.directive" \ No newline at end of file diff --git a/src/atlasComponents/sapiViews/features/index.ts b/src/atlasComponents/sapiViews/features/index.ts index 19e30dcb1873aa37868be5e8944eaad3a9b0ce05..89e1fafbad8108576c708d401326b2d5f4137f6d 100644 --- a/src/atlasComponents/sapiViews/features/index.ts +++ b/src/atlasComponents/sapiViews/features/index.ts @@ -1,3 +1,7 @@ export { SapiViewsFeaturesModule -} from "./module" \ No newline at end of file +} from "./module" + +export { + SapiViewsFeaturesVoiQuery +} from "./voi" diff --git a/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.component.ts b/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.component.ts index fd216151b9bbbf14d3b498eae8ffc98b2501ba05..f2e75e77f501517ac2f166f44a1b851042458489 100644 --- a/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.component.ts +++ b/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.component.ts @@ -54,6 +54,10 @@ export class NgLayerCtrlCmp implements OnChanges, OnDestroy{ private onDestroyCb: (() => void)[] = [] private removeLayer: () => void + public showOpacityCtrl = false + public hideNgTuneCtrl = 'lower_threshold,higher_threshold,brightness,contrast,colormap,hide-threshold-checkbox' + public defaultOpacity = 1 + @Input('ng-layer-ctl-name') name: string diff --git a/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.template.html b/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.template.html index 2188b17d9f57f496928a0b40f2ba78e3508be9d5..e3442c7b4323dac373e0b9110549b8c97a206a3e 100644 --- a/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.template.html +++ b/src/viewerModule/nehuba/ngLayerCtl/ngLayerCtrl.template.html @@ -7,4 +7,16 @@ <span> {{ name }} </span> + + <button mat-icon-button (click)="showOpacityCtrl = !showOpacityCtrl"> + <i class="fas fa-cog"></i> + </button> + + <ng-template [ngIf]="showOpacityCtrl"> + <ng-layer-tune + [ngLayerName]="name" + [hideCtrl]="hideNgTuneCtrl" + [opacity]="defaultOpacity"> + </ng-layer-tune> + </ng-template> </div> diff --git a/src/viewerModule/viewerCmp/viewerCmp.component.ts b/src/viewerModule/viewerCmp/viewerCmp.component.ts index c01b335222d6ed39caf95183524d7d4c7aae2fac..f0b32efea3c8233a648e0277bfd38ddeaebe2074 100644 --- a/src/viewerModule/viewerCmp/viewerCmp.component.ts +++ b/src/viewerModule/viewerCmp/viewerCmp.component.ts @@ -12,6 +12,9 @@ import { SAPI, SapiRegionModel } from "src/atlasComponents/sapi"; import { atlasSelection, userInteraction, } from "src/state"; import { SapiSpatialFeatureModel, SapiFeatureModel, SapiParcellationModel, SapiSpaceModel } from "src/atlasComponents/sapi/type"; import { getUuid } from "src/util/fn"; +import { environment } from "src/environments/environment" +import { SapiViewsFeaturesVoiQuery } from "src/atlasComponents/sapiViews/features"; +import { SapiViewsCoreSpaceBoundingBox } from "src/atlasComponents/sapiViews/core"; @Component({ selector: 'iav-cmp-viewer-container', @@ -62,10 +65,17 @@ export class ViewerCmp implements OnDestroy { public CONST = CONST public ARIA_LABELS = ARIA_LABELS + public VOI_QUERY_FLAG = environment.EXPERIMENTAL_FEATURE_FLAG @ViewChild('genericInfoVCR', { read: ViewContainerRef }) genericInfoVCR: ViewContainerRef + @ViewChild('voiFeatures', { read: SapiViewsFeaturesVoiQuery }) + voiQueryDirective: SapiViewsFeaturesVoiQuery + + @ViewChild('bbox', { read: SapiViewsCoreSpaceBoundingBox }) + boundingBoxDirective: SapiViewsCoreSpaceBoundingBox + public quickTourRegionSearch: IQuickTourData = { order: 7, description: QUICKTOUR_DESC.REGION_SEARCH, diff --git a/src/viewerModule/viewerCmp/viewerCmp.template.html b/src/viewerModule/viewerCmp/viewerCmp.template.html index 2012afcff01d3121e46f30ddca9ceff8faebb46d..90d6d4a3810ecb35d68f616af533a3579493d78a 100644 --- a/src/viewerModule/viewerCmp/viewerCmp.template.html +++ b/src/viewerModule/viewerCmp/viewerCmp.template.html @@ -29,7 +29,7 @@ </mat-list-item> - <ng-template [ngIf]="voiFeatures.onhover | async" let-feat> + <ng-template [ngIf]="voiQueryDirective && (voiQueryDirective.onhover | async)" let-feat> <mat-list-item> <mat-icon fontSet="fas" @@ -223,9 +223,11 @@ <ng-container *ngTemplateOutlet="autocompleteTmpl; context: { showTour: true }"> </ng-container> - <div *ngIf="!((selectedRegions$ | async)[0])" class="sxplr-p-2 w-100"> - <ng-container *ngTemplateOutlet="spatialFeatureListViewTmpl"></ng-container> - </div> + <ng-template [ngIf]="VOI_QUERY_FLAG"> + <div *ngIf="!((selectedRegions$ | async)[0])" class="sxplr-p-2 w-100"> + <ng-container *ngTemplateOutlet="spatialFeatureListViewTmpl"></ng-container> + </div> + </ng-template> </div> <!-- such a gross implementation --> @@ -264,7 +266,7 @@ isOpen: minTrayVisSwitch.switchState$ | async, regionSelected: selectedRegions$ | async, click: minTrayVisSwitch.toggle.bind(minTrayVisSwitch), - badge: (voiFeatures.features$ | async).length || null + badge: voiQueryDirective && (voiQueryDirective.features$ | async).length || null }"> </ng-container> </div> @@ -983,18 +985,18 @@ </ng-template> <ng-template #spatialFeatureListViewTmpl> - <div *ngIf="voiFeatures.busy$ | async; else notBusyTmpl" class="fs-200"> + <div *ngIf="voiQueryDirective && (voiQueryDirective.busy$ | async); else notBusyTmpl" class="fs-200"> <spinner-cmp></spinner-cmp> </div> <ng-template #notBusyTmpl> - <mat-card *ngIf="(voiFeatures.features$ | async).length > 0" class="pe-all mat-elevation-z4"> + <mat-card *ngIf="voiQueryDirective && (voiQueryDirective.features$ | async).length > 0" class="pe-all mat-elevation-z4"> <mat-card-title> Volumes of interest </mat-card-title> <mat-card-subtitle class="overflow-hidden"> <!-- TODO in future, perhaps encapsulate this as a component? seems like a nature fit in sapiView/space/boundingbox --> - <ng-template let-bbox [ngIf]="bbox.bbox$ | async | getProperty : 'bbox'" [ngIfElse]="bboxFallbackTmpl"> + <ng-template let-bbox [ngIf]="boundingBoxDirective && (boundingBoxDirective.bbox$ | async | getProperty : 'bbox')" [ngIfElse]="bboxFallbackTmpl"> Bounding box: {{ bbox[0] | numbers | json }} - {{ bbox[1] | numbers | json }} mm </ng-template> <ng-template #bboxFallbackTmpl> @@ -1005,17 +1007,21 @@ <mat-divider></mat-divider> - <div *ngFor="let feature of voiFeatures.features$ | async" - mat-ripple - (click)="showDataset(feature)" - class="sxplr-custom-cmp hoverable w-100 overflow-hidden text-overflow-ellipses"> - {{ feature.metadata.fullName }} - </div> + <ng-template [ngIf]="voiQueryDirective"> + + <div *ngFor="let feature of voiQueryDirective.features$ | async" + mat-ripple + (click)="showDataset(feature)" + class="sxplr-custom-cmp hoverable w-100 overflow-hidden text-overflow-ellipses"> + {{ feature.metadata.fullName }} + </div> + </ng-template> </mat-card> </ng-template> </ng-template> <div class="d-none" + *ngIf="VOI_QUERY_FLAG" sxplr-sapiviews-core-space-boundingbox [sxplr-sapiviews-core-space-boundingbox-atlas]="selectedAtlas$ | async" [sxplr-sapiviews-core-space-boundingbox-space]="templateSelected$ | async"