Segmentation UI for VTKjs (#1685)
* Add single viewport configuration * Multiple viewport configuration * Improve performance by using independent set methods * Add jump to slice command * Add context configuration * Cache panel visibility * Fix sync between vtk and cornerstone * Remove apis index * Add approach * Add loading to update volumes * Fix broken configuration * Bump vtk version * Use loading label * Update cy tests after vtk loading label changed * Remove loading for segs
This commit is contained in:
1 parent
19a8e71317
commit
42c22df1b6
22 files changed
+516
-173
No files matched your search
@@ -1,5 +1,33 @@
|
||||
import React from 'react';
|
||||
import React, { useContext } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { getActiveContexts } from '../store/layout/selectors.js';
|
||||
|
||||
let AppContext = React.createContext({});
|
||||
|
||||
export const CONTEXTS = {
|
||||
CORNERSTONE: 'ACTIVE_VIEWPORT::CORNERSTONE',
|
||||
VTK: 'ACTIVE_VIEWPORT::VTK'
|
||||
};
|
||||
|
||||
export const useAppContext = () => useContext(AppContext);
|
||||
|
||||
export const AppProvider = ({ children, config }) => {
|
||||
const activeContexts = useSelector(state => getActiveContexts(state));
|
||||
|
||||
return (
|
||||
<AppContext.Provider value={{ appConfig: config, activeContexts }}>
|
||||
{children}
|
||||
</AppContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const withAppContext = Component => {
|
||||
return function WrappedComponent(props) {
|
||||
const { appConfig, activeContexts } = useAppContext();
|
||||
return (
|
||||
<Component {...props} appConfig={appConfig} activeContexts={activeContexts} />
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export default AppContext;
|
||||
Reference in new issue
Block a user