Skip to content

Commit

Permalink
fix: minimap in axial maximized view
Browse files Browse the repository at this point in the history
feat: allow labelled nifti to be visualized
  • Loading branch information
xgui3783 committed Oct 18, 2024
1 parent 64df3d7 commit 9f147b7
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .helm/adhoc/configmap-siibra-explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ data:
SIIBRA_CACHEDIR: /siibra-api-volume
HBP_DISCOVERY_URL: "https://iam.ebrains.eu/auth/realms/hbp"
REDIS_ADDR: "cache-redis-service"
V2_7_PLUGIN_URLS: "https://siibra-jugex.apps.tc.humanbrainproject.eu/viewer_plugin/manifest.json;https://neurogenpy.apps.ebrains.eu/viewer_plugin/manifest.json"
V2_7_PLUGIN_URLS: "https://siibra-jugex.apps.tc.humanbrainproject.eu/viewer_plugin/manifest.json;https://ngpy.apps.hbp.eu/viewer_plugin/manifest.json"
LOGGER_DIR: "/sxplr-log"
OVERWRITE_API_ENDPOINT: https://siibra-api-prod.apps.tc.humanbrainproject.eu/v3_0
OVERWRITE_SPATIAL_ENDPOINT: 'https://siibra-spatial-backend.apps.tc.humanbrainproject.eu'
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"python 3",
"typescript"
],
"schema:releaseNotes": "# v2.14.13\n\n## Feature\n\n- Added an example of setting up a proxy for access-controlled content\n- Added free-mode (access via `?free=true`)\n- Added hint for drag-n-drop nifti file (in helper one pager and quick tour)\n\n## Bugfix\n\n- Fixed layout issues when user drag-n-dropped nifti has irregularities\n\n## Behind the scene\n\n- Added script to automatically create release metadata files\n",
"schema:releaseNotes": "# v2.14.13\n\n## Feature\n\n- Added an example of setting up a proxy for access-controlled content\n- Added free-mode (access via `?free=true`)\n- Added hint for drag-n-drop nifti file (in helper one pager and quick tour)\n- Allow nifti to be added as a labelled volume by using `.label.nii.gz` or `.label.nii` extension\n\n## Bugfix\n\n- Fixed layout issues when user drag-n-dropped nifti has irregularities\n- Fixed picture-in-picture minimap in maximized axial view\n\n## Behind the scene\n\n- Added script to automatically create release metadata files\n",
"runtimePlatform": "docker",
"version": "2.14.13",
"contIntegration": "https://github.com/FZJ-INM1-BDA/siibra-explorer/actions",
Expand Down
2 changes: 1 addition & 1 deletion common/helpOnePager.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

You can enable the touch interface, which is selected per default on mobile devices, by selecting the user menu from the top right (👤), then choosing `Settings` and `Enable Mobile UI`.

You can drag-and-drop NiFTi (`.nii` or `.nii.gz`) file on top of your desired template to co-visualize them.
You can drag-and-drop NiFTi (`[.label].nii[.gz]`) file on top of your desired template to co-visualize them. Files with extension`.label.nii[.gz]` will be visualized as labelled volume.
2 changes: 2 additions & 0 deletions docs/releases/v2.14.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
- Added an example of setting up a proxy for access-controlled content
- Added free-mode (access via `?free=true`)
- Added hint for drag-n-drop nifti file (in helper one pager and quick tour)
- Allow nifti to be added as a labelled volume by using `.label.nii.gz` or `.label.nii` extension

## Bugfix

- Fixed layout issues when user drag-n-dropped nifti has irregularities
- Fixed picture-in-picture minimap in maximized axial view

## Behind the scene

Expand Down
4 changes: 2 additions & 2 deletions src/extra_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ body::after
gap: 0.2rem 0.2rem;
}

.grid > .grid-wide-3
.grid > .grid-wide-4
{
grid-column: 1 / 4;
grid-column: 1 / 5;
}

