-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(staticwado): SM and RT and update the server with new data (#3422)
* fix bugs for the RT for the new demo * fix SM with the static-wado server * remove thumbnail from tmtv * migration guide * fix stability for the rt struct * apply review comments * add loading indicator to SM * pdf works * try to fix relative bulkData * fix the rest * fix preflight for the SM * fix typo * apply review comments * yarn lock
- Loading branch information
Showing
30 changed files
with
293 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ult/src/CustomizeableContextMenu/index.ts → ...ault/src/CustomizableContextMenu/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import ContextMenuController from './ContextMenuController'; | ||
import * as ContextMenuItemsBuilder from './ContextMenuItemsBuilder'; | ||
import defaultContextMenu from './defaultContextMenu'; | ||
import * as CustomizeableContextMenuTypes from './types'; | ||
import * as CustomizableContextMenuTypes from './types'; | ||
|
||
export { | ||
ContextMenuController, | ||
CustomizeableContextMenuTypes, | ||
CustomizableContextMenuTypes, | ||
ContextMenuItemsBuilder, | ||
defaultContextMenu, | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
extensions/default/src/DicomWebDataSource/utils/fixBulkDataURI.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Modifies a bulkDataURI to ensure it is absolute based on the DICOMWeb configuration and | ||
* instance data. The modification is in-place. | ||
* | ||
* If the bulkDataURI is relative to the series or study (according to the DICOM standard), | ||
* it is made absolute by prepending the relevant paths. | ||
* | ||
* In scenarios where the bulkDataURI is a server-relative path (starting with '/'), the function | ||
* handles two cases: | ||
* | ||
* 1. If the wado root is absolute (starts with 'http'), it prepends the wado root to the bulkDataURI. | ||
* 2. If the wado root is relative, no changes are needed as the bulkDataURI is already correctly relative to the server root. | ||
* | ||
* @param value - The object containing BulkDataURI to be fixed. | ||
* @param instance - The object (DICOM instance data) containing StudyInstanceUID and SeriesInstanceUID. | ||
* @param dicomWebConfig - The DICOMWeb configuration object, containing wadoRoot and potentially bulkDataURI.relativeResolution. | ||
* @returns The function modifies `value` in-place, it does not return a value. | ||
*/ | ||
function fixBulkDataURI(value, instance, dicomWebConfig) { | ||
// in case of the relative path, make it absolute. The current DICOM standard says | ||
// the bulkdataURI is relative to the series. However, there are situations where | ||
// it can be relative to the study too | ||
if ( | ||
!value.BulkDataURI.startsWith('http') && | ||
!value.BulkDataURI.startsWith('/') | ||
) { | ||
if (dicomWebConfig.bulkDataURI?.relativeResolution === 'studies') { | ||
value.BulkDataURI = `${dicomWebConfig.wadoRoot}/studies/${instance.StudyInstanceUID}/${value.BulkDataURI}`; | ||
} else if ( | ||
dicomWebConfig.bulkDataURI?.relativeResolution === 'series' || | ||
!dicomWebConfig.bulkDataURI?.relativeResolution | ||
) { | ||
value.BulkDataURI = `${dicomWebConfig.wadoRoot}/studies/${instance.StudyInstanceUID}/series/${instance.SeriesInstanceUID}/${value.BulkDataURI}`; | ||
} | ||
|
||
return; | ||
} | ||
|
||
// in case it is relative path but starts at the server (e.g., /bulk/1e, note the missing http | ||
// in the beginning and the first character is /) There are two scenarios, whether the wado root | ||
// is absolute or relative. In case of absolute, we need to prepend the wado root to the bulkdata | ||
// uri (e.g., bulkData: /bulk/1e, wado root: http://myserver.com/dicomweb, output: http://myserver.com/bulk/1e) | ||
// and in case of relative wado root, we need to prepend the bulkdata uri to the wado root (e.g,. bulkData: /bulk/1e | ||
// wado root: /dicomweb, output: /bulk/1e) | ||
if (value.BulkDataURI[0] === '/') { | ||
if (dicomWebConfig.wadoRoot.startsWith('http')) { | ||
// Absolute wado root | ||
const url = new URL(dicomWebConfig.wadoRoot); | ||
value.BulkDataURI = `${url.origin}${value.BulkDataURI}`; | ||
} else { | ||
// Relative wado root, we don't need to do anything, bulkdata uri is already correct | ||
} | ||
} | ||
} | ||
|
||
export { fixBulkDataURI }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { fixBulkDataURI } from './fixBulkDataURI'; | ||
|
||
export { fixBulkDataURI }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.