question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When Click "2D MPR", the web app crashed !

See original GitHub issue

pro:when i click “2D MPR” the app crashed

details: the same picture data in [https://viewer.ohif.org/viewer] is ok ,but error in local

[website] ok (https://viewer.ohif.org/viewer/1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339) [local ] error (http://localhost:3000/viewer/1.3.6.1.4.1.14519.5.2.1.7009.2403.871108593056125491804754960339)

my pc env: view version & PC details

image

the error operate

image

chrome console log

macro.js?c780:64 Error compiling shader '#version 300 es
#define attribute in
#define textureCube texture
#define texture2D texture
#define textureCubeLod textureLod
#define texture2DLod textureLod





#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
#else
precision mediump float;
precision mediump int;
#endif

/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkVolumeFS.glsl

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// Template for the polydata mappers fragment shader

// the output of this shader
layout(location = 0) out vec4 fragOutput0;

in vec3 vertexVCVSOutput;

// first declare the settings from the mapper
// that impact the code paths in here

// always set vtkNumComponents 1,2,3,4
#define vtkNumComponents 1

// possibly define vtkUseTriliear
//VTK::TrilinearOn

// possibly define vtkIndependentComponents
#define vtkIndependentComponentsOn

// Define the blend mode to use
#define vtkBlendMode 0

// Possibly define vtkImageLabelOutlineOn
//VTK::ImageLabelOutlineOn

#ifdef vtkImageLabelOutlineOn
uniform int outlineThickness;
uniform float vpWidth;
uniform float vpHeight;
uniform mat4 DCWCMatrix;
uniform mat4 vWCtoIDX;
#endif

// define vtkLightComplexity
#define vtkLightComplexity 0
#if vtkLightComplexity > 0
uniform float vSpecularPower;
uniform float vAmbient;
uniform float vDiffuse;
uniform float vSpecular;
//VTK::Light::Dec
#endif

// possibly define vtkGradientOpacityOn
//VTK::GradientOpacityOn
#ifdef vtkGradientOpacityOn
uniform float goscale0;
uniform float goshift0;
uniform float gomin0;
uniform float gomax0;
#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)
uniform float goscale1;
uniform float goshift1;
uniform float gomin1;
uniform float gomax1;
#if vtkNumComponents >= 3
uniform float goscale2;
uniform float goshift2;
uniform float gomin2;
uniform float gomax2;
#endif
#if vtkNumComponents >= 4
uniform float goscale3;
uniform float goshift3;
uniform float gomin3;
uniform float gomax3;
#endif
#endif
#endif

// camera values
uniform float camThick;
uniform float camNear;
uniform float camFar;
uniform int cameraParallel;

// values describing the volume geometry
uniform vec3 vOriginVC;
uniform vec3 vSpacing;
uniform ivec3 volumeDimensions; // 3d texture dimensions
uniform vec3 vPlaneNormal0;
uniform float vPlaneDistance0;
uniform vec3 vPlaneNormal1;
uniform float vPlaneDistance1;
uniform vec3 vPlaneNormal2;
uniform float vPlaneDistance2;
uniform vec3 vPlaneNormal3;
uniform float vPlaneDistance3;
uniform vec3 vPlaneNormal4;
uniform float vPlaneDistance4;
uniform vec3 vPlaneNormal5;
uniform float vPlaneDistance5;

// opacity and color textures
uniform sampler2D otexture;
uniform float oshift0;
uniform float oscale0;
uniform sampler2D ctexture;
uniform float cshift0;
uniform float cscale0;

// jitter texture
uniform sampler2D jtexture;

// some 3D texture values
uniform float sampleDistance;
uniform vec3 vVCToIJK;

// the heights defined below are the locations
// for the up to four components of the tfuns
// the tfuns have a height of 2XnumComps pixels so the
// values are computed to hit the middle of the two rows
// for that component
#ifdef vtkIndependentComponentsOn
#if vtkNumComponents == 2
uniform float mix0;
uniform float mix1;
#define height0 0.25
#define height1 0.75
#endif
#if vtkNumComponents == 3
uniform float mix0;
uniform float mix1;
uniform float mix2;
#define height0 0.17
#define height1 0.5
#define height2 0.83
#endif
#if vtkNumComponents == 4
uniform float mix0;
uniform float mix1;
uniform float mix2;
uniform float mix3;
#define height0 0.125
#define height1 0.375
#define height2 0.625
#define height3 0.875
#endif
#endif

#if vtkNumComponents >= 2
uniform float oshift1;
uniform float oscale1;
uniform float cshift1;
uniform float cscale1;
#endif
#if vtkNumComponents >= 3
uniform float oshift2;
uniform float oscale2;
uniform float cshift2;
uniform float cscale2;
#endif
#if vtkNumComponents >= 4
uniform float oshift3;
uniform float oscale3;
uniform float cshift3;
uniform float cscale3;
#endif

// declaration for intermixed geometry
//VTK::ZBuffer::Dec

// Lighting values
//VTK::Light::Dec

//=======================================================================
// Webgl2 specific version of functions
#if __VERSION__ == 300

uniform highp sampler3D texture1;

vec4 getTextureValue(vec3 pos)
{
  vec4 tmp = texture(texture1, pos);
#if vtkNumComponents == 1
  tmp.a = tmp.r;
#endif
#if vtkNumComponents == 2
  tmp.a = tmp.g;
#endif
#if vtkNumComponents == 3
  tmp.a = length(tmp.rgb);
#endif

vtkErrorMacro @ macro.js?c780:64
publicAPI.compile @ index.js?1f23:54
publicAPI.compileShader @ index.js?bf01:44
publicAPI.readyShaderProgram @ index.js?748f:141
publicAPI.readyShaderProgramArray @ index.js?748f:132
publicAPI.updateShaders @ index.js?7ec5:346
publicAPI.renderPieceDraw @ index.js?7ec5:918
publicAPI.renderPiece @ index.js?7ec5:1037
publicAPI.volumePass @ index.js?7ec5:74
publicAPI.apply @ index.js?7831:44
publicAPI.traverse @ index.js?7831:32
publicAPI.traverseVolumePass @ index.js?d3be:49
publicAPI.traverse @ index.js?7831:27
publicAPI.traverse @ index.js?7831:35
publicAPI.traverse @ index.js?d7c2:83
publicAPI.traverseAllPasses @ index.js?7600:1046
forceRender @ index.js?5b59:299
publicAPI.render @ index.js?5b59:686
publicAPI.render @ index.js?0a77:57
componentDidUpdate @ View2D.js?6a08:568
componentDidUpdate @ react-hot-loader.development.js?bdc1:704
componentDidMount @ View2D.js?6a08:155
componentDidMount @ react-hot-loader.development.js?bdc1:704
commitLifeCycles @ react-dom.development.js?bed1:22068
commitLayoutEffects @ react-dom.development.js?bed1:25302
callCallback @ react-dom.development.js?bed1:336
invokeGuardedCallbackDev @ react-dom.development.js?bed1:385
invokeGuardedCallback @ react-dom.development.js?bed1:440
commitRootImpl @ react-dom.development.js?bed1:25040
unstable_runWithPriority @ scheduler.development.js?9f16:818
runWithPriority$2 @ react-dom.development.js?bed1:12130
commitRoot @ react-dom.development.js?bed1:24889
finishSyncRender @ react-dom.development.js?bed1:24296
performSyncWorkOnRoot @ react-dom.development.js?bed1:24274
eval @ react-dom.development.js?bed1:12180
unstable_runWithPriority @ scheduler.development.js?9f16:818
runWithPriority$2 @ react-dom.development.js?bed1:12130
flushSyncCallbackQueueImpl @ react-dom.development.js?bed1:12175
flushSyncCallbackQueue @ react-dom.development.js?bed1:12163
scheduleUpdateOnFiber @ react-dom.development.js?bed1:23676
enqueueSetState @ react-dom.development.js?bed1:13975
Component.setState @ react.development.js?1090:325
eval @ OHIFVTKViewport.js?36ba:351
Show 13 more frames
macro.js?c780:64 0: #version 300 es
1: #define attribute in
2: #define textureCube texture
3: #define texture2D texture
4: #define textureCubeLod textureLod
5: #define texture2DLod textureLod
6: 
7: 
8: 
9: 
10: 
11: #ifdef GL_FRAGMENT_PRECISION_HIGH
12: precision highp float;
13: precision highp int;
14: #else
15: precision mediump float;
16: precision mediump int;
17: #endif
18: 
19: /*=========================================================================
20: 
21:   Program:   Visualization Toolkit
22:   Module:    vtkVolumeFS.glsl
23: 
24:   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
25:   All rights reserved.
26:   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
27: 
28:      This software is distributed WITHOUT ANY WARRANTY; without even
29:      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30:      PURPOSE.  See the above copyright notice for more information.
31: 
32: =========================================================================*/
33: // Template for the polydata mappers fragment shader
34: 
35: // the output of this shader
36: layout(location = 0) out vec4 fragOutput0;
37: 
38: in vec3 vertexVCVSOutput;
39: 
40: // first declare the settings from the mapper
41: // that impact the code paths in here
42: 
43: // always set vtkNumComponents 1,2,3,4
44: #define vtkNumComponents 1
45: 
46: // possibly define vtkUseTriliear
47: //VTK::TrilinearOn
48: 
49: // possibly define vtkIndependentComponents
50: #define vtkIndependentComponentsOn
51: 
52: // Define the blend mode to use
53: #define vtkBlendMode 0
54: 
55: // Possibly define vtkImageLabelOutlineOn
56: //VTK::ImageLabelOutlineOn
57: 
58: #ifdef vtkImageLabelOutlineOn
59: uniform int outlineThickness;
60: uniform float vpWidth;
61: uniform float vpHeight;
62: uniform mat4 DCWCMatrix;
63: uniform mat4 vWCtoIDX;
64: #endif
65: 
66: // define vtkLightComplexity
67: #define vtkLightComplexity 0
68: #if vtkLightComplexity > 0
69: uniform float vSpecularPower;
70: uniform float vAmbient;
71: uniform float vDiffuse;
72: uniform float vSpecular;
73: //VTK::Light::Dec
74: #endif
75: 
76: // possibly define vtkGradientOpacityOn
77: //VTK::GradientOpacityOn
78: #ifdef vtkGradientOpacityOn
79: uniform float goscale0;
80: uniform float goshift0;
81: uniform float gomin0;
82: uniform float gomax0;
83: #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)
84: uniform float goscale1;
85: uniform float goshift1;
86: uniform float gomin1;
87: uniform float gomax1;
88: #if vtkNumComponents >= 3
89: uniform float goscale2;
90: uniform float goshift2;
91: uniform float gomin2;
92: uniform float gomax2;
93: #endif
94: #if vtkNumComponents >= 4
95: uniform float goscale3;
96: uniform float goshift3;
97: uniform float gomin3;
98: uniform float gomax3;
99: #endif
100: #endif
101: #endif
102: 
103: // camera values
104: uniform float camThick;
105: uniform float camNear;
106: uniform float camFar;
107: uniform int cameraParallel;
108: 
109: // values describing the volume geometry
110: uniform vec3 vOriginVC;
111: uniform vec3 vSpacing;
112: uniform ivec3 volumeDimensions; // 3d texture dimensions
113: uniform vec3 vPlaneNormal0;
114: uniform float vPlaneDistance0;
115: uniform vec3 vPlaneNormal1;
116: uniform float vPlaneDistance1;
117: uniform vec3 vPlaneNormal2;
118: uniform float vPlaneDistance2;
119: uniform vec3 vPlaneNormal3;
120: uniform float vPlaneDistance3;
121: uniform vec3 vPlaneNormal4;
122: uniform float vPlaneDistance4;
123: uniform vec3 vPlaneNormal5;
124: uniform float vPlaneDistance5;
125: 
126: // opacity and color textures
127: uniform sampler2D otexture;
128: uniform float oshift0;
129: uniform float oscale0;
130: uniform sampler2D ctexture;
131: uniform float cshift0;
132: uniform float cscale0;
133: 
134: // jitter texture
135: uniform sampler2D jtexture;
136: 
137: // some 3D texture values
138: uniform float sampleDistance;
139: uniform vec3 vVCToIJK;
140: 
141: // the heights defined below are the locations
142: // for the up to four components of the tfuns
143: // the tfuns have a height of 2XnumComps pixels so the
144: // values are computed to hit the middle of the two rows
145: // for that component
146: #ifdef vtkIndependentComponentsOn
147: #if vtkNumComponents == 2
148: uniform float mix0;
149: uniform float mix1;
150: #define height0 0.25
151: #define height1 0.75
152: #endif
153: #if vtkNumComponents == 3
154: uniform float mix0;
155: uniform float mix1;
156: uniform float mix2;
157: #define height0 0.17
158: #define height1 0.5
159: #define height2 0.83
160: #endif
161: #if vtkNumComponents == 4
162: uniform float mix0;
163: uniform float mix1;
164: uniform float mix2;
165: uniform float mix3;
166: #define height0 0.125
167: #define height1 0.375
168: #define height2 0.625
169: #define height3 0.875
170: #endif
171: #endif
172: 
173: #if vtkNumComponents >= 2
174: uniform float oshift1;
175: uniform float oscale1;
176: uniform float cshift1;
177: uniform float cscale1;
178
----
index.js?7ec5:383 Uncaught TypeError: Cannot read property 'isAttributeUsed' of null
    at Object.publicAPI.setMapperShaderParameters (index.js?7ec5:383)
    at Object.publicAPI.updateShaders (index.js?7ec5:367)
    at Object.publicAPI.renderPieceDraw (index.js?7ec5:918)
    at Object.publicAPI.renderPiece (index.js?7ec5:1037)
    at publicAPI.volumePass (index.js?7ec5:74)
    at Object.publicAPI.apply (index.js?7831:44)
    at Object.publicAPI.traverse (index.js?7831:32)
    at publicAPI.traverseVolumePass (index.js?d3be:49)
    at Object.publicAPI.traverse (index.js?7831:27)
    at Object.publicAPI.traverse (index.js?7831:35)
----

VM90570 react_devtools_backend.js:2557 ViewerMain Error Boundary TypeError: Cannot read property 'isAttributeUsed' of null
    at Object.publicAPI.setMapperShaderParameters (index.js?7ec5:383)
    at Object.publicAPI.updateShaders (index.js?7ec5:367)
    at Object.publicAPI.renderPieceDraw (index.js?7ec5:918)
    at Object.publicAPI.renderPiece (index.js?7ec5:1037)
    at publicAPI.volumePass (index.js?7ec5:74)
    at Object.publicAPI.apply (index.js?7831:44)
    at Object.publicAPI.traverse (index.js?7831:32)
    at publicAPI.traverseVolumePass (index.js?d3be:49)
    at Object.publicAPI.traverse (index.js?7831:27)
    at Object.publicAPI.traverse (index.js?7831:35) 
    in View2D (created by VTKViewport)
    in div (created by VTKViewport)
    in VTKViewport (created by ConnectFunction)
    in ConnectFunction (created by OHIFVTKViewport)
    in div (created by OHIFVTKViewport)
    in OHIFVTKViewport (created by Component)
    in Component (created by ExtendedVTKViewport)
    in ExtendedVTKViewport (created by WithCommandsManager)
    in WithCommandsManager (created by ViewportGrid)
    in div (created by ViewportPane)
    in ViewportPane (created by ViewportGrid)
    in div (created by ViewportGrid)
    in ViewportGrid (created by ConnectFunction)
    in ConnectFunction (created by ViewerMain)
    in div (created by ViewerMain)
    in ViewerMain (created by ConnectFunction)
    in ConnectFunction (created by Viewer)
    in ErrorBoundary (created by OHIFErrorBoundary)
    in OHIFErrorBoundary (created by ErrorBoundaryDialog)
    in ErrorBoundaryDialog (created by Viewer)
    in div (created by Viewer)
    in div (created by Viewer)
    in Viewer (created by WrappedComponent)
    in WrappedComponent (created by ConnectFunction)
    in ConnectFunction (created by ViewerRetrieveStudyData)
    in ViewerRetrieveStudyData (created by ConnectFunction)
    in ConnectFunction (created by ViewerRouting)
    in ViewerRouting (created by Component)
    in Component (created by Context.Consumer)
    in ErrorBoundary (created by OHIFErrorBoundary)
    in OHIFErrorBoundary (created by Context.Consumer)
    in Transition (created by CSSTransition)
    in CSSTransition (created by Context.Consumer)
    in Route (created by OHIFStandaloneViewer)
    in OHIFStandaloneViewer (created by ConnectFunction)
    in ConnectFunction (created by Context.Consumer)
    in withRouter(Connect(OHIFStandaloneViewer)) (created by Component)
    in Unknown (created by Component)
    in Component (created by App)
    in ModalProvider (created by App)
    in DialogProvider (created by App)
    in SnackbarProvider (created by App)
    in LoggerProvider (created by App)
    in Router (created by BrowserRouter)
    in BrowserRouter (created by App)
    in I18nextProvider (created by App)
    in AppProvider (created by App)
    in Provider (created by App)
    in ErrorBoundary (created by OHIFErrorBoundary)
    in OHIFErrorBoundary (created by App)
    in App (created by HotExportedApp)
    in AppContainer (created by HotExportedApp)
    in HotExportedApp
overrideMethod @ VM90570 react_devtools_backend.js:2557
onErrorHandler @ ErrorBoundary.js?ebc9:24
componentDidCatch @ react-error-boundary.umd.js?2d4e:67
callback @ react-dom.development.js?bed1:23240
callCallback @ react-dom.development.js?bed1:13810
commitUpdateEffects @ react-dom.development.js?bed1:13848
commitUpdateQueue @ react-dom.development.js?bed1:13836
commitLifeCycles @ react-dom.development.js?bed1:22102
commitLayoutEffects @ react-dom.development.js?bed1:25302
callCallback @ react-dom.development.js?bed1:336
invokeGuardedCallbackDev @ react-dom.development.js?bed1:385
invokeGuardedCallback @ react-dom.development.js?bed1:440
commitRootImpl @ react-dom.development.js?bed1:25040
unstable_runWithPriority @ scheduler.development.js?9f16:818
runWithPriority$2 @ react-dom.development.js?bed1:12130
commitRoot @ react-dom.development.js?bed1:24889
finishSyncRender @ react-dom.development.js?bed1:24296
performSyncWorkOnRoot @ react-dom.development.js?bed1:24274
eval @ react-dom.development.js?bed1:12180
unstable_runWithPriority @ scheduler.development.js?9f16:818
runWithPriority$2 @ react-dom.development.js?bed1:12130
flushSyncCallbackQueueImpl @ react-dom.development.js?bed1:12175
flushSyncCallbackQueue @ react-dom.development.js?bed1:12163
scheduleUpdateOnFiber @ react-dom.development.js?bed1:23676
enqueueSetState @ react-dom.development.js?bed1:13975
Component.setState @ react.development.js?1090:325
eval @ OHIFVTKViewport.js?36ba:351

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
elvis324commented, May 25, 2021

Having the same problem… Issue 561 not help. Have you solved this problem? @elvis324

yes ,it’s worked , fixed the code in file: extensions/vtk/src/OHIFVTKViewport.js

   const sampleDistance = (spacing[0] + spacing[1] + spacing[2]) / 6;

Can u share how u fix it?

replace with the under code

const sampleDistance =
      (parseFloat(spacing[0]) +
        parseFloat(spacing[1]) +
        parseFloat(spacing[2])) /
      6;
0reactions
aizelacommented, May 26, 2021

Having the same problem… Issue 561 not help. Have you solved this problem? @elvis324

yes ,it’s worked , fixed the code in file: extensions/vtk/src/OHIFVTKViewport.js

   const sampleDistance = (spacing[0] + spacing[1] + spacing[2]) / 6;

Can u share how u fix it?

replace with the under code

const sampleDistance =
      (parseFloat(spacing[0]) +
        parseFloat(spacing[1]) +
        parseFloat(spacing[2])) /
      6;

It works, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebApp crash - Microsoft Q&A
I used to use Azure Web App without any problems, but for some reason recently it stopped working. The application crashes right after...
Read more >
Android App crashes when clicked on the search Icon?
Your crash is most likely caused by mixing androidx with the old support library components. Change the import of Searchview, ...
Read more >
Troubleshooting Android development - Unity - Manual
Your application crashes immediately after launch. Ensure that you are not trying to use NativeActivity with devices that do not support it.
Read more >
animal crossing new horizons obb file download
This time, install the product keys by clicking the “File” button and open ... Size: 650 MB (MP3), 1,759 MB (FLAC)Download full game...
Read more >
crashing cars game
Car games are most often the races in various 2D and 3D modes, that allows you to ... The description of car crash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found