fix: get direct url pixel data should be optional for video (#4152)
This commit is contained in:
1 parent
35077f1f02
commit
649ffab4d9
6 files changed
+416
-42
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Generates the rendered URL that can be used for direct retrieve of the pixel data binary stream.
|
||||
*
|
||||
* @param {object} config - The configuration object.
|
||||
* @param {string} config.wadoRoot - The root URL for the WADO service.
|
||||
* @param {object} params - The parameters object.
|
||||
* @param {string} params.tag - The tag name of the URL to retrieve.
|
||||
* @param {string} params.defaultPath - The path for the pixel data URL.
|
||||
* @param {object} params.instance - The instance object that the tag is in.
|
||||
* @param {string} params.defaultType - The mime type of the response.
|
||||
* @param {string} params.singlepart - The type of the part to retrieve.
|
||||
* @param {string} params.fetchPart - Unknown parameter.
|
||||
* @param {string} params.url - Unknown parameter.
|
||||
* @returns {string|Promise<string>} - An absolute URL to the binary stream.
|
||||
*/
|
||||
const createRenderedRetrieve = (config, params) => {
|
||||
const { wadoRoot } = config;
|
||||
const { instance, tag = 'PixelData' } = params;
|
||||
const { StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID } = instance;
|
||||
|
||||
if (tag === 'PixelData' || tag === 'EncapsulatedDocument') {
|
||||
return `${wadoRoot}/studies/${StudyInstanceUID}/series/${SeriesInstanceUID}/instances/${SOPInstanceUID}/rendered`;
|
||||
}
|
||||
};
|
||||
|
||||
export default createRenderedRetrieve;
|
||||
Reference in new issue
Block a user