Fix/hp validate match offset 2 (#3279)

* fix: Validate provided display sets other than 0

* Build fix
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-03-28 11:18:33 -04:00
1 parent ed7ded05db
commit b2128976a3
3 files changed
+104 -21

No files matched your search

@@ -98,7 +98,7 @@ const defaultProtocol = {
viewportStructure: {
layoutType: 'grid',
properties: {
rows: 1,
rows: 2,
columns: 2,
},
},
@@ -137,13 +137,7 @@ const defaultProtocol = {
],
},
{
viewportOptions: {
toolGroupId: 'default',
// initialImageOptions: {
// index: 180,
// preset: 'middle', // 'first', 'last', 'middle'
// },
},
viewportOptions: {},
displaySets: [
{
id: 'defaultDisplaySetId',
@@ -154,10 +148,61 @@ const defaultProtocol = {
],
},
{
name: '3x1',
// Indicate that the number of viewports needed is 2 filled viewports,
// but that 4 viewports are preferred.
stageActivation: {
enabled: {
minViewportsMatched: 3,
},
},
viewportStructure: {
layoutType: 'grid',
properties: {
rows: 1,
columns: 3,
},
},
viewports: [
{
viewportOptions: {
toolGroupId: 'default',
},
displaySets: [
{
id: 'defaultDisplaySetId',
matchedDisplaySetsIndex: 2,
},
],
},
{
viewportOptions: {
toolGroupId: 'default',
},
displaySets: [
{
id: 'defaultDisplaySetId',
matchedDisplaySetsIndex: 1,
},
],
},
{
viewportOptions: {},
displaySets: [
{
id: 'defaultDisplaySetId',
},
],
},
],
},
// This is an example of a layout with more than one element in it
// It can be navigated to using , and . (prev/next stage)
{
name: '1x2',
name: '2x1',
// Indicate that the number of viewports needed is 1 filled viewport,
// but that 2 viewports are preferred.
stageActivation: {
@@ -185,17 +230,42 @@ const defaultProtocol = {
displaySets: [
{
id: 'defaultDisplaySetId',
// Shows the second index of this image set
matchedDisplaySetsIndex: 1,
},
],
},
{
viewportOptions: {
toolGroupId: 'default',
// initialImageOptions: {
// index: 180,
// preset: 'middle', // 'first', 'last', 'middle'
// },
},
viewportOptions: {},
displaySets: [
{
id: 'defaultDisplaySetId',
},
],
},
],
},
{
name: '2x1',
// Indicate that the number of viewports needed is 1 filled viewport,
// but that 2 viewports are preferred.
stageActivation: {
enabled: {
minViewportsMatched: 3,
},
},
viewportStructure: {
layoutType: 'grid',
properties: {
rows: 2,
columns: 1,
},
},
viewports: [
{
viewportOptions: {},
displaySets: [
{
id: 'defaultDisplaySetId',
@@ -204,8 +274,15 @@ const defaultProtocol = {
},
],
},
{
viewportOptions: {},
displaySets: [
{
id: 'defaultDisplaySetId',
},
],
},
],
createdDate: '2021-02-23T18:32:42.850Z',
},
],
};