-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3401353
commit ba70897
Showing
25 changed files
with
1,185 additions
and
910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+2.9 MB
examples/vite-redux-toolkit-react-app/public/assets/EX_SITU_2009_UCSD_T1_WEIGHTED.nii.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
examples/vite-redux-toolkit-react-app/src/components/viewers/Dicom/DicomViewer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useState } from 'react'; | ||
import DicomViewer from '@metacell/geppetto-meta-ui/dicom-viewer/preconf/DicomViewer'; | ||
import Loader from "@metacell/geppetto-meta-ui/loader/Loader"; | ||
|
||
const DicomViewerExample: React.FC = () => { | ||
const [ready, setReady] = useState<boolean>(false); | ||
|
||
const onLoaded = () => { | ||
setReady(true); | ||
}; | ||
|
||
const data = '/assets/EX_SITU_2009_UCSD_T1_WEIGHTED.nii.gz'; | ||
|
||
return <> | ||
<Loader active={!ready}/> | ||
<DicomViewer | ||
id="DicomViewer" | ||
data={data} | ||
showDownloadButton={true} | ||
onLoaded={onLoaded} | ||
loaderOptions= {{ showLoader: false }} | ||
toolbarOptions={{ innerDivStyles: { backgroundColor: 'rgb(0,0,0,0)' } }} | ||
/> | ||
</> | ||
}; | ||
|
||
export default DicomViewerExample; |
6 changes: 3 additions & 3 deletions
6
examples/vite-redux-toolkit-react-app/src/layoutManager/componentsMap.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import MyComponent from '../components/MyComponent' | ||
import ThreeDViewer from "../components/viewers/ThreeD/ThreeDViewer.tsx"; | ||
import DicomViewer from "../components/viewers/Dicom/DicomViewer"; | ||
|
||
const componentMap = { | ||
MyComponent, | ||
ThreeDViewer, | ||
'MyComponent': MyComponent, | ||
'Dicom Viewer': DicomViewer | ||
} | ||
|
||
export default componentMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export enum ViewerType { | ||
default = "Default", | ||
ThreeD = "3D", | ||
imageViewer= 'Image Viewer', | ||
dicomViewer= 'Dicom Viewer', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
|
||
const gzipFixPlugin = () => { | ||
const fixHeader = (server) => { | ||
server.middlewares.use((req, res, next) => { | ||
if (req.originalUrl?.includes(".gz")) { | ||
res.setHeader("Content-Type", "gzip"); | ||
res.setHeader("Content-Encoding", "invalid-data"); | ||
} | ||
next(); | ||
}); | ||
}; | ||
|
||
return { | ||
name: "gzip-fix-plugin", | ||
configureServer: fixHeader, | ||
// vite dev and vite preview use different server, so we need to configure both. | ||
configurePreviewServer: fixHeader, | ||
}; | ||
}; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
plugins: [react(), gzipFixPlugin()], | ||
optimizeDeps: { | ||
exclude: ['@metacell/geppetto-meta-core', '@metacell/geppetto-meta-client', '@metacell/geppetto-meta-ui'] | ||
}, | ||
assetsInclude: ['**/*.nii.gz'], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.