Skip to content

Commit b2df8fa

Browse files
committed
fix: probe tool not showing when segment groups present
Segment group actors have pickable:false, so picking from the first sample (which is a segment group when present) fails. Use the base image actor for picking instead, which is always pickable.
1 parent edb49dd commit b2df8fa

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

src/components/tools/ScalarProbe.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,23 @@ const pointPicker = vtkPointPicker.newInstance();
9696
pointPicker.setPickFromList(true);
9797
9898
watch(
99-
sampleSet,
100-
(samples) => {
101-
pointPicker.setPickList(
102-
samples.length > 0 && samples[0] ? [samples[0].rep.actor] : []
103-
);
99+
() => baseRep.value?.actor,
100+
(actor) => {
101+
pointPicker.setPickList(actor ? [actor] : []);
104102
},
105103
{ immediate: true }
106104
);
107105
108106
const getImageSamples = (x: number, y: number) => {
109-
const firstToSample = sampleSet.value[0];
110-
if (!firstToSample?.image) return undefined;
107+
if (!currentImageData.value) return undefined;
111108
112109
pointPicker.pick([x, y, 1.0], view.renderer);
113110
if (pointPicker.getActors().length === 0) return undefined;
114111
115-
// Get world position from the picked point
112+
// Get world position from the picked point (in base image space)
116113
const pickedIjk = pointPicker.getPointIJK() as unknown as ReadonlyVec3;
117114
const worldPosition = vec3.clone(
118-
firstToSample.image.indexToWorld(pickedIjk) as vec3
115+
currentImageData.value.indexToWorld(pickedIjk) as vec3
119116
);
120117
121118
const samples = sampleSet.value

tests/specs/configTestUtils.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ export const MINIMAL_501_SESSION = {
1616
name: 'minimal-501-session.volview.zip',
1717
} as const;
1818

19-
export const ANOTHER_DICOM = {
20-
url: 'https://data.kitware.com/api/v1/file/655d42a694ef39bf0a4a8bb3/download',
21-
name: '1-001.dcm',
22-
} as const;
23-
2419
export const PROSTATEX_DATASET = {
2520
url: 'https://data.kitware.com/api/v1/item/63527c7311dab8142820a338/download',
2621
name: 'prostate.zip',

tests/specs/remote-manifest.e2e.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { WINDOW_SIZE } from '../../wdio.shared.conf';
12
import { volViewPage } from '../pageobjects/volview.page';
3+
import { MINIMAL_DICOM } from './configTestUtils';
24
import { downloadFile, writeManifestToFile, openVolViewPage } from './utils';
3-
import { ANOTHER_DICOM } from './configTestUtils';
45

56
describe('VolView loading of remoteManifest.json', () => {
67
it('should show error when there is no name and URL is malformed', async () => {
@@ -9,21 +10,23 @@ describe('VolView loading of remoteManifest.json', () => {
910
};
1011
const fileName = 'remoteFilesBadUrl.json';
1112
await writeManifestToFile(manifest, fileName);
12-
13-
const urlParams = `?urls=[tmp/${fileName}]`;
14-
await volViewPage.open(urlParams);
13+
await openVolViewPage(fileName);
1514

1615
await volViewPage.waitForNotification();
1716
});
1817

1918
it('should load relative URI with no name property', async () => {
20-
await downloadFile(ANOTHER_DICOM.url, ANOTHER_DICOM.name);
19+
const downloadPromise = downloadFile(MINIMAL_DICOM.url, MINIMAL_DICOM.name);
20+
await browser.reloadSession();
21+
await browser.setWindowSize(...WINDOW_SIZE);
22+
await downloadPromise;
2123

2224
const manifest = {
23-
resources: [{ url: `/tmp/${ANOTHER_DICOM.name}` }],
25+
resources: [{ url: `/tmp/${MINIMAL_DICOM.name}` }],
2426
};
2527
const fileName = 'remoteFilesRelativeURI.json';
2628
await writeManifestToFile(manifest, fileName);
2729
await openVolViewPage(fileName);
30+
await volViewPage.waitForViews();
2831
});
2932
});

wdio.shared.conf.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ const TEST_DATASETS = [
1212
url: 'https://data.kitware.com/api/v1/file/68e9807dbf0f869935e36481/download',
1313
name: 'minimal.dcm',
1414
},
15-
{
16-
url: 'https://data.kitware.com/api/v1/file/655d42a694ef39bf0a4a8bb3/download',
17-
name: '1-001.dcm',
18-
},
1915
{
2016
url: 'https://data.kitware.com/api/v1/item/63527c7311dab8142820a338/download',
2117
name: 'prostate.zip',

0 commit comments

Comments
 (0)