From 904dee52f4c79bd8c8ab386a20997b833d920487 Mon Sep 17 00:00:00 2001 From: Xiao Gui <xgui3783@gmail.com> Date: Thu, 15 Apr 2021 17:21:44 +0200 Subject: [PATCH] hotfix: cleaned freesurfer --- deploy/csp/index.js | 2 +- src/index.html | 2 +- src/res/ext/freesurfer.json | 53 ++++++++++++++++++- .../threeSurferGlue/threeSurfer.component.ts | 6 ++- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/deploy/csp/index.js b/deploy/csp/index.js index 23deb8495..ae946653b 100644 --- a/deploy/csp/index.js +++ b/deploy/csp/index.js @@ -120,7 +120,7 @@ module.exports = (app) => { 'unpkg.com/react@16/umd/', // plugin load external lib -> react 'unpkg.com/kg-dataset-previewer@1.2.0/', // preview component 'cdnjs.cloudflare.com/ajax/libs/mathjax/', // math jax - 'https://unpkg.com/three-surfer@0.0.5/dist/bundle.js', // for threeSurfer (freesurfer support in browser) + 'https://unpkg.com/three-surfer@0.0.7/dist/bundle.js', // for threeSurfer (freesurfer support in browser) (req, res) => res.locals.nonce ? `'nonce-${res.locals.nonce}'` : null, ...SCRIPT_SRC, ...WHITE_LIST_SRC, diff --git a/src/index.html b/src/index.html index a1df7bb26..aa495bad5 100644 --- a/src/index.html +++ b/src/index.html @@ -14,7 +14,7 @@ <script src="https://unpkg.com/kg-dataset-previewer@1.2.0/dist/kg-dataset-previewer/kg-dataset-previewer.js" defer> </script> - <script src="https://unpkg.com/three-surfer@0.0.5/dist/bundle.js" defer></script> + <script src="https://unpkg.com/three-surfer@0.0.7/dist/bundle.js" defer></script> <title>Interactive Atlas Viewer</title> <script type="application/ld+json"> diff --git a/src/res/ext/freesurfer.json b/src/res/ext/freesurfer.json index 375f31574..a9bae8dd3 100644 --- a/src/res/ext/freesurfer.json +++ b/src/res/ext/freesurfer.json @@ -15,9 +15,60 @@ "label_bv_hcp32k_lh": "https://neuroglancer.humanbrainproject.eu/precomputed/freesurfer/20210305/julichbrain_labels/lh.JulichBrain_MPMAtlas_l_N10_nlin2Stdicbm152asym2009c_publicDOI_83fb39b2811305777db0eb80a0fc8b53.allSub_RF_ANTs_MNI152_orig_to_hcp32k.gii", "label_bv_hcp32k_rh": "https://neuroglancer.humanbrainproject.eu/precomputed/freesurfer/20210305/julichbrain_labels/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.allSub_RF_ANTs_MNI152_orig_to_hcp32k.gii", "label_ants_hcp32k_lh": "https://neuroglancer.humanbrainproject.eu/precomputed/freesurfer/20210305/julichbrain_labels/lh.JulichBrain_MPMAtlas_l_N10_nlin2Stdicbm152asym2009c_publicDOI_83fb39b2811305777db0eb80a0fc8b53.BV_MNI152_orig_to_hcp32k.gii", - "label_ants_hcp32k_rh": "https://neuroglancer.humanbrainproject.eu/precomputed/freesurfer/20210305/julichbrain_labels/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.BV_MNI152_orig_to_hcp32k.gii" + "label_ants_hcp32k_rh": "https://neuroglancer.humanbrainproject.eu/precomputed/freesurfer/20210305/julichbrain_labels/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.BV_MNI152_orig_to_hcp32k.gii", + "label_fsaverage6_cleaned_lh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/lh.JulichBrain_MPMAtlas_l_N10_nlin2Stdicbm152asym2009c_publicDOI_83fb39b2811305777db0eb80a0fc8b53.BV_MNI152_orig_to_fsaverage6_cleaned.gii", + "label_fsaverage_cleaned_lh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/lh.JulichBrain_MPMAtlas_l_N10_nlin2Stdicbm152asym2009c_publicDOI_83fb39b2811305777db0eb80a0fc8b53.BV_MNI152_orig_to_fsaverage_cleaned.gii", + "label_hcp32k_cleaned_lh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/lh.JulichBrain_MPMAtlas_l_N10_nlin2Stdicbm152asym2009c_publicDOI_83fb39b2811305777db0eb80a0fc8b53.BV_MNI152_orig_to_hcp32k_cleaned.gii", + "label_fsaverage6_cleaned_rh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.BV_MNI152_orig_to_fsaverage6_cleaned.gii", + "label_fsaverage_cleaned_rh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.BV_MNI152_orig_to_fsaverage_cleaned.gii", + "label_hcp32k_cleaned_rh":"https://neuroglancer-dev.humanbrainproject.eu/precomputed/data-repo/20210415-new-freesurfer/rh.JulichBrain_MPMAtlas_r_N10_nlin2Stdicbm152asym2009c_publicDOI_172e93a5bec140c111ac862268f0d046.BV_MNI152_orig_to_hcp32k_cleaned.gii" }, "modes": [ + { + "name": "cleaned/fsaverage6/pial", + "meshes": [ + { + "mesh": "rootUrl:fsa_fsa6:/lh.pial.gii", + "colormap": "label_fsaverage6_cleaned_lh:", + "hemisphere": "left" + }, + { + "mesh": "rootUrl:fsa_fsa6:/rh.pial.gii", + "colormap": "label_fsaverage6_cleaned_rh:", + "hemisphere": "right" + } + ] + }, + { + "name": "cleaned/fsaverage/pial", + "meshes": [ + { + "mesh": "rootUrl:fsa_fsa:/lh.pial.gii", + "colormap": "label_fsaverage_cleaned_lh:", + "hemisphere": "left" + }, + { + "mesh": "rootUrl:fsa_fsa:/rh.pial.gii", + "colormap": "label_fsaverage_cleaned_rh:", + "hemisphere": "right" + } + ] + }, + { + "name": "cleaned/hcp32k/pial", + "meshes": [ + { + "mesh": "rootUrl:fsa_fsa:/lh.pial.gii", + "colormap": "label_hcp32k_cleaned_lh:", + "hemisphere": "left" + }, + { + "mesh": "rootUrl:fsa_fsa:/rh.pial.gii", + "colormap": "label_hcp32k_cleaned_rh:", + "hemisphere": "right" + } + ] + }, { "name": "fsaverage/fsaverage/pial", "meshes": [ diff --git a/src/viewerModule/threeSurfer/threeSurferGlue/threeSurfer.component.ts b/src/viewerModule/threeSurfer/threeSurferGlue/threeSurfer.component.ts index a77b837ca..b68770f66 100644 --- a/src/viewerModule/threeSurfer/threeSurferGlue/threeSurfer.component.ts +++ b/src/viewerModule/threeSurfer/threeSurferGlue/threeSurfer.component.ts @@ -68,7 +68,11 @@ export class ThreeSurferGlueCmp implements IViewer, OnChanges, AfterViewInit, On const tsC = await this.tsRef.loadColormap( parseContext(colormap, [this.config['@context']]) ) - const colorIdx = tsC[0].getData() + + let colorIdx = tsC[0].getData() + if (tsC[0].attributes.DataType === 'NIFTI_TYPE_INT16') { + colorIdx = (window as any).ThreeSurfer.GiftiBase.castF32UInt16(colorIdx) + } this.loadedMeshes.push({ threeSurfer: tsM, -- GitLab