Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e381d22200 | ||
|
|
f8546ce0e0 | ||
|
|
973631b7e8 | ||
|
|
e0f42d4f1d | ||
|
|
2800f82e3c | ||
|
|
38214f26de | ||
|
|
cb6cdafd24 | ||
|
|
aa1ba771e0 | ||
|
|
d4153f12b2 | ||
|
|
71c50db9b5 | ||
|
|
4cdcd34a33 | ||
|
|
0dfd321326 | ||
|
|
0fcebe05c6 | ||
|
|
ac45a9497f | ||
|
|
03b180f185 | ||
|
|
e1bc625ab8 | ||
|
|
661ecb5b2e | ||
|
|
b7c8b865dd | ||
|
|
ee165b4d8e |
No files matched your search
@@ -117,8 +117,9 @@ jobs:
|
||||
# would otherwise pick up the repo-root netlify.toml (configured for the
|
||||
# main viewer app) and build the wrong project. --dir is resolved
|
||||
# relative to the repo root (the netlify.toml base), not the cwd, so it
|
||||
# must be the full path to the prebuilt docs output.
|
||||
run: npx netlify-cli deploy --dir=platform/docs/build --prod --no-build
|
||||
# must be the full path to the prebuilt docs output. --filter selects
|
||||
# the ohif-docs package so Netlify CLI does not abort on monorepo detection.
|
||||
run: npx netlify-cli deploy --filter ohif-docs --dir=platform/docs/build --prod --no-build
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
@@ -23,6 +23,7 @@ concurrency:
|
||||
jobs:
|
||||
playwright-tests:
|
||||
timeout-minutes: 120
|
||||
environment: fork-pr-approval
|
||||
runs-on: [self-hosted, nashua]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone-dicom-pmap",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "DICOM Parametric Map read workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/adapters": "5.0.2",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/adapters": "5.1.3",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@kitware/vtk.js": "35.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone-dicom-rt",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "DICOM RT read workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone-dicom-seg",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "DICOM SEG read workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/adapters": "5.0.2",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/adapters": "5.1.3",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@kitware/vtk.js": "35.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone-dicom-sr",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for an SR Cornerstone Viewport",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -40,9 +40,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/adapters": "5.0.2",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/adapters": "5.1.3",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"classnames": "2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone-dynamic-volume",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for 4D volumes data",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -45,8 +45,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"classnames": "2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for Cornerstone",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -38,7 +38,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/dicom-image-loader": "5.0.2",
|
||||
"@cornerstonejs/dicom-image-loader": "5.1.3",
|
||||
"@ohif/core": "workspace:*",
|
||||
"@ohif/extension-default": "workspace:*",
|
||||
"@ohif/ui": "workspace:*",
|
||||
@@ -52,13 +52,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/adapters": "5.0.2",
|
||||
"@cornerstonejs/ai": "5.0.2",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/labelmap-interpolation": "5.0.2",
|
||||
"@cornerstonejs/metadata": "5.0.2",
|
||||
"@cornerstonejs/polymorphic-segmentation": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/adapters": "5.1.3",
|
||||
"@cornerstonejs/ai": "5.1.3",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/labelmap-interpolation": "5.1.3",
|
||||
"@cornerstonejs/metadata": "5.1.3",
|
||||
"@cornerstonejs/polymorphic-segmentation": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"@icr/polyseg-wasm": "0.4.0",
|
||||
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
|
||||
"@kitware/vtk.js": "35.5.3",
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
annotation,
|
||||
Types as ToolTypes,
|
||||
SplineContourSegmentationTool,
|
||||
cancelActiveManipulations,
|
||||
} from '@cornerstonejs/tools';
|
||||
import {
|
||||
SegmentInfo,
|
||||
@@ -306,6 +307,20 @@ function commandsModule({
|
||||
commandsManager.run('setDisplaySetsForViewports', { viewportsToUpdate: updatedViewports });
|
||||
},
|
||||
|
||||
/**
|
||||
* Cancels any in-progress annotation manipulation (e.g. drawing a Spline,
|
||||
* Livewire or PlanarFreehand contour) on the active viewport. Reached on
|
||||
* Escape via the `cancelActiveOperation` command. `cancelActiveManipulations`
|
||||
* invokes the `cancel` method of each active/passive tool that has an
|
||||
* in-progress annotation, so it is a no-op when nothing is being drawn.
|
||||
*/
|
||||
cancelMeasurement: () => {
|
||||
const element = _getActiveViewportEnabledElement()?.viewport?.element;
|
||||
if (element) {
|
||||
cancelActiveManipulations(element);
|
||||
}
|
||||
},
|
||||
|
||||
hydrateSecondaryDisplaySet: async ({ displaySet, viewportId }) => {
|
||||
if (!displaySet) {
|
||||
return;
|
||||
@@ -2028,6 +2043,24 @@ function commandsModule({
|
||||
rejectPreview: () => {
|
||||
actions._handlePreviewAction('reject');
|
||||
},
|
||||
/**
|
||||
* Generic Escape handler. A single Escape press should discard whatever the
|
||||
* user has in progress, but that can be one of two unrelated things: a
|
||||
* provisional segmentation preview, or an annotation being drawn. Rather
|
||||
* than bind both `rejectPreview` and `cancelMeasurement` to `esc` (Mousetrap
|
||||
* keeps only one handler per key, so the second silently shadows the first),
|
||||
* this command orchestrates both single-purpose commands. Each is a no-op
|
||||
* when its state is not active, so running both is safe and order-independent.
|
||||
*/
|
||||
cancelActiveOperation: () => {
|
||||
try {
|
||||
actions.rejectPreview();
|
||||
} catch (error) {
|
||||
console.debug('Error rejecting active preview', error);
|
||||
} finally {
|
||||
actions.cancelMeasurement();
|
||||
}
|
||||
},
|
||||
clearMarkersForMarkerLabelmap: () => {
|
||||
const { viewport } = _getActiveViewportEnabledElement();
|
||||
const toolGroup = cornerstoneTools.ToolGroupManager.getToolGroupForViewport(viewport.id);
|
||||
@@ -2550,6 +2583,9 @@ function commandsModule({
|
||||
removeMeasurement: {
|
||||
commandFn: actions.removeMeasurement,
|
||||
},
|
||||
cancelMeasurement: {
|
||||
commandFn: actions.cancelMeasurement,
|
||||
},
|
||||
toggleLockMeasurement: {
|
||||
commandFn: actions.toggleLockMeasurement,
|
||||
},
|
||||
@@ -2798,6 +2834,7 @@ function commandsModule({
|
||||
toggleSegmentSelect: actions.toggleSegmentSelect,
|
||||
acceptPreview: actions.acceptPreview,
|
||||
rejectPreview: actions.rejectPreview,
|
||||
cancelActiveOperation: actions.cancelActiveOperation,
|
||||
toggleUseCenterSegmentIndex: actions.toggleUseCenterSegmentIndex,
|
||||
toggleLabelmapAssist: actions.toggleLabelmapAssist,
|
||||
interpolateScrollForMarkerLabelmap: actions.interpolateScrollForMarkerLabelmap,
|
||||
|
||||
@@ -60,11 +60,11 @@ const DicomUploadProgressItem = memo(
|
||||
/>
|
||||
);
|
||||
case UploadStatus.InProgress:
|
||||
return <Icons.ByName name="icon-transferring" />;
|
||||
return <Icons.ByName name="icon-transferring" className="text-highlight" />;
|
||||
case UploadStatus.Failed:
|
||||
return <Icons.ByName name="icon-alert-small" />;
|
||||
return <Icons.ByName name="icon-alert-small" className="text-destructive" />;
|
||||
case UploadStatus.Cancelled:
|
||||
return <Icons.ByName name="icon-alert-outline" />;
|
||||
return <Icons.ByName name="icon-alert-outline" className="text-highlight" />;
|
||||
default:
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ function TrackingStatus({ viewportId }: { viewportId: string }) {
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<span>
|
||||
<Icons.StatusTracking className="h-4 w-4" />
|
||||
<Icons.StatusTracking className="h-4 w-4 text-highlight" />
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
|
||||
@@ -531,10 +531,8 @@ const connectMeasurementServiceToTools = ({
|
||||
}
|
||||
// Cancel any active tool manipulation (e.g., Spline/Livewire) to avoid leaving the tool
|
||||
// in a drawing state after deleting a not completed measurement, which can block viewport interactivity.
|
||||
const element = getActiveViewportEnabledElement(viewportGridService)?.viewport?.element;
|
||||
if (element) {
|
||||
cancelActiveManipulations(element);
|
||||
}
|
||||
commandsManager.run('cancelMeasurement');
|
||||
|
||||
const removedAnnotation = annotation.state.getAnnotation(removedMeasurementId);
|
||||
removeAnnotation(removedMeasurementId);
|
||||
// Ensure `removedAnnotation` is available before triggering the memo,
|
||||
|
||||
+11
-6
@@ -88,12 +88,17 @@ const segmentationRepresentationModifiedCallback = async (
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure the segmentation representation aligns with the target viewport type.
|
||||
const type: Enums.SegmentationRepresentations =
|
||||
isVolume3DViewportType(viewport)
|
||||
? Enums.SegmentationRepresentations.Surface
|
||||
: ((segmentationRepresentationType as Enums.SegmentationRepresentations) ??
|
||||
Enums.SegmentationRepresentations.Labelmap);
|
||||
// Ensure the segmentation representation aligns with the target viewport type
|
||||
const is3D = isVolume3DViewportType(viewport);
|
||||
const requestedRepresentation =
|
||||
segmentationRepresentationType as Enums.SegmentationRepresentations;
|
||||
const { Surface, Labelmap } = Enums.SegmentationRepresentations;
|
||||
|
||||
const type: Enums.SegmentationRepresentations = is3D
|
||||
? Surface
|
||||
: requestedRepresentation && requestedRepresentation !== Surface
|
||||
? requestedRepresentation
|
||||
: Labelmap;
|
||||
|
||||
await segmentationService.addSegmentationRepresentation(targetViewportId, {
|
||||
segmentationId,
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
utilities as csUtils,
|
||||
cache,
|
||||
Enums as csEnums,
|
||||
metaData,
|
||||
} from '@cornerstonejs/core';
|
||||
|
||||
import { utilities as csToolsUtils, Enums as csToolsEnums } from '@cornerstonejs/tools';
|
||||
@@ -849,10 +850,21 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
|
||||
_presentations: Presentations = {}
|
||||
): Promise<void> {
|
||||
const [displaySet] = viewportData.data;
|
||||
// CS3D's "redo viewports" replaced setDataIds with the generic
|
||||
// setDisplaySets({ displaySetId }) API; the legacy adapters key off
|
||||
// imageIds[0] as the displaySetId, so do the same here.
|
||||
await viewport.setDisplaySets({ displaySetId: displaySet.imageIds[0] });
|
||||
const displaySetId = displaySet.imageIds[0];
|
||||
// Register the WSI dataset so the viewport can resolve its imageIds +
|
||||
// webClient by display-set id, then mount via setDisplaySets. The webClient
|
||||
// was registered under the WADO_WEB_CLIENT module (keyed by imageIds[0]) by
|
||||
// the SM SOP class handler. CS3D's "redo viewports" reads this same registry
|
||||
// (genericViewportDisplaySetMetadataProvider) from its WSI data provider;
|
||||
// without this entry setDisplaySets throws "No registered WSI dataset" and
|
||||
// the viewport renders gray.
|
||||
const webClient = metaData.get(csEnums.MetadataModules.WADO_WEB_CLIENT, displaySetId);
|
||||
csUtils.genericViewportDisplaySetMetadataProvider.add(displaySetId, {
|
||||
imageIds: displaySet.imageIds,
|
||||
kind: 'wsi',
|
||||
options: { webClient },
|
||||
});
|
||||
await viewport.setDisplaySets({ displaySetId });
|
||||
const viewReference = viewportInfo.getViewReference();
|
||||
if (viewReference) {
|
||||
viewport.setViewReference(viewReference);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-default",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Common/default features and functionality for basic image viewing",
|
||||
"author": "OHIF Core Team",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -152,7 +152,7 @@ function DataSourceConfigurationModalComponent({
|
||||
>
|
||||
<div className="text- flex items-center gap-2">
|
||||
{itemLabelIndex < selectedItems.length ? (
|
||||
<Icons.ByName name="status-tracked" />
|
||||
<Icons.ByName name="status-tracked" className="text-highlight" />
|
||||
) : (
|
||||
<Icons.ByName name="status-untracked" />
|
||||
)}
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
.dicom-tag-browser-table tr {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
color: #ffffff;
|
||||
border-top: 1px solid #ddd;
|
||||
color: hsl(var(--foreground));
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -43,7 +42,6 @@
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
text-align: center;
|
||||
color: '#20A5D6';
|
||||
}
|
||||
|
||||
.dicom-tag-browser-table th.dicom-tag-browser-table-left {
|
||||
|
||||
@@ -18,6 +18,7 @@ import getDirectURL from '../utils/getDirectURL';
|
||||
import { fixBulkDataURI } from './utils/fixBulkDataURI';
|
||||
import { HeadersInterface } from '@ohif/core/src/types/RequestHeaders';
|
||||
import { getGetThumbnailSrc, ThumbnailContext } from './retrieveThumbnail';
|
||||
import { getRenderedURL } from './retrieveRendered';
|
||||
|
||||
const { DicomMetaDictionary, DicomDict } = dcmjs.data;
|
||||
|
||||
@@ -108,7 +109,6 @@ export type BulkDataURIConfig = {
|
||||
relativeResolution?: 'studies' | 'series';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The header options are the options passed into the generateWadoHeader
|
||||
* command. This takes an extensible set of attributes to allow future enhancements.
|
||||
@@ -291,6 +291,14 @@ function createDicomWebApi(dicomWebConfig: DicomWebConfig, servicesManager) {
|
||||
params
|
||||
);
|
||||
},
|
||||
renderedURL: (params, options) => {
|
||||
return getRenderedURL({
|
||||
config: dicomWebConfig,
|
||||
getAuthorizationHeader,
|
||||
retrieve: implementation.retrieve,
|
||||
userAuthenticationService,
|
||||
})(params, options);
|
||||
},
|
||||
/**
|
||||
* Provide direct access to the dicom web client for certain use cases
|
||||
* where the dicom web client is used by an external library such as the
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
import { fetchRenderedURL, getRenderedURL, isTrustedWadoURL } from './retrieveRendered';
|
||||
|
||||
describe('retrieveRendered', () => {
|
||||
const originalFetch = global.fetch;
|
||||
const originalCreateObjectURL = URL.createObjectURL;
|
||||
const originalRevokeObjectURL = URL.revokeObjectURL;
|
||||
|
||||
beforeEach(() => {
|
||||
global.fetch = jest.fn();
|
||||
URL.createObjectURL = jest.fn(() => 'blob:rendered') as jest.Mock;
|
||||
URL.revokeObjectURL = jest.fn() as jest.Mock;
|
||||
jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
global.fetch = originalFetch;
|
||||
URL.createObjectURL = originalCreateObjectURL;
|
||||
URL.revokeObjectURL = originalRevokeObjectURL;
|
||||
});
|
||||
|
||||
it('returns null when there is no resolved URL', async () => {
|
||||
const result = await fetchRenderedURL({
|
||||
url: undefined,
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
});
|
||||
|
||||
expect(result).toEqual({ url: null });
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns the direct URL without fetching when there is no authorization header', async () => {
|
||||
const result = await fetchRenderedURL({
|
||||
url: 'https://example.com/dicomweb/rendered',
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: {},
|
||||
});
|
||||
|
||||
expect(result).toEqual({ url: 'https://example.com/dicomweb/rendered' });
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not attach auth headers to untrusted absolute URLs', async () => {
|
||||
const result = await fetchRenderedURL({
|
||||
url: 'https://untrusted.example.com/rendered',
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
});
|
||||
|
||||
expect(result).toEqual({ url: 'https://untrusted.example.com/rendered' });
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('fetches trusted URLs with auth and returns a revocable object URL', async () => {
|
||||
(global.fetch as jest.Mock).mockResolvedValueOnce({
|
||||
ok: true,
|
||||
blob: jest.fn().mockResolvedValueOnce(new Blob(['pdf'], { type: 'application/pdf' })),
|
||||
});
|
||||
|
||||
const result = await fetchRenderedURL({
|
||||
url: 'https://example.com/dicomweb/studies/1/rendered',
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
});
|
||||
|
||||
expect(global.fetch).toHaveBeenCalledWith(
|
||||
'https://example.com/dicomweb/studies/1/rendered',
|
||||
expect.objectContaining({
|
||||
method: 'GET',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
})
|
||||
);
|
||||
expect(result.url).toBe('blob:rendered');
|
||||
|
||||
result.revoke?.();
|
||||
result.revoke?.();
|
||||
|
||||
expect(URL.revokeObjectURL).toHaveBeenCalledTimes(1);
|
||||
expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:rendered');
|
||||
});
|
||||
|
||||
it('returns null and triggers unauthenticated handling on 401/403 responses', async () => {
|
||||
const handleUnauthenticated = jest.fn();
|
||||
(global.fetch as jest.Mock).mockResolvedValueOnce({
|
||||
ok: false,
|
||||
status: 401,
|
||||
});
|
||||
|
||||
const result = await fetchRenderedURL({
|
||||
url: 'https://example.com/dicomweb/studies/1/rendered',
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
userAuthenticationService: { handleUnauthenticated },
|
||||
});
|
||||
|
||||
expect(result).toEqual({ url: null });
|
||||
expect(handleUnauthenticated).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('revokes an object URL created after the request was aborted', async () => {
|
||||
const abortController = new AbortController();
|
||||
(global.fetch as jest.Mock).mockResolvedValueOnce({
|
||||
ok: true,
|
||||
blob: jest.fn().mockImplementationOnce(async () => {
|
||||
abortController.abort();
|
||||
return new Blob(['pdf'], { type: 'application/pdf' });
|
||||
}),
|
||||
});
|
||||
|
||||
const result = await fetchRenderedURL({
|
||||
url: 'https://example.com/dicomweb/studies/1/rendered',
|
||||
wadoRoot: 'https://example.com/dicomweb',
|
||||
headers: { Authorization: 'Bearer token' },
|
||||
signal: abortController.signal,
|
||||
});
|
||||
|
||||
expect(result).toEqual({ url: null });
|
||||
expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:rendered');
|
||||
});
|
||||
|
||||
it('resolves directURL through the datasource retrieve API', async () => {
|
||||
const renderedURL = getRenderedURL({
|
||||
config: { wadoRoot: 'https://example.com/dicomweb' },
|
||||
getAuthorizationHeader: () => ({}),
|
||||
retrieve: {
|
||||
directURL: jest.fn().mockResolvedValueOnce('https://example.com/dicomweb/rendered'),
|
||||
},
|
||||
});
|
||||
|
||||
await expect(renderedURL({ instance: {} })).resolves.toEqual({
|
||||
url: 'https://example.com/dicomweb/rendered',
|
||||
});
|
||||
});
|
||||
|
||||
it('trusts URLs that share the configured WADO origin', () => {
|
||||
expect(
|
||||
isTrustedWadoURL('/dicomweb/studies/1/rendered', `${window.location.origin}/dicomweb`)
|
||||
).toBe(true);
|
||||
expect(
|
||||
isTrustedWadoURL(
|
||||
'https://other.example.com/dicomweb/studies/1/rendered',
|
||||
'https://example.com/dicomweb'
|
||||
)
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,141 @@
|
||||
import { HeadersInterface } from '@ohif/core/src/types/RequestHeaders';
|
||||
|
||||
type RetrieveApi = {
|
||||
directURL: (params: unknown) => unknown;
|
||||
};
|
||||
|
||||
type RenderedURLConfig = {
|
||||
wadoRoot?: string;
|
||||
};
|
||||
|
||||
type UserAuthenticationService = {
|
||||
handleUnauthenticated?: () => unknown;
|
||||
};
|
||||
|
||||
type GetRenderedURLDeps = {
|
||||
config: RenderedURLConfig;
|
||||
getAuthorizationHeader: () => HeadersInterface;
|
||||
retrieve: RetrieveApi;
|
||||
userAuthenticationService?: UserAuthenticationService;
|
||||
};
|
||||
|
||||
type RenderedURLOptions = {
|
||||
signal?: AbortSignal;
|
||||
};
|
||||
|
||||
type FetchRenderedURLOptions = RenderedURLOptions & {
|
||||
url?: string | null;
|
||||
wadoRoot?: string;
|
||||
headers?: HeadersInterface;
|
||||
userAuthenticationService?: UserAuthenticationService;
|
||||
};
|
||||
|
||||
export type RenderedURLResult = {
|
||||
url: string | null;
|
||||
revoke?: () => void;
|
||||
};
|
||||
|
||||
export function getRenderedURL({
|
||||
config,
|
||||
getAuthorizationHeader,
|
||||
retrieve,
|
||||
userAuthenticationService,
|
||||
}: GetRenderedURLDeps) {
|
||||
return async function renderedURL(
|
||||
params: unknown,
|
||||
options: RenderedURLOptions = {}
|
||||
): Promise<RenderedURLResult> {
|
||||
const resolvedUrl = (await retrieve.directURL(params)) as string | undefined | null;
|
||||
|
||||
return fetchRenderedURL({
|
||||
url: resolvedUrl,
|
||||
wadoRoot: config.wadoRoot,
|
||||
headers: getAuthorizationHeader(),
|
||||
signal: options.signal,
|
||||
userAuthenticationService,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export async function fetchRenderedURL({
|
||||
url,
|
||||
wadoRoot,
|
||||
headers,
|
||||
signal,
|
||||
userAuthenticationService,
|
||||
}: FetchRenderedURLOptions): Promise<RenderedURLResult> {
|
||||
if (!url || signal?.aborted) {
|
||||
return { url: null };
|
||||
}
|
||||
|
||||
if (!headers?.Authorization || !isTrustedWadoURL(url, wadoRoot)) {
|
||||
return { url };
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
method: 'GET',
|
||||
headers: headers as Record<string, string>,
|
||||
signal,
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
if (response.status === 401 || response.status === 403) {
|
||||
userAuthenticationService?.handleUnauthenticated?.();
|
||||
}
|
||||
console.warn(`rendered media fetch failed with status ${response.status}`);
|
||||
return { url: null };
|
||||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
|
||||
if (signal?.aborted) {
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
return { url: null };
|
||||
}
|
||||
|
||||
return {
|
||||
url: objectUrl,
|
||||
revoke: createRevokeOnce(objectUrl),
|
||||
};
|
||||
} catch (error) {
|
||||
if ((error as { name?: string })?.name === 'AbortError') {
|
||||
return { url: null };
|
||||
}
|
||||
|
||||
console.warn('rendered media fetch failed', error);
|
||||
return { url: null };
|
||||
}
|
||||
}
|
||||
|
||||
export function isTrustedWadoURL(url: string, wadoRoot?: string): boolean {
|
||||
if (!wadoRoot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
const parsedUrl = new URL(url, window.location.href);
|
||||
const parsedWadoRoot = new URL(wadoRoot, window.location.href);
|
||||
const isHttpUrl = parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:';
|
||||
const isHttpWadoRoot =
|
||||
parsedWadoRoot.protocol === 'http:' || parsedWadoRoot.protocol === 'https:';
|
||||
|
||||
return isHttpUrl && isHttpWadoRoot && parsedUrl.origin === parsedWadoRoot.origin;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function createRevokeOnce(objectUrl: string) {
|
||||
let revoked = false;
|
||||
|
||||
return () => {
|
||||
if (revoked) {
|
||||
return;
|
||||
}
|
||||
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
revoked = true;
|
||||
};
|
||||
}
|
||||
@@ -52,6 +52,7 @@ function createDicomWebProxyApi(dicomWebProxyConfig, servicesManager: AppTypes.S
|
||||
retrieve: {
|
||||
getGetThumbnailSrc: (...args) => dicomWebDelegate.retrieve.getGetThumbnailSrc(...args),
|
||||
directURL: (...args) => dicomWebDelegate.retrieve.directURL(...args),
|
||||
renderedURL: (...args) => dicomWebDelegate.retrieve.renderedURL(...args),
|
||||
series: {
|
||||
metadata: async (...args) => dicomWebDelegate.retrieve.series.metadata(...args),
|
||||
},
|
||||
@@ -62,7 +63,8 @@ function createDicomWebProxyApi(dicomWebProxyConfig, servicesManager: AppTypes.S
|
||||
reject: {
|
||||
series: (...args) => dicomWebDelegate?.reject?.series?.(...args),
|
||||
},
|
||||
deleteStudyMetadataPromise: (...args) => dicomWebDelegate?.deleteStudyMetadataPromise?.(...args),
|
||||
deleteStudyMetadataPromise: (...args) =>
|
||||
dicomWebDelegate?.deleteStudyMetadataPromise?.(...args),
|
||||
getImageIdsForDisplaySet: (...args) => dicomWebDelegate?.getImageIdsForDisplaySet?.(...args),
|
||||
getImageIdsForInstance: (...args) => dicomWebDelegate?.getImageIdsForInstance?.(...args),
|
||||
getConfig: (...args) =>
|
||||
|
||||
@@ -242,6 +242,24 @@ function createMergeDataSourceApi(
|
||||
defaultDataSourceName,
|
||||
extensionManager,
|
||||
}),
|
||||
renderedURL: (...args: unknown[]) => {
|
||||
const [dataSource] = extensionManager.getDataSources(defaultDataSourceName);
|
||||
const renderedURL = get(dataSource, 'retrieve.renderedURL');
|
||||
|
||||
if (renderedURL) {
|
||||
return renderedURL.apply(dataSource, args);
|
||||
}
|
||||
|
||||
const directURL = get(dataSource, 'retrieve.directURL');
|
||||
|
||||
if (!directURL) {
|
||||
return Promise.resolve({ url: null });
|
||||
}
|
||||
|
||||
return Promise.resolve(directURL.apply(dataSource, [args[0]])).then(url => ({
|
||||
url: (url as string | undefined | null) || null,
|
||||
}));
|
||||
},
|
||||
series: {
|
||||
metadata: (...args: unknown[]) =>
|
||||
callForAllDataSourcesAsync({
|
||||
|
||||
@@ -43,6 +43,10 @@ function ViewerHeader({ appConfig }: withAppTypes<{ appConfig: AppTypes.Config }
|
||||
'ohif.aboutModal'
|
||||
) as Types.MenuComponentCustomization;
|
||||
|
||||
const AppearanceModal = customizationService.getCustomization(
|
||||
'ohif.appearanceModal'
|
||||
) as Types.MenuComponentCustomization;
|
||||
|
||||
const UserPreferencesModal = customizationService.getCustomization(
|
||||
'ohif.userPreferencesModal'
|
||||
) as Types.MenuComponentCustomization;
|
||||
@@ -71,6 +75,19 @@ function ViewerHeader({ appConfig }: withAppTypes<{ appConfig: AppTypes.Config }
|
||||
},
|
||||
];
|
||||
|
||||
if (AppearanceModal) {
|
||||
menuOptions.splice(1, 0, {
|
||||
title: AppearanceModal.menuTitle ?? t('Header:Appearance'),
|
||||
icon: 'ColorChange',
|
||||
onClick: () =>
|
||||
show({
|
||||
content: AppearanceModal,
|
||||
title: AppearanceModal.title ?? t('AppearanceModal:Appearance'),
|
||||
containerClassName: AppearanceModal.containerClassName ?? 'max-w-md',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (appConfig.oidc) {
|
||||
menuOptions.push({
|
||||
title: t('Header:Logout'),
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
AppearanceModal,
|
||||
Select,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
Button,
|
||||
useActiveTheme,
|
||||
themePresets,
|
||||
} from '@ohif/ui-next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
function AppearanceModalDefault() {
|
||||
const { activeTheme, setActiveTheme, customCss, applyCustomTheme, clearCustomTheme } =
|
||||
useActiveTheme();
|
||||
const { t } = useTranslation('AppearanceModal');
|
||||
|
||||
const [draftCss, setDraftCss] = React.useState(() => customCss);
|
||||
const [isCustomOpen, setIsCustomOpen] = React.useState(() => activeTheme === 'custom');
|
||||
const [parseFailed, setParseFailed] = React.useState(false);
|
||||
|
||||
const handleToggleCustom = () => {
|
||||
setIsCustomOpen(!isCustomOpen);
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
setParseFailed(!applyCustomTheme(draftCss));
|
||||
};
|
||||
|
||||
const handleClear = () => {
|
||||
clearCustomTheme();
|
||||
setDraftCss('');
|
||||
setParseFailed(false);
|
||||
setIsCustomOpen(false);
|
||||
};
|
||||
|
||||
const handlePresetChange = (value: string) => {
|
||||
if (value === 'custom') {
|
||||
// Selecting "Custom" restores the saved custom theme; the draft is only
|
||||
// committed through the explicit Apply button.
|
||||
setIsCustomOpen(true);
|
||||
if (customCss) {
|
||||
applyCustomTheme(customCss);
|
||||
}
|
||||
} else {
|
||||
setIsCustomOpen(false);
|
||||
setActiveTheme(value);
|
||||
}
|
||||
};
|
||||
|
||||
const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||
setDraftCss(e.target.value);
|
||||
setParseFailed(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<AppearanceModal>
|
||||
<AppearanceModal.Body>
|
||||
<div className="grid grid-cols-[auto_1fr] items-center gap-x-6 gap-y-4">
|
||||
<AppearanceModal.SectionLabel>{t('Theme')}</AppearanceModal.SectionLabel>
|
||||
<div>
|
||||
<Select
|
||||
value={activeTheme}
|
||||
onValueChange={handlePresetChange}
|
||||
>
|
||||
<SelectTrigger
|
||||
className="w-[200px]"
|
||||
aria-label={t('Theme')}
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="default">{t('Default Theme')}</SelectItem>
|
||||
{themePresets.map(preset => (
|
||||
<SelectItem
|
||||
key={preset.name}
|
||||
value={preset.name}
|
||||
>
|
||||
{preset.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
{(customCss || draftCss) && <SelectItem value="custom">{t('Custom')}</SelectItem>}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="col-start-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={handleToggleCustom}
|
||||
>
|
||||
{isCustomOpen ? t('Hide') : t('Custom Theme')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isCustomOpen && (
|
||||
<div className="mt-4 flex flex-col space-y-2">
|
||||
<textarea
|
||||
value={draftCss}
|
||||
onChange={handleTextChange}
|
||||
placeholder={t('Paste your custom theme color tokens here')}
|
||||
aria-label={t('Paste your custom theme color tokens here')}
|
||||
rows={8}
|
||||
className="bg-muted text-foreground border-input placeholder:text-muted-foreground focus:ring-ring rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-inset"
|
||||
/>
|
||||
{parseFailed && (
|
||||
<span
|
||||
className="text-destructive text-sm"
|
||||
role="alert"
|
||||
>
|
||||
{t('No valid theme tokens found')}
|
||||
</span>
|
||||
)}
|
||||
<div className="flex space-x-2">
|
||||
<Button
|
||||
variant="default"
|
||||
size="sm"
|
||||
onClick={handleSave}
|
||||
>
|
||||
{t('Apply')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={handleClear}
|
||||
>
|
||||
{t('Clear')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</AppearanceModal.Body>
|
||||
</AppearanceModal>
|
||||
);
|
||||
}
|
||||
|
||||
export default {
|
||||
'ohif.appearanceModal': AppearanceModalDefault,
|
||||
};
|
||||
@@ -18,6 +18,7 @@ import progressLoadingBarCustomization from './customizations/progressLoadingBar
|
||||
import labellingFlowCustomization from './customizations/labellingFlowCustomization';
|
||||
import viewportNotificationCustomization from './customizations/notificationCustomization';
|
||||
import aboutModalCustomization from './customizations/aboutModalCustomization';
|
||||
import appearanceModalCustomization from './customizations/appearanceModalCustomization';
|
||||
import userPreferencesCustomization from './customizations/userPreferencesCustomization';
|
||||
import reportDialogCustomization from './customizations/reportDialogCustomization';
|
||||
import hotkeyBindingsCustomization from './customizations/hotkeyBindingsCustomization';
|
||||
@@ -39,6 +40,10 @@ export default function getCustomizationModule({ servicesManager, extensionManag
|
||||
name: 'helloPage',
|
||||
value: helloPageCustomization,
|
||||
},
|
||||
{
|
||||
name: 'theme',
|
||||
value: appearanceModalCustomization,
|
||||
},
|
||||
{
|
||||
name: 'datasources',
|
||||
value: datasourcesCustomization,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DicomMetadataStore, classes } from '@ohif/core';
|
||||
import { calculateSUVScalingFactors } from '@cornerstonejs/calculate-suv';
|
||||
import { ActiveThemeProvider } from '@ohif/ui-next';
|
||||
|
||||
import getPTImageIdInstanceMetadata from './getPTImageIdInstanceMetadata';
|
||||
import { registerHangingProtocolAttributes } from './hangingprotocols';
|
||||
@@ -16,7 +17,18 @@ export default function init({
|
||||
servicesManager,
|
||||
commandsManager,
|
||||
hotkeysManager,
|
||||
serviceProvidersManager,
|
||||
appConfig,
|
||||
}: withAppTypes): void {
|
||||
const hasThemeModule =
|
||||
Array.isArray(appConfig.customizationService) &&
|
||||
appConfig.customizationService.some(
|
||||
ref => typeof ref === 'string' && ref.includes('customizationModule.theme')
|
||||
);
|
||||
|
||||
if (hasThemeModule) {
|
||||
serviceProvidersManager.registerProvider('activeTheme', ActiveThemeProvider);
|
||||
}
|
||||
const { toolbarService, cineService, viewportGridService } = servicesManager.services;
|
||||
|
||||
toolbarService.registerEventForToolbarUpdate(cineService, [
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.chrome-picker {
|
||||
background: #090c29 !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-dicom-microscopy",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for DICOM microscopy",
|
||||
"author": "Bill Wallace, md-prog",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-dicom-pdf",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for PDF display",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -14,12 +14,17 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
const { Modality, SOPInstanceUID } = instance;
|
||||
const { SeriesDescription = 'PDF', MIMETypeOfEncapsulatedDocument } = instance;
|
||||
const { SeriesNumber, SeriesDate, SeriesInstanceUID, StudyInstanceUID, SOPClassUID } = instance;
|
||||
const renderedUrl = dataSource.retrieve.directURL({
|
||||
const renderedUrlParams = {
|
||||
instance,
|
||||
tag: 'EncapsulatedDocument',
|
||||
defaultType: MIMETypeOfEncapsulatedDocument || 'application/pdf',
|
||||
singlepart: 'pdf',
|
||||
});
|
||||
};
|
||||
const renderedUrl = dataSource.retrieve.directURL(renderedUrlParams);
|
||||
const getRenderedUrl = dataSource.retrieve.renderedURL
|
||||
? options =>
|
||||
dataSource.retrieve.renderedURL({ ...renderedUrlParams, url: renderedUrl }, options)
|
||||
: undefined;
|
||||
|
||||
const displaySet = {
|
||||
//plugin: id,
|
||||
@@ -36,6 +41,7 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
referencedImages: null,
|
||||
measurements: null,
|
||||
renderedUrl: renderedUrl,
|
||||
getRenderedUrl,
|
||||
instances: [instance],
|
||||
thumbnailSrc: null,
|
||||
isDerivedDisplaySet: true,
|
||||
|
||||
@@ -28,15 +28,9 @@ const dicomPDFExtension = {
|
||||
* @param {object} [configuration={}]
|
||||
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
||||
*/
|
||||
getViewportModule({ servicesManager, extensionManager }) {
|
||||
getViewportModule() {
|
||||
const ExtendedOHIFCornerstonePdfViewport = props => {
|
||||
return (
|
||||
<OHIFCornerstonePdfViewport
|
||||
servicesManager={servicesManager}
|
||||
extensionManager={extensionManager}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <OHIFCornerstonePdfViewport {...props} />;
|
||||
};
|
||||
|
||||
return [{ name: 'dicom-pdf', component: ExtendedOHIFCornerstonePdfViewport }];
|
||||
|
||||
@@ -33,14 +33,43 @@ function OHIFCornerstonePdfViewport({ displaySets, viewportId = 'pdf-viewport' }
|
||||
}
|
||||
|
||||
const { renderedUrl } = displaySets[0];
|
||||
const { getRenderedUrl } = displaySets[0];
|
||||
|
||||
useEffect(() => {
|
||||
let isCancelled = false;
|
||||
let revokeUrl;
|
||||
const abortController = new AbortController();
|
||||
|
||||
const load = async () => {
|
||||
setUrl(await renderedUrl);
|
||||
try {
|
||||
const result = getRenderedUrl
|
||||
? await getRenderedUrl({ signal: abortController.signal })
|
||||
: { url: await renderedUrl };
|
||||
|
||||
if (isCancelled) {
|
||||
result?.revoke?.();
|
||||
return;
|
||||
}
|
||||
|
||||
revokeUrl = result?.revoke;
|
||||
setUrl(result?.url || null);
|
||||
} catch (error) {
|
||||
console.warn('Failed to load PDF', error);
|
||||
if (!isCancelled) {
|
||||
setUrl(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
}, [renderedUrl]);
|
||||
|
||||
return () => {
|
||||
isCancelled = true;
|
||||
abortController.abort();
|
||||
revokeUrl?.();
|
||||
};
|
||||
}, [renderedUrl, getRenderedUrl]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-dicom-video",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for video display",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -57,12 +57,16 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
const { Modality, SOPInstanceUID, SeriesDescription = 'VIDEO', imageId } = instance;
|
||||
const { SeriesNumber, SeriesDate, SeriesInstanceUID, StudyInstanceUID, NumberOfFrames, url } =
|
||||
instance;
|
||||
const videoUrl = dataSource.retrieve.directURL({
|
||||
const videoUrlParams = {
|
||||
instance,
|
||||
singlepart: 'video',
|
||||
tag: 'PixelData',
|
||||
url,
|
||||
});
|
||||
};
|
||||
const videoUrl = dataSource.retrieve.directURL(videoUrlParams);
|
||||
const getVideoUrl = dataSource.retrieve.renderedURL
|
||||
? options => dataSource.retrieve.renderedURL({ ...videoUrlParams, url: videoUrl }, options)
|
||||
: undefined;
|
||||
const displaySet = {
|
||||
//plugin: id,
|
||||
Modality,
|
||||
@@ -76,6 +80,8 @@ const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager)
|
||||
SOPClassHandlerId,
|
||||
referencedImages: null,
|
||||
measurements: null,
|
||||
videoUrl,
|
||||
getVideoUrl,
|
||||
viewportType: csEnums.ViewportType.VIDEO,
|
||||
instances: [instance],
|
||||
getThumbnailSrc: dataSource.retrieve.getGetThumbnailSrc?.(instance),
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
import React from 'react';
|
||||
import getSopClassHandlerModule from './getSopClassHandlerModule';
|
||||
import { id } from './id';
|
||||
|
||||
const Component = React.lazy(() => {
|
||||
return import(/* webpackPrefetch: true */ './viewports/OHIFCornerstoneVideoViewport');
|
||||
});
|
||||
|
||||
const OHIFCornerstoneVideoViewport = props => {
|
||||
return (
|
||||
<React.Suspense fallback={<div>Loading...</div>}>
|
||||
<Component {...props} />
|
||||
</React.Suspense>
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -23,38 +10,7 @@ const dicomVideoExtension = {
|
||||
*/
|
||||
id,
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {object} [configuration={}]
|
||||
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
||||
*/
|
||||
getViewportModule({ servicesManager, extensionManager }) {
|
||||
const ExtendedOHIFCornerstoneVideoViewport = props => {
|
||||
return (
|
||||
<OHIFCornerstoneVideoViewport
|
||||
servicesManager={servicesManager}
|
||||
extensionManager={extensionManager}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return [{ name: 'dicom-video', component: ExtendedOHIFCornerstoneVideoViewport }];
|
||||
},
|
||||
getSopClassHandlerModule,
|
||||
};
|
||||
|
||||
function _getToolAlias(toolName) {
|
||||
let toolAlias = toolName;
|
||||
|
||||
switch (toolName) {
|
||||
case 'EllipticalRoi':
|
||||
toolAlias = 'SREllipticalRoi';
|
||||
break;
|
||||
}
|
||||
|
||||
return toolAlias;
|
||||
}
|
||||
|
||||
export default dicomVideoExtension;
|
||||
@@ -1,55 +0,0 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
function OHIFCornerstoneVideoViewport({ displaySets }) {
|
||||
if (displaySets && displaySets.length > 1) {
|
||||
throw new Error(
|
||||
'OHIFCornerstoneVideoViewport: only one display set is supported for dicom video right now'
|
||||
);
|
||||
}
|
||||
|
||||
const { videoUrl } = displaySets[0];
|
||||
const mimeType = 'video/mp4';
|
||||
const [url, setUrl] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const load = async () => {
|
||||
setUrl(await videoUrl);
|
||||
};
|
||||
|
||||
load();
|
||||
}, [videoUrl]);
|
||||
|
||||
// Need to copies of the source to fix a firefox bug
|
||||
return (
|
||||
<div className="bg-primary-black h-full w-full">
|
||||
<video
|
||||
src={url}
|
||||
controls
|
||||
controlsList="nodownload"
|
||||
preload="auto"
|
||||
className="h-full w-full"
|
||||
crossOrigin="anonymous"
|
||||
>
|
||||
<source
|
||||
src={url}
|
||||
type={mimeType}
|
||||
/>
|
||||
<source
|
||||
src={url}
|
||||
type={mimeType}
|
||||
/>
|
||||
Video src/type not supported:{' '}
|
||||
<a href={url}>
|
||||
{url} of type {mimeType}
|
||||
</a>
|
||||
</video>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
OHIFCornerstoneVideoViewport.propTypes = {
|
||||
displaySets: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
};
|
||||
|
||||
export default OHIFCornerstoneVideoViewport;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-measurement-tracking",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Tracking features and functionality for basic image viewing",
|
||||
"author": "OHIF Core Team",
|
||||
"license": "MIT",
|
||||
@@ -27,8 +27,8 @@
|
||||
"start": "pnpm run dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"@ohif/core": "workspace:*",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "workspace:*",
|
||||
"@ohif/extension-default": "workspace:*",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-test",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension used inside e2e testing",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-tmtv",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF extension for Total Metabolic Tumor Volume",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-ultrasound-pleura-bline",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "",
|
||||
"author": "Rodrigo Basilio",
|
||||
"license": "MIT",
|
||||
@@ -36,8 +36,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"@ohif/core": "workspace:*",
|
||||
"@ohif/extension-cornerstone": "workspace:*",
|
||||
"@ohif/extension-default": "workspace:*",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-basic-dev-mode",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Basic OHIF Viewer Using Cornerstone",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -26,7 +26,6 @@ const dicomsr = {
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
@@ -141,11 +140,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
viewports: [
|
||||
{
|
||||
namespace: cs3d.viewport,
|
||||
displaySetsToDisplay: [ohif.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomvideo.viewport,
|
||||
displaySetsToDisplay: [dicomvideo.sopClassHandler],
|
||||
displaySetsToDisplay: [ohif.sopClassHandler, dicomvideo.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicompdf.viewport,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-test",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Basic mode for testing",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -33,7 +33,6 @@ const dicomsr = {
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
@@ -254,10 +253,6 @@ function modeFactory() {
|
||||
namespace: dicomsr.viewport,
|
||||
displaySetsToDisplay: [dicomsr.sopClassHandler, dicomsr.sopClassHandler3D],
|
||||
},
|
||||
{
|
||||
namespace: dicomvideo.viewport,
|
||||
displaySetsToDisplay: [dicomvideo.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicompdf.viewport,
|
||||
displaySetsToDisplay: [dicompdf.sopClassHandler],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-basic",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "A basic mode used to build other modes on top of",
|
||||
"author": "OHIF Contributors",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -44,7 +44,6 @@ export const dicomsr = {
|
||||
|
||||
export const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
export const dicomecg = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-longitudinal",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Longitudinal Workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-microscopy",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF mode for DICOM microscopy",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -17,7 +17,6 @@ export const cornerstone = {
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
@@ -107,7 +106,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
],
|
||||
},
|
||||
{
|
||||
namespace: dicomvideo.viewport,
|
||||
namespace: cornerstone.viewport,
|
||||
displaySetsToDisplay: [dicomvideo.sopClassHandler],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-preclinical-4d",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "4D Workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-segmentation",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
|
||||
"author": "@ohif",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-tmtv",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Total Metabolic Tumor Volume Workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/mode-ultrasound-pleura-bline",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Allows users to annotate ultrasound images with pleura B-line annotations.",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -29,8 +29,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.29.7",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/tools": "5.0.2",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/tools": "5.1.3",
|
||||
"@ohif/core": "workspace:*",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "workspace:*",
|
||||
"@ohif/extension-ultrasound-pleura-bline": "workspace:*",
|
||||
|
||||
@@ -32,7 +32,6 @@ const dicomsr = {
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
X-Frame-Options = "DENY"
|
||||
X-XSS-Protection = "1; mode=block"
|
||||
|
||||
# Report-Only CSP: observational only, enforces nothing. Watch browser
|
||||
# consoles for violation reports before ever promoting this to an
|
||||
# enforcing Content-Security-Policy header. cdnjs.cloudflare.com is for
|
||||
# the Rollbar snippet in html-templates/rollbar.html (demo builds);
|
||||
# connect-src stays broad because deployments point the viewer at
|
||||
# arbitrary DICOMweb origins.
|
||||
Content-Security-Policy-Report-Only = "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https: blob:; worker-src 'self' blob:; object-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
|
||||
|
||||
cache-control = '''
|
||||
max-age=0,
|
||||
no-cache,
|
||||
|
||||
+1
-1
@@ -124,5 +124,5 @@
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"version": "3.13.0-beta.103"
|
||||
"version": "3.13.0-beta.112"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# Copy this file to .env next to docker-compose.yml and fill in strong
|
||||
# values. docker compose refuses to start while either is unset.
|
||||
KEYCLOAK_ADMIN_PASSWORD=
|
||||
# POSTGRES_PASSWORD is the single PostgreSQL credential: it provisions the
|
||||
# keycloak database role and Keycloak reuses it to connect (KC_DB_PASSWORD is
|
||||
# derived from it in docker-compose.yml), so there is one value, not two.
|
||||
POSTGRES_PASSWORD=
|
||||
@@ -0,0 +1,42 @@
|
||||
# Security notes for this recipe
|
||||
|
||||
## Secrets
|
||||
|
||||
This recipe no longer ships working credential values. Before `docker compose up`:
|
||||
|
||||
- Generate a fresh OAuth client secret for the `ohif_viewer` client and use it
|
||||
to replace the `REPLACE_WITH_A_GENERATED_CLIENT_SECRET` placeholder in BOTH
|
||||
`config/ohif-keycloak-realm.json` and `config/oauth2-proxy.cfg` (the two
|
||||
values must match). To generate one after the realm is imported: Keycloak
|
||||
admin console -> Clients -> ohif_viewer -> Credentials -> Regenerate.
|
||||
- Copy `.env.example` to `.env` and set `POSTGRES_PASSWORD` and
|
||||
`KEYCLOAK_ADMIN_PASSWORD` to strong values. `docker compose` refuses to
|
||||
start while either is unset. `POSTGRES_PASSWORD` is the single PostgreSQL
|
||||
credential - it both provisions the `keycloak` database role and is what
|
||||
Keycloak uses to connect (the compose file derives `KC_DB_PASSWORD` from it),
|
||||
so there is one database password to set, not two.
|
||||
|
||||
## Rotate if you deployed from an earlier checkout
|
||||
|
||||
Earlier versions of this recipe committed a fixed client secret and default
|
||||
admin/database passwords to the public repository. A committed secret stays
|
||||
burned even after this change, so any deployment created from an earlier
|
||||
checkout must rotate:
|
||||
|
||||
- the `ohif_viewer` client secret (Keycloak admin console -> Clients ->
|
||||
ohif_viewer -> Credentials -> Regenerate, then update
|
||||
`config/oauth2-proxy.cfg` to match), and
|
||||
- the Keycloak admin and PostgreSQL passwords. Note that changing
|
||||
`POSTGRES_PASSWORD` in `.env` alone does not re-password an existing
|
||||
database: Postgres only applies it when the `postgres_data` volume is first
|
||||
initialized. To actually rotate it on an existing deployment, either
|
||||
`ALTER ROLE keycloak WITH PASSWORD ...` inside the running database or
|
||||
recreate the `postgres_data` volume.
|
||||
|
||||
## CORS
|
||||
|
||||
The wildcard `Access-Control-Allow-Origin: *` defaults were removed from
|
||||
`config/nginx.conf`. The viewer is served by the same nginx as the dcm4chee
|
||||
proxy, so same-origin deployments need no CORS headers. If you host the viewer
|
||||
on a different origin, use the commented explicit-origin example in the nginx
|
||||
config - never `*` on an authenticated endpoint that serves PHI.
|
||||
@@ -54,6 +54,15 @@ http {
|
||||
gzip_comp_level 9;
|
||||
etag on;
|
||||
|
||||
# Content-Security-Policy: test in Report-Only mode first and watch
|
||||
# the browser console for violations before switching the header name
|
||||
# to the enforcing Content-Security-Policy. Note: nginx add_header does
|
||||
# not merge into a location that sets its own add_header - if you
|
||||
# promote this to an active header, re-declare it inside every location
|
||||
# block that already uses add_header (several proxy locations here do)
|
||||
# or it will silently not apply there.
|
||||
# add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https: blob:; worker-src 'self' blob:; object-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
|
||||
|
||||
location /sw.js {
|
||||
add_header Cache-Control "no-cache";
|
||||
proxy_cache_bypass $http_pragma;
|
||||
@@ -101,19 +110,25 @@ http {
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
# CORS: this recipe serves the viewer from this same nginx, so
|
||||
# browser requests to this endpoint are same-origin and need NO
|
||||
# CORS headers at all. If you host the viewer on a different
|
||||
# origin, allow that origin explicitly and only that origin -
|
||||
# never use '*' on an authenticated endpoint that serves PHI.
|
||||
# Cross-origin example (response headers plus OPTIONS preflight):
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com' always;
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
#
|
||||
# if ($request_method = OPTIONS) {
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com';
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
# add_header 'Access-Control-Max-Age' 1728000;
|
||||
# add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
# add_header 'Content-Length' 0;
|
||||
# return 204;
|
||||
# }
|
||||
|
||||
rewrite ^/pacs/(.*) /dcm4chee-arc/aets/DCM4CHEE/rs/$1 break;
|
||||
proxy_pass http://arc:8080;
|
||||
@@ -155,19 +170,8 @@ http {
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
# CORS: same-origin deployment - no CORS headers needed here; see
|
||||
# the note on the /pacs/ location above before adding any.
|
||||
|
||||
proxy_pass http://arc:8080;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ email_domains=["*"]
|
||||
cookie_secure="false"
|
||||
cookie_expire="9m30s"
|
||||
cookie_refresh="5m"
|
||||
client_secret="2Xtlde7aozdkzzYHdIxQNfPDr0wNPTgg"
|
||||
client_secret="REPLACE_WITH_A_GENERATED_CLIENT_SECRET"
|
||||
client_id="ohif_viewer"
|
||||
redirect_url="http://YOUR_DOMAIN/oauth2/callback"
|
||||
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret": "2Xtlde7aozdkzzYHdIxQNfPDr0wNPTgg",
|
||||
"secret": "REPLACE_WITH_A_GENERATED_CLIENT_SECRET",
|
||||
"redirectUris": [
|
||||
"http://127.0.0.1/oauth2/callback"
|
||||
],
|
||||
|
||||
@@ -94,14 +94,17 @@ services:
|
||||
KC_DB_URL: 'jdbc:postgresql://postgres:5432/keycloak'
|
||||
KC_DB_SCHEMA: public
|
||||
KC_DB_USERNAME: keycloak
|
||||
KC_DB_PASSWORD: password
|
||||
# Keycloak authenticates to Postgres as the keycloak role provisioned
|
||||
# below, so this must be the same value as POSTGRES_PASSWORD. Sourced
|
||||
# from the single POSTGRES_PASSWORD variable to keep them in lockstep.
|
||||
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in your .env}
|
||||
KC_HOSTNAME_ADMIN_URL: http://YOUR_DOMAIN/keycloak/
|
||||
KC_HOSTNAME_URL: http://YOUR_DOMAIN/keycloak/
|
||||
KC_HOSTNAME_STRICT_BACKCHANNEL: true
|
||||
KC_HOSTNAME_STRICT_HTTPS: false
|
||||
KC_HTTP_ENABLED: true
|
||||
KEYCLOAK_ADMIN: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?set KEYCLOAK_ADMIN_PASSWORD in your .env}
|
||||
KC_HEALTH_ENABLED: true
|
||||
KC_METRICS_ENABLED: true
|
||||
KC_PROXY: edge
|
||||
@@ -139,7 +142,7 @@ services:
|
||||
environment:
|
||||
POSTGRES_DB: keycloak
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in your .env}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- default
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Copy this file to .env next to docker-compose.yml and fill in strong
|
||||
# values. docker compose refuses to start while either is unset.
|
||||
KEYCLOAK_ADMIN_PASSWORD=
|
||||
# POSTGRES_PASSWORD is the single PostgreSQL credential: it provisions the
|
||||
# keycloak database role and Keycloak reuses it to connect (KC_DB_PASSWORD is
|
||||
# derived from it in docker-compose.yml), so there is one value, not two.
|
||||
POSTGRES_PASSWORD=
|
||||
@@ -0,0 +1,42 @@
|
||||
# Security notes for this recipe
|
||||
|
||||
## Secrets
|
||||
|
||||
This recipe no longer ships working credential values. Before `docker compose up`:
|
||||
|
||||
- Generate a fresh OAuth client secret for the `ohif_viewer` client and use it
|
||||
to replace the `REPLACE_WITH_A_GENERATED_CLIENT_SECRET` placeholder in BOTH
|
||||
`config/ohif-keycloak-realm.json` and `config/oauth2-proxy.cfg` (the two
|
||||
values must match). To generate one after the realm is imported: Keycloak
|
||||
admin console -> Clients -> ohif_viewer -> Credentials -> Regenerate.
|
||||
- Copy `.env.example` to `.env` and set `POSTGRES_PASSWORD` and
|
||||
`KEYCLOAK_ADMIN_PASSWORD` to strong values. `docker compose` refuses to
|
||||
start while either is unset. `POSTGRES_PASSWORD` is the single PostgreSQL
|
||||
credential - it both provisions the `keycloak` database role and is what
|
||||
Keycloak uses to connect (the compose file derives `KC_DB_PASSWORD` from it),
|
||||
so there is one database password to set, not two.
|
||||
|
||||
## Rotate if you deployed from an earlier checkout
|
||||
|
||||
Earlier versions of this recipe committed a fixed client secret and default
|
||||
admin/database passwords to the public repository. A committed secret stays
|
||||
burned even after this change, so any deployment created from an earlier
|
||||
checkout must rotate:
|
||||
|
||||
- the `ohif_viewer` client secret (Keycloak admin console -> Clients ->
|
||||
ohif_viewer -> Credentials -> Regenerate, then update
|
||||
`config/oauth2-proxy.cfg` to match), and
|
||||
- the Keycloak admin and PostgreSQL passwords. Note that changing
|
||||
`POSTGRES_PASSWORD` in `.env` alone does not re-password an existing
|
||||
database: Postgres only applies it when the `postgres_data` volume is first
|
||||
initialized. To actually rotate it on an existing deployment, either
|
||||
`ALTER ROLE keycloak WITH PASSWORD ...` inside the running database or
|
||||
recreate the `postgres_data` volume.
|
||||
|
||||
## CORS
|
||||
|
||||
The wildcard `Access-Control-Allow-Origin: *` defaults were removed from
|
||||
`config/nginx.conf`. The viewer is served by the same nginx as the DICOMweb
|
||||
proxy, so same-origin deployments need no CORS headers. If you host the viewer
|
||||
on a different origin, use the commented explicit-origin example in the nginx
|
||||
config - never `*` on an authenticated endpoint that serves PHI.
|
||||
@@ -50,6 +50,15 @@ http {
|
||||
gzip_comp_level 9;
|
||||
etag on;
|
||||
|
||||
# Content-Security-Policy: test in Report-Only mode first and watch
|
||||
# the browser console for violations before switching the header name
|
||||
# to the enforcing Content-Security-Policy. Note: nginx add_header does
|
||||
# not merge into a location that sets its own add_header - if you
|
||||
# promote this to an active header, re-declare it inside every location
|
||||
# block that already uses add_header (several proxy locations here do)
|
||||
# or it will silently not apply there.
|
||||
# add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https: blob:; worker-src 'self' blob:; object-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
|
||||
|
||||
location /sw.js {
|
||||
add_header Cache-Control "no-cache";
|
||||
proxy_cache_bypass $http_pragma;
|
||||
@@ -105,19 +114,25 @@ http {
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
# CORS: this recipe serves the viewer from this same nginx, so
|
||||
# browser requests to this endpoint are same-origin and need NO
|
||||
# CORS headers at all. If you host the viewer on a different
|
||||
# origin, allow that origin explicitly and only that origin -
|
||||
# never use '*' on an authenticated endpoint that serves PHI.
|
||||
# Cross-origin example (response headers plus OPTIONS preflight):
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com' always;
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
#
|
||||
# if ($request_method = OPTIONS) {
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com';
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
# add_header 'Access-Control-Max-Age' 1728000;
|
||||
# add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
# add_header 'Content-Length' 0;
|
||||
# return 204;
|
||||
# }
|
||||
|
||||
proxy_pass http://orthanc:8042/;
|
||||
}
|
||||
@@ -137,19 +152,25 @@ http {
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
# CORS: this recipe serves the viewer from this same nginx, so
|
||||
# browser requests to this endpoint are same-origin and need NO
|
||||
# CORS headers at all. If you host the viewer on a different
|
||||
# origin, allow that origin explicitly and only that origin -
|
||||
# never use '*' on an authenticated endpoint that serves PHI.
|
||||
# Cross-origin example (response headers plus OPTIONS preflight):
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com' always;
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept' always;
|
||||
#
|
||||
# if ($request_method = OPTIONS) {
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com';
|
||||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
# add_header 'Access-Control-Allow-Headers' 'Authorization, Origin, X-Requested-With, Content-Type, Accept';
|
||||
# add_header 'Access-Control-Max-Age' 1728000;
|
||||
# add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
# add_header 'Content-Length' 0;
|
||||
# return 204;
|
||||
# }
|
||||
|
||||
proxy_pass http://orthanc:8042/dicom-web/;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ email_domains=["*"]
|
||||
cookie_secure="false"
|
||||
cookie_expire="9m30s"
|
||||
cookie_refresh="5m"
|
||||
client_secret="2Xtlde7aozdkzzYHdIxQNfPDr0wNPTgg"
|
||||
client_secret="REPLACE_WITH_A_GENERATED_CLIENT_SECRET"
|
||||
client_id="ohif_viewer"
|
||||
redirect_url="http://YOUR_DOMAIN/oauth2/callback"
|
||||
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": false,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret": "2Xtlde7aozdkzzYHdIxQNfPDr0wNPTgg",
|
||||
"secret": "REPLACE_WITH_A_GENERATED_CLIENT_SECRET",
|
||||
"redirectUris": [
|
||||
"http://127.0.0.1/oauth2/callback"
|
||||
],
|
||||
|
||||
@@ -51,14 +51,17 @@ services:
|
||||
KC_DB_URL: 'jdbc:postgresql://postgres:5432/keycloak'
|
||||
KC_DB_SCHEMA: public
|
||||
KC_DB_USERNAME: keycloak
|
||||
KC_DB_PASSWORD: password
|
||||
# Keycloak authenticates to Postgres as the keycloak role provisioned
|
||||
# below, so this must be the same value as POSTGRES_PASSWORD. Sourced
|
||||
# from the single POSTGRES_PASSWORD variable to keep them in lockstep.
|
||||
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in your .env}
|
||||
KC_HOSTNAME_ADMIN_URL: http://YOUR_DOMAIN/keycloak/
|
||||
KC_HOSTNAME_URL: http://YOUR_DOMAIN/keycloak/
|
||||
KC_HOSTNAME_STRICT_BACKCHANNEL: true
|
||||
KC_HOSTNAME_STRICT_HTTPS: false
|
||||
KC_HTTP_ENABLED: true
|
||||
KEYCLOAK_ADMIN: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?set KEYCLOAK_ADMIN_PASSWORD in your .env}
|
||||
KC_HEALTH_ENABLED: true
|
||||
KC_METRICS_ENABLED: true
|
||||
KC_PROXY: edge
|
||||
@@ -104,7 +107,7 @@ services:
|
||||
environment:
|
||||
POSTGRES_DB: keycloak
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in your .env}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- default
|
||||
|
||||
@@ -24,3 +24,12 @@ localhost/pacs -> Orthanc
|
||||
|
||||
|
||||
See [here](../../../docs/docs/deployment/nginx--image-archive.md) for more information about this recipe.
|
||||
|
||||
# Security notes
|
||||
|
||||
- CORS: earlier versions of this recipe set `Access-Control-Allow-Origin: *`
|
||||
on the `/pacs/` proxy. That default has been removed. The viewer is served
|
||||
by the same nginx as the proxy, so same-origin deployments need no CORS
|
||||
headers. If you host the viewer on a different origin, set that origin
|
||||
explicitly in `config/nginx.conf` - never `*` on an endpoint that serves
|
||||
PHI.
|
||||
@@ -32,6 +32,15 @@ http {
|
||||
gzip_comp_level 9;
|
||||
etag on;
|
||||
|
||||
# Content-Security-Policy: test in Report-Only mode first and watch the
|
||||
# browser console for violations before switching the header name to the
|
||||
# enforcing Content-Security-Policy. Note: nginx add_header does not merge
|
||||
# into a location that sets its own add_header - if you promote this to an
|
||||
# active header, re-declare it inside every location block that already
|
||||
# uses add_header (the /pacs/ proxy here does) or it will silently not
|
||||
# apply there.
|
||||
# add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https: blob:; worker-src 'self' blob:; object-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
|
||||
|
||||
|
||||
# Reverse Proxy for `orthanc` APIs (including DICOMWeb)
|
||||
#
|
||||
@@ -47,17 +56,14 @@ http {
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
# Add CORS headers
|
||||
# Note: uncomment the following line to allow all domains to access the Orthanc APIs
|
||||
# You should actually only allow the domains you trust to access the APIs
|
||||
# add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
# CORS: this recipe serves the viewer from this same nginx, so browser
|
||||
# requests to /pacs/ are same-origin and need NO CORS header at all.
|
||||
# If you host the viewer on a different origin, allow that origin
|
||||
# explicitly and only that origin - never use '*' on an endpoint that
|
||||
# serves PHI. Example:
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com' always;
|
||||
|
||||
proxy_pass http://orthanc:8042/;
|
||||
|
||||
# By default, this endpoint is protected by CORS (cross-origin-resource-sharing)
|
||||
# You can add headers to allow other domains to request this resource.
|
||||
# See the "Updating CORS Settings" example below
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2800f82e3cd02d991146af3f2887fca18c4ab161
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/app",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"productVersion": "3.4.0",
|
||||
"description": "OHIF Viewer",
|
||||
"author": "OHIF Contributors",
|
||||
@@ -51,7 +51,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/dicom-image-loader": "5.0.2",
|
||||
"@cornerstonejs/dicom-image-loader": "5.1.3",
|
||||
"@emotion/serialize": "1.3.3",
|
||||
"@ohif/core": "workspace:*",
|
||||
"@ohif/i18n": "workspace:*",
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
window.config = {
|
||||
routerBasename: null,
|
||||
customizationService: [
|
||||
'@ohif/extension-default.customizationModule.theme',
|
||||
],
|
||||
extensions: [],
|
||||
modes: [],
|
||||
showStudyList: true,
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!--
|
||||
Content-Security-Policy is delivered via hosting headers (netlify.toml
|
||||
for Netlify deploys; commented add_header examples in the nginx
|
||||
recipes under platform/app/.recipes), not as a meta tag: a meta tag
|
||||
cannot express Report-Only mode. See the deployment docs
|
||||
(docs/deployment) for the policy and the criteria for promoting it
|
||||
from Report-Only to enforcing.
|
||||
-->
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
|
||||
@@ -15,7 +15,7 @@ const NotFound = ({
|
||||
return (
|
||||
<div className="absolute flex h-full w-full items-center justify-center bg-background">
|
||||
<div className="flex flex-col">
|
||||
<div className="bg-background flex items-center justify-center rounded-t-2xl p-6">
|
||||
<div className="bg-background flex items-center justify-center rounded-t-2xl p-6 text-primary">
|
||||
<Icons.IllustrationNotFound />
|
||||
</div>
|
||||
<div className="bg-input h-px" />
|
||||
|
||||
@@ -30,7 +30,7 @@ export function defaultSettingsMenuItems({
|
||||
const items: SettingsMenuItem[] = [
|
||||
{
|
||||
id: 'about',
|
||||
label: 'About OHIF Viewer',
|
||||
label: t('Header:About'),
|
||||
onClick: () => {
|
||||
const AboutModal = customizationService.getCustomization('ohif.aboutModal');
|
||||
show({
|
||||
@@ -42,7 +42,7 @@ export function defaultSettingsMenuItems({
|
||||
},
|
||||
{
|
||||
id: 'userPreferences',
|
||||
label: 'User Preferences',
|
||||
label: t('Header:Preferences'),
|
||||
onClick: () => {
|
||||
const UserPreferencesModal = customizationService.getCustomization(
|
||||
'ohif.userPreferencesModal'
|
||||
@@ -57,6 +57,21 @@ export function defaultSettingsMenuItems({
|
||||
},
|
||||
];
|
||||
|
||||
const AppearanceModal = customizationService.getCustomization('ohif.appearanceModal');
|
||||
if (AppearanceModal) {
|
||||
items.splice(1, 0, {
|
||||
id: 'appearance',
|
||||
label: AppearanceModal.menuTitle ?? t('Header:Appearance'),
|
||||
onClick: () => {
|
||||
show({
|
||||
content: AppearanceModal,
|
||||
title: AppearanceModal.title ?? t('AppearanceModal:Appearance'),
|
||||
containerClassName: AppearanceModal.containerClassName ?? 'max-w-md',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (appConfig.oidc) {
|
||||
items.push({
|
||||
id: 'logout',
|
||||
@@ -107,7 +122,7 @@ export function StudyListSettingsPopover() {
|
||||
>
|
||||
<Icons.SettingsStudyList
|
||||
aria-hidden="true"
|
||||
className="h-4 w-4"
|
||||
className="text-primary h-4 w-4"
|
||||
/>
|
||||
</Button>
|
||||
</StudyList.SettingsPopover.Trigger>
|
||||
|
||||
@@ -107,7 +107,7 @@ export default function WorkList({
|
||||
isLoading={showStudyListLoading}
|
||||
loadingComponent={
|
||||
LoadingIndicatorProgress ? (
|
||||
<LoadingIndicatorProgress className="!relative bg-black" />
|
||||
<LoadingIndicatorProgress className="bg-background !relative" />
|
||||
) : (
|
||||
<div className="h-8 w-8" />
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ import CallbackPage from '../routes/CallbackPage';
|
||||
import SignoutCallbackComponent from '../routes/SignoutCallbackComponent';
|
||||
import LegacyClient from './legacyOIDCClient';
|
||||
import NextClient from './nextOIDCClient';
|
||||
import { sanitizeSameOriginRedirect } from './sanitizeRedirect';
|
||||
|
||||
function _isAbsoluteUrl(url) {
|
||||
return url.includes('http://') || url.includes('https://');
|
||||
@@ -55,7 +56,10 @@ function LogoutComponent(props) {
|
||||
const location = useLocation();
|
||||
const query = new URLSearchParams(location.search);
|
||||
userManager.signoutRedirect({
|
||||
post_logout_redirect_uri: query.get('redirect_uri'),
|
||||
post_logout_redirect_uri: sanitizeSameOriginRedirect(
|
||||
query.get('redirect_uri'),
|
||||
window.location.origin
|
||||
),
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { sanitizeSameOriginRedirect } from './sanitizeRedirect';
|
||||
|
||||
describe('sanitizeSameOriginRedirect', () => {
|
||||
const origin = 'https://viewer.example.com';
|
||||
|
||||
it('returns the same href back for an absolute same-origin URL', () => {
|
||||
expect(sanitizeSameOriginRedirect('https://viewer.example.com/worklist?a=1', origin)).toBe(
|
||||
'https://viewer.example.com/worklist?a=1'
|
||||
);
|
||||
});
|
||||
|
||||
it('resolves relative paths against the app origin', () => {
|
||||
expect(sanitizeSameOriginRedirect('/worklist', origin)).toBe(
|
||||
'https://viewer.example.com/worklist'
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects an absolute cross-origin URL', () => {
|
||||
expect(sanitizeSameOriginRedirect('https://evil.example.com/', origin)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('rejects a protocol-relative cross-origin URL', () => {
|
||||
expect(sanitizeSameOriginRedirect('//evil.example.com/x', origin)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('rejects javascript: scheme values', () => {
|
||||
expect(sanitizeSameOriginRedirect('javascript:alert(1)', origin)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('rejects null and empty values', () => {
|
||||
expect(sanitizeSameOriginRedirect(null, origin)).toBeUndefined();
|
||||
expect(sanitizeSameOriginRedirect('', origin)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('rejects lookalike hosts that merely start with the app host', () => {
|
||||
expect(
|
||||
sanitizeSameOriginRedirect('https://viewer.example.com.evil.com/', origin)
|
||||
).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Returns the given redirect target only when it resolves to the provided
|
||||
* origin; otherwise returns undefined so callers fall back to the configured
|
||||
* post-logout destination.
|
||||
*/
|
||||
export function sanitizeSameOriginRedirect(
|
||||
value: string | null,
|
||||
origin: string
|
||||
): string | undefined {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
const url = new URL(value, origin);
|
||||
if (url.origin !== origin) {
|
||||
return undefined;
|
||||
}
|
||||
return url.href;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
3.13.0-beta.110-new-one-click
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/cli",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "A CLI to bootstrap new OHIF extension or mode",
|
||||
"type": "module",
|
||||
"main": "src/index.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/core",
|
||||
"version": "3.13.0-beta.103",
|
||||
"version": "3.13.0-beta.112",
|
||||
"description": "Generic business logic for web-based medical imaging applications",
|
||||
"author": "OHIF Core Team",
|
||||
"license": "MIT",
|
||||
@@ -35,9 +35,9 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/core": "5.0.2",
|
||||
"@cornerstonejs/dicom-image-loader": "5.0.2",
|
||||
"@cornerstonejs/metadata": "5.0.2",
|
||||
"@cornerstonejs/core": "5.1.3",
|
||||
"@cornerstonejs/dicom-image-loader": "5.1.3",
|
||||
"@cornerstonejs/metadata": "5.1.3",
|
||||
"@ohif/ui": "workspace:*",
|
||||
"cornerstone-math": "0.1.10",
|
||||
"dicom-parser": "1.8.21"
|
||||
|
||||
@@ -134,8 +134,8 @@ const bindings = [
|
||||
isEditable: true,
|
||||
},
|
||||
{
|
||||
commandName: 'cancelMeasurement',
|
||||
label: 'Cancel Measurement',
|
||||
commandName: 'cancelActiveOperation',
|
||||
label: 'Cancel',
|
||||
keys: ['esc'],
|
||||
},
|
||||
{
|
||||
@@ -172,11 +172,6 @@ const bindings = [
|
||||
label: 'Accept Preview',
|
||||
keys: ['enter'],
|
||||
},
|
||||
{
|
||||
commandName: 'rejectPreview',
|
||||
label: 'Reject Preview',
|
||||
keys: ['esc'],
|
||||
},
|
||||
{
|
||||
commandName: 'undo',
|
||||
label: 'Undo',
|
||||
|
||||
@@ -118,6 +118,7 @@ window.config = ({ servicesManager } = {}) => {
|
||||
|
||||
|
||||
Here are a list of some options available:
|
||||
- `customizationService`: An array of customization module references and inline overrides applied at the global scope. This is how deployers enable optional features like the [Appearance & Theming](./ui.md) system and configure UI components without modifying core code. See [Customization Service](../platform/services/customization-service/customizationService.md) for the full syntax reference.
|
||||
- `disableEditing`: If true, it disables editing in OHIF, hiding edit buttons in segmentation
|
||||
panel and locking already stored measurements.
|
||||
- `maxNumberOfWebWorkers`: The maximum number of web workers to use for
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
sidebar_label: UI & Appearance
|
||||
title: UI & Appearance
|
||||
summary: Overview of OHIF's UI system — the component library, theming and appearance customization, iconography, and the services that drive modals, dialogs, notifications, and viewport layout.
|
||||
---
|
||||
|
||||
# UI & Appearance
|
||||
|
||||
OHIF's user interface is built on **ui-next**, a component library purpose-built
|
||||
for medical imaging workflows. It provides a consistent set of React components,
|
||||
a token-based theming system, a curated icon set, and a collection of UI services
|
||||
that manage runtime behavior like modals, notifications, and viewport layout.
|
||||
|
||||
This page gives a high-level map of how these pieces fit together and where to
|
||||
find detailed documentation for each.
|
||||
|
||||
## Component Library
|
||||
|
||||
The [component library](/components) is the foundation of every panel, toolbar, dialog, and
|
||||
control in the viewer. Components are organized into three tiers:
|
||||
|
||||
- **Simple components** — atomic building blocks like Button, Checkbox, Input,
|
||||
Label, Slider, and Switch. These are styled with the design system's tokens and
|
||||
are the smallest interactive units.
|
||||
|
||||
- **Compound components** — composed from simple components to handle more
|
||||
complex interactions: Select, Dialog, DropdownMenu, Tabs, Table, Popover,
|
||||
Tooltip, Toast, and others. These manage their own state (open/close, selection,
|
||||
focus) via headless patterns.
|
||||
|
||||
- **OHIF-specific components** — built for medical imaging workflows and not
|
||||
found in general-purpose libraries: AllInOneMenu, CinePlayer, DataRow,
|
||||
DataTable, Numeric, PanelSection, SmartScrollbar, ToolButton, and
|
||||
ToolButtonList. These integrate directly with OHIF's services and extension
|
||||
system.
|
||||
|
||||
Every component renders live in the interactive
|
||||
[Components](/components) section of this documentation site, where you
|
||||
can see props, variants, and copy usage examples.
|
||||
|
||||
## Appearance Dialog
|
||||
|
||||
The Appearance dialog is an optional UI that lets end users switch presets,
|
||||
apply custom CSS overrides, and share themes via URL. It is not enabled by
|
||||
default, but deployers can
|
||||
[opt in via configuration](../platform/services/customization-service/appearance-theming.md#enabling-the-theme-module).
|
||||
See [Appearance & Theming](../platform/services/customization-service/appearance-theming.md)
|
||||
for the full setup and developer guide.
|
||||
|
||||
## Colors & Theming
|
||||
|
||||
OHIF uses a **token-based color system** built on CSS custom properties with HSL
|
||||
values. The base theme (dark mode) is defined in `:root` via Tailwind CSS, and
|
||||
theme presets override specific tokens by applying a CSS class to `document.body`.
|
||||
|
||||
The theming system covers:
|
||||
|
||||
- **[Design tokens](/colors-and-theming#color-tokens-and-roles)** — a set of semantic color variables (`--background`,
|
||||
`--primary`, `--card`, `--border`, etc.) that every component references. Tokens
|
||||
are defined as HSL triplets and consumed via Tailwind's `hsl(var(...))` pattern.
|
||||
|
||||
- **Theme presets** — six built-in themes (three tonal, three neutral) that shift
|
||||
the entire interface's color palette. Presets are defined as JSON files and
|
||||
applied via CSS classes. Also see:
|
||||
[Creating Themes](/colors-and-theming#creating-themes) and
|
||||
[Adding a Theme Preset](../platform/services/customization-service/appearance-theming.md#adding-a-theme-preset).
|
||||
|
||||
- **Accessibility** — foreground tokens are paired with every surface token to
|
||||
maintain contrast ratios across themes. When adding custom themes,
|
||||
[test colors to match accessibility standards](/colors-and-theming#accessibility).
|
||||
|
||||
Explore the live token swatches and theme picker in the interactive
|
||||
[Colors & Theming](/colors-and-theming) page, and see
|
||||
[Appearance & Theming](../platform/services/customization-service/appearance-theming.md)
|
||||
for the full configuration and developer guide.
|
||||
|
||||
## Iconography
|
||||
|
||||
OHIF ships a curated set of icons designed specifically for medical imaging interfaces.
|
||||
Icons are SVG-based, registered via `addIcon()`, and rendered through the `Icons`
|
||||
component. They follow the same token system as the rest of the UI, so icon colors
|
||||
respond to the active theme.
|
||||
|
||||
Browse the full set with search and click-to-copy in the
|
||||
[Iconography](/components/icons) page.
|
||||
|
||||
## White Labeling
|
||||
|
||||
OHIF supports replacing the header logo with custom branding via the
|
||||
`whiteLabeling` configuration key. This lets you rebrand the viewer without
|
||||
modifying source code.
|
||||
|
||||
Add a `whiteLabeling` entry to your configuration file with a
|
||||
`createLogoComponentFn` that returns a React element:
|
||||
|
||||
```js
|
||||
window.config = {
|
||||
/** .. **/
|
||||
whiteLabeling: {
|
||||
createLogoComponentFn: function(React) {
|
||||
return React.createElement(
|
||||
'a',
|
||||
{
|
||||
target: '_self',
|
||||
rel: 'noopener noreferrer',
|
||||
className: 'text-purple-600 line-through',
|
||||
href: '/',
|
||||
},
|
||||
React.createElement('img', {
|
||||
src: './customLogo.svg',
|
||||
})
|
||||
);
|
||||
},
|
||||
},
|
||||
/** .. **/
|
||||
};
|
||||
```
|
||||
|
||||

|
||||
|
||||
You can use Tailwind CSS utility classes in the `className` property to style
|
||||
your custom logo component.
|
||||
|
||||
## UI Services
|
||||
|
||||
While the component library handles what gets rendered, **UI services** handle
|
||||
the runtime behavior: opening modals, showing notifications, managing viewport
|
||||
layout, and coordinating dialogs. These services use a pub/sub architecture and
|
||||
are accessed through the `servicesManager`:
|
||||
|
||||
| Service | What it manages |
|
||||
|---------|----------------|
|
||||
| [Modal Service](../platform/services/ui/ui-modal-service.md) | Full-screen and contained modals (including the Appearance dialog) |
|
||||
| [Dialog Service](../platform/services/ui/ui-dialog-service.md) | Lightweight dialogs with form inputs and confirmations |
|
||||
| [Notification Service](../platform/services/ui/ui-notification-service.md) | Toast notifications (success, warning, error, info) |
|
||||
| [Viewport Grid Service](../platform/services/ui/viewport-grid-service.md) | Viewport layout, grid arrangement, and active viewport tracking |
|
||||
| [Viewport Dialog Service](../platform/services/ui/ui-viewport-dialog-service.md) | Dialogs anchored to specific viewports |
|
||||
| [Viewport Action Menu](../platform/services/ui/viewport-action-menu.md) | Context menus and action buttons on viewport corners |
|
||||
| [Cine Service](../platform/services/ui/cine-service.md) | Cine playback controls and frame rate |
|
||||
|
||||
UI services are documented in the [Services > UI](../platform/services/ui/index.md)
|
||||
section.
|
||||
|
||||
## Customization Service
|
||||
|
||||
The [Customization Service](../platform/services/customization-service/customizationService.md)
|
||||
is the mechanism that ties everything together. It allows deployers and
|
||||
extension authors to override, extend, or replace UI components and behaviors
|
||||
without modifying core code. Customizations can be scoped to a specific mode, set
|
||||
globally via configuration, or provided as defaults by extensions.
|
||||
|
||||
The Appearance dialog itself is delivered as a customization module. Deployers
|
||||
enable it by adding a single reference to their config's `customizationService`
|
||||
array. This pattern means that any part of the UI that supports customization
|
||||
can be configured the same way.
|
||||
|
||||
See the full customization guide at
|
||||
[Customization Service](../platform/services/customization-service/customizationService.md),
|
||||
including the syntax reference for `$set`, `$push`, `$merge`, `$filter`, and
|
||||
other operations.
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
sidebar_position: 4
|
||||
sidebar_label: URL
|
||||
title: URL Parameters
|
||||
summary: Reference for OHIF Viewer URL parameters that control WorkList filtering, study/series loading, and viewer behavior, including parameters for filtering by patient name, modality, data sources, specifying initial series/instances, and selecting hanging protocols.
|
||||
|
||||
@@ -176,3 +176,33 @@ accurate documentation, we will link to each provider's own recommended steps:
|
||||
|
||||
- [Add SSL Support](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-https-custom-domain-cdn)
|
||||
- [Configure a Custom Domain](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-custom-domain-name)
|
||||
|
||||
## Content-Security-Policy
|
||||
|
||||
The hosted viewer ships a `Content-Security-Policy-Report-Only` header (see
|
||||
`netlify.toml`; the nginx recipes under `platform/app/.recipes` carry the same
|
||||
policy as commented `add_header` examples). Report-Only means the browser
|
||||
evaluates the policy and logs violations to the console, but blocks nothing.
|
||||
|
||||
What the policy covers:
|
||||
|
||||
- `default-src 'self'` with `frame-ancestors 'none'` (mirrors the existing
|
||||
`X-Frame-Options: DENY`), `base-uri 'self'`, and `form-action 'self'`.
|
||||
- `script-src` allows `'unsafe-inline'`/`'unsafe-eval'` (required by the
|
||||
current bundles and the cornerstone/vtk WASM and worker paths) plus
|
||||
`https://cdnjs.cloudflare.com` for the Rollbar snippet used by demo builds.
|
||||
- `worker-src`, `object-src`, `frame-src`, and `img-src` allow `blob:` because
|
||||
web workers, DICOM PDF rendering, and image data all use blob URLs.
|
||||
- `connect-src` allows any `https:` origin because deployments point the
|
||||
viewer at arbitrary DICOMweb servers; narrow this to your archive's origin
|
||||
in your own deployment if you can.
|
||||
|
||||
Reading violations: open the browser devtools console and filter for
|
||||
`Content-Security-Policy`. Report-only violations are logged as warnings and
|
||||
do not affect behavior; each one is either telemetry for tightening the policy
|
||||
or a directive that must stay relaxed.
|
||||
|
||||
Criteria for promoting Report-Only to an enforcing `Content-Security-Policy`
|
||||
header: zero unexplained violations across the e2e suite and a manual session
|
||||
that exercises study load, MPR, SEG display, PDF display, and video display.
|
||||
Until then, keep the header name `Content-Security-Policy-Report-Only`.
|
||||
@@ -6,10 +6,9 @@ title: 3.10 to 3.11 Migration Guide
|
||||
---
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
||||
|
||||
# 3.10 to 3.11 Migration Guide
|
||||
|
||||
Here you can find the migration guides for upgrading from OHIF version 3.10 to version 3.11.
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items.filter(item => item.docId !== 'migration-guide/3p10-to-3p11/index')}/>
|
||||
<DocCardList />
|
||||
@@ -0,0 +1,99 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
sidebar_label: Color System
|
||||
title: Color System Migration
|
||||
summary: 3.13 continues the migration from legacy color classes to the ui-next semantic color system. This guide maps legacy color names to their ui-next equivalents and shows common text, background, and border replacements.
|
||||
---
|
||||
|
||||
# Color System Migration
|
||||
|
||||
This guide covers migrating from legacy color classes to the new ui-next color system.
|
||||
|
||||
## Current State (3.13+)
|
||||
|
||||
The OHIF Viewer is now built entirely with ui-next components, which use the [new color system](/colors-and-theming). The legacy components in `platform/ui` remain on the old color system. For reference, the table below maps the legacy colors to their ui-next equivalents.
|
||||
|
||||
## Color Mapping Reference
|
||||
|
||||
| Legacy Color | Updated color (ui-next) |
|
||||
| ----------------- | ----------------------- |
|
||||
| `bkg-low` | `background` |
|
||||
| `common-bright` | `foreground` (various) |
|
||||
| `primary-light` | `highlight` |
|
||||
| `inputfield-main` | `input` |
|
||||
| `secondary-light` | `input` |
|
||||
| `primary-dark` | `muted` |
|
||||
| `bkg-med` | `muted` |
|
||||
| `aqua-pale` | `muted-foreground` |
|
||||
| `secondary-dark` | `popover` |
|
||||
| `primary-active` | `primary` |
|
||||
| `actions-primary` | `primary` |
|
||||
| `secondary-main` | |
|
||||
| `primary-main` | |
|
||||
| `common-dark` | |
|
||||
| `customblue` | |
|
||||
|
||||
> **Note:** The legacy variables left blank in the table above (`secondary-main`, `primary-main`, `common-dark`, and `customblue`) have no direct ui-next equivalent. If your code uses any of these, replace them case by case, choosing the semantic token that best fits how the color is used in each component.
|
||||
|
||||
## Generic Color Migrations
|
||||
|
||||
Avoid using generic color values. Use semantic colors instead:
|
||||
|
||||
| Generic Color | Semantic Replacement |
|
||||
| ---------------------------- | ----------------------- |
|
||||
| `white` | `foreground` |
|
||||
| `blue-*` (e.g., `blue-500`) | `primary` or `highlight`|
|
||||
| `gray-*` (e.g., `gray-800`) | `muted` or `popover` |
|
||||
| `red-*` | `destructive` |
|
||||
|
||||
> **Note:** `black` is still used in certain cases to replace default browser backgrounds and to match imaging backgrounds.
|
||||
|
||||
## Common Migrations
|
||||
|
||||
### Text Colors
|
||||
|
||||
```diff
|
||||
- text-white
|
||||
+ text-foreground
|
||||
|
||||
- text-primary-light
|
||||
+ text-highlight
|
||||
|
||||
- text-primary-active
|
||||
+ text-primary
|
||||
|
||||
- text-secondary-light
|
||||
+ text-muted-foreground
|
||||
```
|
||||
|
||||
### Background Colors
|
||||
|
||||
```diff
|
||||
- bg-primary-dark
|
||||
+ bg-muted
|
||||
|
||||
- bg-secondary-dark
|
||||
+ bg-popover
|
||||
|
||||
- bg-black
|
||||
+ bg-background
|
||||
```
|
||||
|
||||
### Border Colors
|
||||
|
||||
```diff
|
||||
- border-secondary-light
|
||||
+ border-input
|
||||
|
||||
- border-primary-light
|
||||
+ border-highlight
|
||||
|
||||
- border-primary-dark
|
||||
+ border-muted
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
- Legacy colors without a mapping (empty cells) should be evaluated on a case-by-case basis
|
||||
- The new color system uses CSS variables, enabling future theme support
|
||||
- When migrating, test components visually to ensure proper contrast and accessibility
|
||||
@@ -0,0 +1,104 @@
|
||||
---
|
||||
sidebar_position: 9
|
||||
sidebar_label: Deployment recipes
|
||||
title: Deployment recipes migration
|
||||
---
|
||||
|
||||
# Deployment recipes migration
|
||||
|
||||
The deployment recipes under `platform/app/.recipes` no longer ship working
|
||||
credential values or permissive CORS defaults. If you deploy from these
|
||||
recipes, or you templated your own deployment from an earlier checkout, a few
|
||||
one-time steps are now required. The viewer application itself is unaffected.
|
||||
|
||||
## Keycloak recipes require a .env file
|
||||
|
||||
Applies to `Nginx-Orthanc-Keycloak` and `Nginx-Dcm4chee-Keycloak`.
|
||||
|
||||
The docker-compose files previously hardcoded the Keycloak admin and
|
||||
PostgreSQL passwords. They now read them from the environment and refuse to
|
||||
start while any is unset:
|
||||
|
||||
```text
|
||||
error while interpolating services.keycloak.environment.POSTGRES_PASSWORD:
|
||||
required variable POSTGRES_PASSWORD is missing a value: set POSTGRES_PASSWORD in your .env
|
||||
```
|
||||
|
||||
**Migration:** copy `.env.example` to `.env` next to `docker-compose.yml` and
|
||||
set strong values:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# then edit .env and fill in:
|
||||
# POSTGRES_PASSWORD=
|
||||
# KEYCLOAK_ADMIN_PASSWORD=
|
||||
```
|
||||
|
||||
`POSTGRES_PASSWORD` is the single PostgreSQL credential - Keycloak connects to
|
||||
Postgres as the `keycloak` role provisioned with it, so `KC_DB_PASSWORD` is
|
||||
derived from `POSTGRES_PASSWORD` in the compose file rather than set
|
||||
separately.
|
||||
|
||||
## Keycloak client secret is now a placeholder
|
||||
|
||||
The realm import (`config/ohif-keycloak-realm.json`) and the oauth2-proxy
|
||||
config (`config/oauth2-proxy.cfg`) previously shipped a fixed value for the
|
||||
`ohif_viewer` client secret. Both files now contain the placeholder
|
||||
`REPLACE_WITH_A_GENERATED_CLIENT_SECRET`.
|
||||
|
||||
**Migration:** generate a fresh value and put the same value in both files
|
||||
before `docker compose up`. To generate one after the realm is imported:
|
||||
Keycloak admin console -> Clients -> `ohif_viewer` -> Credentials ->
|
||||
Regenerate.
|
||||
|
||||
**If you deployed from an earlier checkout:** the old fixed value is public in
|
||||
the repository history, so regenerating it is required for existing
|
||||
deployments too, not just new ones. Regenerate it in the Keycloak admin
|
||||
console and update `config/oauth2-proxy.cfg` to match. Rotating the Keycloak
|
||||
admin and PostgreSQL passwords is likewise recommended. See the
|
||||
`SECURITY-NOTES.md` file inside each Keycloak recipe directory for the full
|
||||
checklist.
|
||||
|
||||
## nginx recipes no longer send wildcard CORS headers
|
||||
|
||||
Applies to `Nginx-Orthanc`, `Nginx-Orthanc-Keycloak`, and
|
||||
`Nginx-Dcm4chee-Keycloak`.
|
||||
|
||||
The nginx configs previously answered PACS/DICOMweb proxy requests with
|
||||
`Access-Control-Allow-Origin: *`. Those headers were removed.
|
||||
|
||||
- **Same-origin deployments (the recipe default):** no action needed. The
|
||||
viewer is served by the same nginx as the proxy, so these requests never
|
||||
needed CORS headers.
|
||||
- **Cross-origin deployments** (viewer hosted on a different origin than the
|
||||
proxy): browser requests to the proxy will now fail CORS checks until you
|
||||
re-add the headers with your viewer's origin spelled out explicitly. Each
|
||||
config contains a commented example next to the old location:
|
||||
|
||||
```nginx
|
||||
# add_header 'Access-Control-Allow-Origin' 'https://viewer.example.com' always;
|
||||
```
|
||||
|
||||
Use your actual viewer origin; avoid `'*'` on endpoints that serve patient
|
||||
data.
|
||||
|
||||
## Logout redirect_uri is validated
|
||||
|
||||
`/logout?redirect_uri=...` now only honors same-origin (or relative) values.
|
||||
Anything else falls back to the configured `post_logout_redirect_uri` from
|
||||
your OIDC configuration. The viewer's own logout flows always pass same-origin
|
||||
values, so in-app behavior is unchanged.
|
||||
|
||||
**Migration:** only needed if you linked to `/logout` with a `redirect_uri`
|
||||
pointing at a different origin (for example, an external portal). Configure
|
||||
that destination as the client's `post_logout_redirect_uri` in your OIDC
|
||||
configuration instead of passing it in the query string.
|
||||
|
||||
## New Content-Security-Policy-Report-Only header (no action needed)
|
||||
|
||||
Hosted deployments configured via `netlify.toml` now send a
|
||||
`Content-Security-Policy-Report-Only` header. It is observational only:
|
||||
browsers log would-be violations to the devtools console and block nothing.
|
||||
The nginx recipes carry the same policy as commented examples. See the
|
||||
[Deploy Static Assets](../../deployment/static-assets.md#content-security-policy)
|
||||
docs for what the policy covers and how to read the console reports.
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
sidebar_position: 8
|
||||
sidebar_label: DICOM video viewport
|
||||
title: DICOM video viewport migration
|
||||
---
|
||||
|
||||
# DICOM video viewport migration
|
||||
|
||||
The `@ohif/extension-dicom-video` extension no longer provides its own viewport module in 3.13. DICOM video rendering is handled by the Cornerstone viewport, which supports Cornerstone3D video viewports directly.
|
||||
|
||||
The DICOM video SOP class handler remains available and should still be used to identify and build video display sets:
|
||||
|
||||
```ts
|
||||
'@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video'
|
||||
```
|
||||
|
||||
## What changed
|
||||
|
||||
The following viewport namespace has been removed:
|
||||
|
||||
```ts
|
||||
'@ohif/extension-dicom-video.viewportModule.dicom-video'
|
||||
```
|
||||
|
||||
Use the Cornerstone viewport namespace instead:
|
||||
|
||||
```ts
|
||||
'@ohif/extension-cornerstone.viewportModule.cornerstone'
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
If your mode has a dedicated DICOM video viewport entry, replace it with the Cornerstone viewport or add the video SOP class handler to an existing Cornerstone viewport entry.
|
||||
|
||||
**Before (3.12):**
|
||||
|
||||
```ts
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
viewports: [
|
||||
{
|
||||
namespace: '@ohif/extension-cornerstone.viewportModule.cornerstone',
|
||||
displaySetsToDisplay: [ohif.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomvideo.viewport,
|
||||
displaySetsToDisplay: [dicomvideo.sopClassHandler],
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
**After (3.13):**
|
||||
|
||||
```ts
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
};
|
||||
|
||||
viewports: [
|
||||
{
|
||||
namespace: '@ohif/extension-cornerstone.viewportModule.cornerstone',
|
||||
displaySetsToDisplay: [ohif.sopClassHandler, dicomvideo.sopClassHandler],
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
If your mode uses a custom viewport that wraps `OHIFCornerstoneViewport` (for example, a tracked Cornerstone viewport), route DICOM video display sets through that wrapper instead of the removed DICOM video viewport namespace.
|
||||
|
||||
## Why
|
||||
|
||||
Keeping video rendering in the Cornerstone viewport avoids a separate custom React video viewport path and keeps video behavior aligned with Cornerstone3D viewport services, tools, annotations, and presentation state handling.
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
sidebar_label: Escape / cancelActiveOperation hotkey
|
||||
title: Escape hotkey consolidation
|
||||
---
|
||||
|
||||
# Escape hotkey – single `cancelActiveOperation` command
|
||||
|
||||
The default `Escape` hotkey behavior has been consolidated. Previously the
|
||||
`esc` key was bound to **two** separate commands in the default hotkey
|
||||
bindings — `cancelMeasurement` and `rejectPreview`. Because the underlying
|
||||
hotkey library (Mousetrap) keeps only **one** handler per key, the
|
||||
later-registered binding (`rejectPreview`) silently shadowed the other, so
|
||||
`cancelMeasurement` never ran and an in-progress Spline/Livewire/PlanarFreehand
|
||||
contour (or any annotation being drawn) could not be cancelled with `Escape`.
|
||||
|
||||
`Escape` is now bound to a single generic command, **`cancelActiveOperation`**,
|
||||
which orchestrates the two single-purpose commands. Each is a no-op when its
|
||||
state is not active, so one `Escape` press consistently:
|
||||
|
||||
- rejects a provisional segmentation **preview** (via `rejectPreview`), and
|
||||
- cancels an **in-progress annotation** being drawn (via `cancelMeasurement`).
|
||||
|
||||
## Change
|
||||
|
||||
| 3.12 (old) | 3.13 (new) |
|
||||
|----------------------------------------------|-----------------------------------------|
|
||||
| `esc` → `cancelMeasurement` **and** `esc` → `rejectPreview` (the latter shadowed the former) | `esc` → `cancelActiveOperation` |
|
||||
| `enter` → `acceptPreview` | `enter` → `acceptPreview` (unchanged) |
|
||||
|
||||
New command (cornerstone extension, `CORNERSTONE` context):
|
||||
|
||||
```ts
|
||||
// extensions/cornerstone/src/commandsModule.ts
|
||||
cancelActiveOperation: () => {
|
||||
actions.rejectPreview(); // discard a provisional segmentation preview
|
||||
actions.cancelMeasurement(); // cancel an in-progress annotation draw
|
||||
},
|
||||
```
|
||||
|
||||
Both `rejectPreview` and `cancelMeasurement` remain available as standalone
|
||||
commands; only their default `esc` hotkey bindings changed.
|
||||
|
||||
## Migration
|
||||
|
||||
Most applications need no changes — the default behavior simply works as
|
||||
expected now.
|
||||
|
||||
**If you provide a custom `ohif.hotkeyBindings` customization** and want the
|
||||
same consolidated behavior, bind `esc` to the new command and remove the old
|
||||
duplicate `esc` entries:
|
||||
|
||||
**Before (3.12):**
|
||||
|
||||
```ts
|
||||
'ohif.hotkeyBindings': [
|
||||
// ...
|
||||
{ commandName: 'cancelMeasurement', label: 'Cancel Measurement', keys: ['esc'] },
|
||||
{ commandName: 'acceptPreview', label: 'Accept Preview', keys: ['enter'] },
|
||||
{ commandName: 'rejectPreview', label: 'Reject Preview', keys: ['esc'] },
|
||||
];
|
||||
```
|
||||
|
||||
**After (3.13):**
|
||||
|
||||
```ts
|
||||
'ohif.hotkeyBindings': [
|
||||
// ...
|
||||
{ commandName: 'cancelActiveOperation', label: 'Cancel', keys: ['esc'] },
|
||||
{ commandName: 'acceptPreview', label: 'Accept Preview', keys: ['enter'] },
|
||||
];
|
||||
```
|
||||
|
||||
**If you ran the `cancelMeasurement` or `rejectPreview` command directly** (for
|
||||
example from a toolbar button or another command), no change is required — both
|
||||
commands still exist with the same behavior.
|
||||
|
||||
> **User key remaps:** the per-user hotkey overrides stored in `localStorage`
|
||||
> (`user-preferred-keys`) are keyed by command hash. A user who had personally
|
||||
> remapped the old `cancelMeasurement` or `rejectPreview` key will fall back to
|
||||
> the new `esc` default for `cancelActiveOperation`, since those old command
|
||||
> hashes no longer exist in the defaults.
|
||||
|
||||
## Reason
|
||||
|
||||
Binding two separate commands to the same key is inherently fragile — only the
|
||||
last registered binding survives. Routing `Escape` through a single
|
||||
orchestrating command removes the shadowing bug, keeps each underlying command
|
||||
single-purpose, and makes the "discard whatever is in progress" intent explicit.
|
||||
@@ -6,7 +6,6 @@ title: 3.12 to 3.13 Migration Guide
|
||||
---
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import { useCurrentSidebarCategory } from '@docusaurus/theme-common';
|
||||
|
||||
# 3.12 to 3.13 Migration Guide
|
||||
|
||||
@@ -24,5 +23,12 @@ The largest changes in 3.13 are infrastructure-level:
|
||||
is now **24**.
|
||||
- **[SegmentationService](./segmentation-service.md)** — the
|
||||
`removeSegmentationRepresentations` method was renamed.
|
||||
- **[DICOM video viewport](./dicom-video.md)** — the
|
||||
`@ohif/extension-dicom-video.viewportModule.dicom-video` namespace was
|
||||
removed; route DICOM video display sets through the Cornerstone viewport.
|
||||
- **[Deployment recipes](./deployment-recipes.md)** — the Keycloak recipes
|
||||
now require a `.env` file and a generated client secret before
|
||||
`docker compose up`, and the nginx recipes no longer send wildcard CORS
|
||||
headers (cross-origin deployments must set an explicit origin).
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items.filter(item => item.docId !== 'migration-guide/3p12-to-3p13/index')} />
|
||||
<DocCardList />
|
||||
@@ -6,7 +6,6 @@ summary: Migration guide for segmentation architecture changes in OHIF 3.9, cove
|
||||
---
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
||||
|
||||
:::info
|
||||
This migration involves significant architectural changes to the segmentation system. While we typically aim for incremental updates, the shift from a tool group-centric to a viewport-centric architecture was necessary to support OHIF 3.9's advanced visualization capabilities, and more flexible segmentation handling.
|
||||
@@ -15,4 +14,4 @@ Don't worry - we'll guide you through each change step by step!
|
||||
:::
|
||||
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items}/>
|
||||
<DocCardList />
|
||||
@@ -7,8 +7,7 @@ summary: Migration guide for upgrading from OHIF 3.8 to 3.9, covering segmentati
|
||||
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
||||
|
||||
## Migration Guide Sections
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items}/>
|
||||
<DocCardList />
|
||||
@@ -12,7 +12,7 @@ summary: Migration guide for OHIF 3.10's new color system, explaining the transi
|
||||
* **Component Abstraction:** Some styling, especially for interactive elements like buttons, has been abstracted into components (e.g., `ViewportActionButton`, UI library buttons) which use predefined variants (`default`, `secondary`, `ghost`) instead of manual style combinations.
|
||||
|
||||
:::note
|
||||
You can look at the set of colors in the [Color System](/colors-and-type)
|
||||
You can look at the set of colors in the [Color System](/colors-and-theming)
|
||||
:::
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ This guide explains how to migrate from the existing `Input`, `InputNumber`, `In
|
||||
|
||||
## Why Migrate?
|
||||
|
||||
See the full list of components in the [Numeric Component Showcase](/components-list#numeric)
|
||||
See the full list of components in the [Numeric Component](/components/numeric)
|
||||
|
||||
|
||||
The old components relied heavily on props, making them complex and difficult to maintain and apply custom styles. The new `Numeric` component provides a structured approach with a context-based API, reducing prop clutter and improving reusability.
|
||||
|
||||
@@ -6,10 +6,9 @@ summary: Introduction to OHIF migration guides covering the upgrade paths betwee
|
||||
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
||||
|
||||
# Migration Guides
|
||||
|
||||
Based on the version you are migrating from, you can find the migration guide for the latest version of the platform.
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items}/>
|
||||
<DocCardList />
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
sidebar_label: Measurements
|
||||
title: Measurements Customization
|
||||
summary: Documentation for customizing OHIF's measurement tools and displays, including how to modify display formats, annotation behaviors, and tracking interfaces for medical imaging measurements.
|
||||
sidebar_position: 4
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
|
||||
|
||||
Loaded 100 of 268 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user