-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from PaulHax/tf-3d
Opacity and color range function editor for View 3D
- Loading branch information
Showing
28 changed files
with
757 additions
and
282 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@itk-viewer/transfer-function-editor': minor | ||
'@itk-viewer/element': minor | ||
'@itk-viewer/viewer': minor | ||
'@itk-viewer/vtkjs': minor | ||
--- | ||
|
||
Add opacity function editor to View 3D. |
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,19 +1,19 @@ | ||
import { ZarrMultiscaleSpatialImage } from '@itk-viewer/io/ZarrMultiscaleSpatialImage.js'; | ||
import { setPipelineWorkerUrl, setPipelinesBaseUrl } from 'itk-wasm'; | ||
import { ItkViewer3d } from '../src/itk-viewer-3d.js'; | ||
|
||
const pipelineWorkerUrl = '/itk/web-workers/itk-wasm-pipeline.min.worker.js'; | ||
setPipelineWorkerUrl(pipelineWorkerUrl); | ||
const pipelineBaseUrl = '/itk/pipelines'; | ||
setPipelinesBaseUrl(pipelineBaseUrl); | ||
|
||
document.addEventListener('DOMContentLoaded', async function () { | ||
const viewerElement = document.querySelector('#viewer')! as ItkViewer3d; | ||
const viewer = viewerElement.getActor(); | ||
|
||
const imagePath = '/ome-ngff-prototypes/single_image/v0.4/zyx.ome.zarr'; | ||
const url = new URL(imagePath, document.location.origin); | ||
const image = await ZarrMultiscaleSpatialImage.fromUrl(url); | ||
|
||
const viewerElement = document.querySelector('itk-viewer'); | ||
if (!viewerElement) throw new Error('Could not find element'); | ||
const viewer = viewerElement.getActor(); | ||
const zarrImage = await ZarrMultiscaleSpatialImage.fromUrl(url); | ||
|
||
viewer.send({ type: 'setImage', image, name: 'image' }); | ||
viewer!.send({ type: 'setImage', image: zarrImage, name: 'image' }); | ||
}); |
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
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.