-
Notifications
You must be signed in to change notification settings - Fork 4
feat(ViSR): Tomography slice viewer #109
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
Merged
Merged
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
f80ecfd
add sliceViewer file and slider component
Abigail-Yates cfcdbe0
change displayed test image using slider
Abigail-Yates 00b7e96
rearrange tomography views
Abigail-Yates af7f8d1
prettify volume viewer files
Abigail-Yates aa84e50
starting point for tomography slice viewer
tomkane-dls 692ecec
wip - slice viewer creating url for img src
Abigail-Yates 3d8dac8
Merge branch 'tomo-slice-viewer' of github.com:DiamondLightSource/atl…
Abigail-Yates 721193a
wip - view one static slice in z-direction
Abigail-Yates 8035b45
slice through z-axis working
Abigail-Yates e201da4
move slider slice controls into Controls.txk
Abigail-Yates ce378a1
wip - slice view in X direction
Abigail-Yates d0cdc90
added x direction slice view
Abigail-Yates 0083626
add y-direction slices, change views to side-by-side
Abigail-Yates fedd9bb
tidy up
Abigail-Yates 766fdf7
store states in local storage to persist across tabs
Abigail-Yates 94df57e
use Plane enum instead of string
Abigail-Yates cc8bf7d
generalise x and y directions from volumeShape in SliceViewer
Abigail-Yates 6d0cbcd
fix bug changing to Z-plane in two tabs
Abigail-Yates 30adf14
fix slice direction bug and load test data in TomographyView.tsx
Abigail-Yates 3b9b36e
move loading test data to TomographyView for Volume view
Abigail-Yates 0479c28
generalise plane and fix some linting issues
Abigail-Yates d69eb15
wip - use Davidia heatmap to show slices
Abigail-Yates 2679598
use Davidia to show slices
Abigail-Yates fe7b78c
remove axes labels
Abigail-Yates e3b710f
use ndarray.pick to find slice of data. install ndarray-ops.
Abigail-Yates 7d2ee36
tidy up
Abigail-Yates 4051476
update pnpm-lock.yaml
Abigail-Yates ba4761b
fix linting errors
Abigail-Yates 5c7fbde
hide slice view tool bar
Abigail-Yates c0cbfd4
tidy up
Abigail-Yates 5add2fe
remove sliceRenderer, test data. refactoring.
Abigail-Yates d3e7628
Merge branch 'main' into tomo-slice-viewer
Abigail-Yates 4646be6
move createArrayFromView func into utils and start to add tests for it
Abigail-Yates febff8e
fix linting
Abigail-Yates dd11bab
address comments (minWidth and check volumeShape)
Abigail-Yates 77a93bb
Merge branch 'main' of github.com:DiamondLightSource/atlas into tomo-…
Abigail-Yates File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
| export enum Plane { | ||
| X, | ||
| Y, | ||
| Z, | ||
| } |
This file contains hidden or 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,74 @@ | ||
| import { Box, Typography } from "@mui/material"; | ||
| import { Plane } from "./PlaneEnum"; | ||
| import { HeatmapPlot } from "@diamondlightsource/davidia"; | ||
| import ndarray from "ndarray"; | ||
| import createArrayFromView from "../../utils/createArrayFromView"; | ||
|
|
||
| interface Props { | ||
| volumeData: Uint8Array; | ||
| volumeShape: [number, number, number]; | ||
| plane: Plane; | ||
| slice: number; | ||
| } | ||
| export default function SliceViewer({ | ||
| volumeData, | ||
| volumeShape, | ||
| plane, | ||
| slice, | ||
| }: Props) { | ||
| if (volumeData == undefined || volumeShape == undefined) { | ||
| return <Box />; | ||
| } | ||
|
|
||
| const volume = ndarray(volumeData, volumeShape); | ||
| let sliceNdarray: ndarray.NdArray<Uint8Array>; | ||
|
|
||
| switch (plane) { | ||
| case Plane.Z: { | ||
| sliceNdarray = createArrayFromView(volume.pick(slice, null, null)); | ||
| break; | ||
| } | ||
| case Plane.Y: { | ||
| sliceNdarray = createArrayFromView(volume.pick(null, slice, null)); | ||
| break; | ||
| } | ||
| case Plane.X: { | ||
| sliceNdarray = createArrayFromView(volume.pick(null, null, slice)); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <Box | ||
| sx={{ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| height: "100%", | ||
| bgcolor: "background.paper", | ||
| }} | ||
| > | ||
| <Box | ||
| sx={{ | ||
| px: 2, | ||
| py: 1.25, | ||
| borderBottom: 1, | ||
| borderColor: "divider", | ||
| // height: "100%", | ||
| }} | ||
| > | ||
| <Typography variant="overline" color="primary"> | ||
| Slice View | ||
| </Typography> | ||
| </Box> | ||
| <div style={{ display: "grid", height: "100%" }}> | ||
| <HeatmapPlot | ||
| aspect="auto" | ||
| plotConfig={{}} | ||
| values={sliceNdarray} | ||
| domain={[0, 255]} | ||
| customToolbarChildren={null} | ||
| /> | ||
| </div> | ||
| </Box> | ||
| ); | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.