.v-center-text-span
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="icon" type="image/png" href="assets/favicons/favicon-128-light.png"/>
<script src="extra_js.js"></script>
<script src="https://unpkg.com/three-surfer@0.0.17/dist/bundle.js" defer></script>
<script type="module" src="https://unpkg.com/ng-layer-tune@0.0.26/dist/ng-layer-tune/ng-layer-tune.esm.js"></script>
<script type="module" src="https://unpkg.com/ng-layer-tune@0.0.28/dist/ng-layer-tune/ng-layer-tune.esm.js"></script>
<script type="module" src="https://unpkg.com/hbp-connectivity-component@0.6.6/dist/connectivity-component/connectivity-component.js" ></script>
<script src="https://cdn.plot.ly/plotly-2.24.1.min.js" charset="utf-8"></script>
<script src="main.bundle.js" charset="utf-8"></script> <!-- export_nehuba -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnDestroy {
private onDestroyCb: (() => void)[] = []

public nehubaConfig: NehubaConfig
public QUICKTOUR_DND_MD = `Drag and drop any \`.nii\` or \`.nii.gz\` on top of the template to co-visualize.`
public QUICKTOUR_DND_MD = `Drag and drop any \`[.label].nii[.gz]\` on top of the template to co-visualize.`

ngOnDestroy(): void {
while (this.onDestroyCb.length) this.onDestroyCb.pop()()
Expand Down
5 changes: 4 additions & 1 deletion src/viewerModule/nehuba/userLayers/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ export class UserLayerService implements OnDestroy {
})
const { buffer, meta } = result
const url = URL.createObjectURL(new Blob([buffer]))
const type = file.name.includes(".label.nii")
? 'segmentation'
: 'image'
return {
protocol: 'nifti://',
url,
option: {
legacySpecFlag: "old",
type: 'image',
type,
shader: getShader({
colormap: EnumColorMapName.MAGMA,
lowThreshold: meta.min || 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
</button>

<div *ngIf="view.showMore || view.compact"
class="sxplr-custom-cmp darker-bg overflow-hidden grid-wide-3">
class="sxplr-custom-cmp darker-bg overflow-hidden grid-wide-4">
<ng-template [ngTemplateOutlet]="ngLayerController" [ngTemplateOutletContext]="{ onlyOpacity: !view.showMore }">
</ng-template>
</div>

<ul class="grid-wide-3 sxplr-custom-cmp darker-bg" *ngIf="view.showMore">
<ul class="grid-wide-4 sxplr-custom-cmp darker-bg" *ngIf="view.showMore">
<li *ngFor="let warn of data.warning">{{ warn }}</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, Inject, ViewChild, ChangeDetectionStrategy, inject, HostList
import { FormControl } from "@angular/forms";
import { select, Store } from "@ngrx/store";
import { BehaviorSubject, combineLatest, concat, merge, NEVER, Observable, of, Subject } from "rxjs";
import { switchMap, distinctUntilChanged, map, debounceTime, shareReplay, take, withLatestFrom, filter, takeUntil } from "rxjs/operators";
import { switchMap, distinctUntilChanged, map, debounceTime, shareReplay, take, withLatestFrom, filter, takeUntil, tap } from "rxjs/operators";

Check failure on line 5 in src/viewerModule/nehuba/viewerCtrl/perspectiveViewSlider/perspectiveViewSlider.component.ts

View workflow job for this annotation

GitHub Actions / lint

'tap' is defined but never used
import { SxplrTemplate } from "src/atlasComponents/sapi/sxplrTypes"
import { selectedTemplate } from "src/state/atlasSelection/selectors";
import { panelMode, panelOrder } from "src/state/userInterface/selectors";
Expand All @@ -26,10 +26,10 @@ const anatOriToIdx: Record<AnatomicalOrientation, number> = {
'ap': 1,
'si': 2
}
const anaOriAltAxis: Record<AnatomicalOrientation, (tmplSize: [number, number, number], ratio: {x: number, y: number}) => {idx: number, value: number}> = {
'rl': (tmplSize, { y }) => ({ idx: 2, value: tmplSize[2] * (0.5 - y) }),
'ap': (tmplSize, { y }) => ({ idx: 2, value: tmplSize[2] * (0.5 - y) }),
'si': (tmplSize, { x }) => ({ idx: 2, value: tmplSize[0] * (0.5 - x) })
const anaOriAltAxis: Record<AnatomicalOrientation, (templateInfo: TemplateInfo, ratio: {x: number, y: number}) => {idx: number, value: number}> = {
'rl': (templateInfo, { y }) => ({ idx: 2, value: templateInfo.real[0] * (0.5 - y) }),
'ap': (templateInfo, { y }) => ({ idx: 2, value: templateInfo.real[1] * (0.5 - y) }),
'si': (templateInfo, { y }) => ({ idx: 0, value: templateInfo.real[2] * (y - 0.5) })
}

function getDim(triplet: number[], view: EnumClassicalView) {
Expand Down Expand Up @@ -424,7 +424,7 @@ export class PerspectiveViewSlider {
}

if (!isNullish(xyRatio.x) && !isNullish(xyRatio.y)) {
const { idx, value } = anaOriAltAxis[anatomicalOrientation](currTmplSize.real, xyRatio)
const { idx, value } = anaOriAltAxis[anatomicalOrientation](currTmplSize, xyRatio)
positionMod.push({
idx,
value
Expand Down

0 comments on commit 9f147b7

Please sign in to comment.