fix(layouts): and fix thumbnail in touch and update migration guide for 3.8 release (#4052)

This commit is contained in:
Alireza authored and GitHub committed 2024-04-18 23:21:02 -04:00
1 parent 28bc8914a8
commit d250d04580
30 files changed
+209 -158

No files matched your search

@@ -601,17 +601,25 @@ export default class HangingProtocolService extends PubSubService {
};
}
getViewportsRequireUpdate(viewportId, displaySetInstanceUID) {
const { displaySetService } = this._servicesManager.services;
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
if (displaySet?.unsupported) {
throw new Error('Unsupported displaySet');
}
/**
* This will return the viewports that need to be updated based on the
* hanging protocol layout and the displaySetInstanceUID that needs to be updated.
*
* This is useful, when for instance we drag and drop a displaySet into a viewport
* which is in MPR, and we need to update the other viewports that are showing the same
* layout.
*
* However, sometimes since we get out of sync with the hanging protocol layout, when
* the user use the custom grid layout, we should not update the other viewports, and that is
* when the isHangingProtocolLayout is set to false.
*
* @param viewportId - the id of the viewport that needs to be updated
* @param displaySetInstanceUID - the displaySetInstanceUID that needs to be updated
* @param isHangingProtocolLayout - whether the layout is a hanging protocol layout
* @returns
*/
getViewportsRequireUpdate(viewportId, displaySetInstanceUID, isHangingProtocolLayout = true) {
const newDisplaySetInstanceUID = displaySetInstanceUID;
const protocol = this.protocol;
const protocolStage = protocol.stages[this.stageIndex];
const protocolViewports = protocolStage.viewports;
const defaultReturn = [
{
viewportId,
@@ -619,6 +627,19 @@ export default class HangingProtocolService extends PubSubService {
},
];
if (!isHangingProtocolLayout) {
return defaultReturn;
}
const { displaySetService } = this._servicesManager.services;
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
if (displaySet?.unsupported) {
throw new Error('Unsupported displaySet');
}
const protocol = this.protocol;
const protocolStage = protocol.stages[this.stageIndex];
const protocolViewports = protocolStage.viewports;
if (!protocolViewports) {
return defaultReturn;
}
@@ -1084,9 +1105,8 @@ export default class HangingProtocolService extends PubSubService {
options
): HangingProtocol.ViewportMatchDetails {
if (this.protocol.id !== protocolId) {
throw new Error(
`Currently applied protocol ${this.protocol.id} is different from ${protocolId}`
);
console.warn('setting protocol');
this.protocol = this.getProtocolById(protocolId);
}
const protocol = this.protocol;
const stage = protocol.stages[stageIdx];
@@ -10,7 +10,7 @@ const iopTolerance = 0.01;
*
* @param {Object[]} instances An array of `OHIFInstanceMetadata` objects.
*/
export default function isDisplaySetReconstructable(instances) {
export default function isDisplaySetReconstructable(instances, appConfig) {
if (!instances.length) {
return { value: false };
}
@@ -18,6 +18,14 @@ export default function isDisplaySetReconstructable(instances) {
const isMultiframe = firstInstance.NumberOfFrames > 1;
if (appConfig) {
const rows = toNumber(firstInstance.Rows);
const columns = toNumber(firstInstance.Columns);
if (rows > appConfig.max3DTextureSize || columns > appConfig.max3DTextureSize) {
return { value: false };
}
}
// We used to check is reconstructable modalities here, but the logic is removed
// in favor of the calculation by metadata (orientation and positions)