-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(extensions/cornerstone) more reusable cornerstone-extension and minor fixes, increased vtk 25.11.1 #3016
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ohif-platform-viewer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for ohif-platform-docs canceled.
|
Codecov Report
@@ Coverage Diff @@
## v3-stable #3016 +/- ##
==============================================
+ Coverage 25.15% 38.27% +13.11%
==============================================
Files 119 98 -21
Lines 2862 2098 -764
Branches 555 432 -123
==============================================
+ Hits 720 803 +83
+ Misses 1856 1060 -796
+ Partials 286 235 -51
Continue to review full report at Codecov.
|
4bf3528
to
f0229d0
Compare
@sedghi awesome segmentation release. |
1b122c3
to
54a0704
Compare
const { | ||
disableViewportImageScrollbar, | ||
disableViewportOverlay, | ||
disableViewportImageSliceLoadingIndicator, | ||
disableViewportOrientationMarkers, | ||
} = props; |
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 group these? maybe into viewportProperties
or something? we are using viewportOptions
in hanging protocol but I don't believe these belong there, maybe they do, what do you think?
} = props; | ||
|
||
const [scrollbarHeight, setScrollbarHeight] = useState('100px'); | ||
|
||
const elementRef = useRef(); | ||
|
||
React.useImperativeHandle(ref, () => elementRef.current); |
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 you are adding a useImperativeHandle?
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.
If a parent passes ref into the DOM which is forwarded, it should refer to the internal elementRef.current
However, if a parent is not passing any ref, the internal of the component should still just rely on elementRef.
VIEWPORT_STACK_SET: 'event::cornerstone::viewportservice:viewportstackset', | ||
VIEWPORT_VOLUME_SET: 'event::cornerstone::viewportservice:viewportvolumeset', |
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 do you need these two events?
We already have STACK_VIEWPORT_NEW_STACK
and VOLUME_VIEWPORT_NEW_VOLUME
in cs3d
@@ -32,6 +32,8 @@ function ViewerLayout({ | |||
rightPanels = [], | |||
leftPanelDefaultClosed = false, | |||
rightPanelDefaultClosed = false, | |||
disableHeader = false, |
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 you add a comment that this can be used for mobile use case for instance (since people might think why one wants to remove the toolbar)
@@ -352,7 +353,9 @@ export default function ModeRoute({ | |||
studyInstanceUIDs[0] !== undefined && | |||
renderLayoutData({ | |||
...layoutTemplateData.current.props, | |||
ViewportGridComp: ViewportGridWithDataSource, | |||
ViewportGridComp: ViewportGridWithDataSourceFactory( | |||
layoutTemplateData.current?.props?.viewportGridProps |
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 don't think this file should be touched. proprs that are returned from modes are layout specific, and all of them are passed to the layout specified (currently we have only one layout that accepts leftPanels, rightPanels). You can just use this viewportGridProps there
servicesManager, | ||
viewportComponents, | ||
dataSource, | ||
modeViewportPaneStyles = {}, |
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.
What is this, there are too many things happening. There is viewoprtGridProps
, modeViewportPaneStyles
and there is customStyle
what is their relationship with each other
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.
Hmmm the challenge is in trying to customize the viewportPane. The desired feature is to turn on and off the border. To toggle this the Mode injects viewportGridProps = { modeViewportPaneStyles = {} }
. I figured if there were future viewport grid props they could easily be added via the mode viewportGridProps
config.
54a0704
to
b73eee9
Compare
…minor fixes Reusability - Use React.forwardRef on cornerstone viewport to allow more reusability - disableHeader and viewerLayoutHeight optional props added to ViewerLayout - Disable border option added to viewpane and viewgridcomp of mode - Expose Expose getActiveViewportEnabledElement command - Expose setEnabledElement on common utils - Optional Overlay Disable Props Fixes - Fix(Overlay was not grabbing instanceNumber) - Add resetCamera in commandsManager for VolumeViewport - Move CornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED so CornerstoneViewportService can update the active element before event fires - Fix CornerstoneCacheService reference - Filter requestImageIds to prevent null values - Reference Line error log
b73eee9
to
84afd86
Compare
@Ouwen Also for this one, any one free you have to work on this? |
Exposes some internals of extensions/cornerstone to be reusable.