-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Progressive loading of vtkjs viewport #1055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds progressive volume loading for vtkjs viewport whilst the frames are streamed from PACs and rebuilt in the volume. Closes: closes OHIF#1051
Codecov Report
@@ Coverage Diff @@
## master #1055 +/- ##
======================================
Coverage 9.62% 9.62%
======================================
Files 251 251
Lines 6257 6257
Branches 1162 1162
======================================
Hits 602 602
Misses 4600 4600
Partials 1055 1055
Continue to review full report at Codecov.
|
@JamesAPetts is this ready for review? |
this.setState({ | ||
volumes: [volumeActor], | ||
}); | ||
}, 200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ 👉 👇 👈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, this was Erik and I trying to make something render to the user ASAP. Hence the massive disclaimer up top. Feel free to fix it if you find a way!
@@ -35,7 +35,8 @@ class LoadingIndicator extends PureComponent { | |||
<div className="imageViewerLoadingIndicator loadingIndicator"> | |||
<div className="indicatorContents"> | |||
<p> | |||
Loading... <i className="fa fa-spin fa-circle-o-notch fa-fw" />{' '} | |||
Reformatting...{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the translation function for i18n, and remove that {' '} thing
@@ -172,47 +172,53 @@ class OHIFVTKViewport extends Component { | |||
default: | |||
imageDataObject = getImageData(stack.imageIds, displaySetInstanceUid); | |||
|
|||
const loadImageDataPromise = loadImageData(imageDataObject); | |||
//loadImageData(imageDataObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can remove this line
paintFilterLabelMapImageData: null, // TODO | ||
percentComplete: 0, | ||
}, | ||
() => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless callback
@@ -285,6 +321,56 @@ class OHIFVTKViewport extends Component { | |||
} | |||
} | |||
|
|||
loadProgressively() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe pass imageDataObject into the function instead of expecting it in this
? Seems cleaner.
// TODO -> Just do this higher up, call when loadImageData is first | ||
// called and then do this once after all apis are made. | ||
if ( | ||
this.props.viewportIndex === 0 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does viewportIndex matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it only happens once, I'll move this down the viewport 👍 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved down here: OHIF/react-vtkjs-viewport#56
const numViewports = numRows * numColumns; | ||
|
||
if (viewportPropsArray && viewportPropsArray.length !== numViewports) { | ||
reject( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reject with new Error('viewportProps is supplied but its length is not equal to numViewports')
instead of just a string? I thought we had an ESLint rule for that (https://eslint.org/docs/rules/prefer-promise-reject-errors)
@@ -42,3 +53,65 @@ export default function setMPRLayout(displaySet) { | |||
); | |||
}); | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this instead of leaving a massive comment block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending minor changes and a double check of whether or not we still need RAF
Addressed issues and removed RAF successfully. Just need to wait for |
Closes #1051