Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Is there any example or doc to config @itk-wasm/dicom in an electron application with vite and vue #1304

Open
MountainAndMorning opened this issue Jan 11, 2025 · 2 comments

Comments

@MountainAndMorning
Copy link

MountainAndMorning commented Jan 11, 2025

Please provide some example about @itk-wasm/dicom like this: https://github.com/InsightSoftwareConsortium/ITK-Wasm/tree/main/examples/vite

@thewtex
Copy link
Member

thewtex commented Jan 14, 2025

@MountainAndMorning
Copy link
Author

MountainAndMorning commented Jan 20, 2025

Thanks.
For use in electron those code is work:

import {
    readImageDicomFileSeries,
    setPipelinesBaseUrl as setDICOMPipelinesBaseUrl,
    getPipelinesBaseUrl as getDICOMPipelinesBaseUrl,
} from "@itk-wasm/dicom"

import {
    readImage,
    setPipelinesBaseUrl as setIOPipelinesBaseUrl,
    getPipelinesBaseUrl as getIOPipelinesBaseUrl,
} from "@itk-wasm/image-io"

// Set pipeline URLs based on environment
if (process.env.NODE_ENV === 'development') {
    setDICOMPipelinesBaseUrl('/node_modules/@itk-wasm/dicom/dist/pipelines');
    setIOPipelinesBaseUrl('/node_modules/@itk-wasm/image-io/dist/pipelines');
} else {
    setDICOMPipelinesBaseUrl('/pipelines');
    setIOPipelinesBaseUrl('/pipelines');
}

Another important point is when create window in electron side, set the nodeIntegrationInWorker to false.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants