Skip to content

Commit 916a788

Browse files
authored
fix: take into account storePointData setting (#1733)
1 parent 9cbc191 commit 916a788

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/core/src/utilities/VoxelManager.ts

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ export default class VoxelManager<T> {
279279
],
280280
pointInShapeFn: isInObject,
281281
callback,
282+
returnPoints,
282283
});
283284
return pointsInShape;
284285
}

packages/core/src/utilities/pointInShapeCallback.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export function iterateOverPointsInShapeVoxelManager({
168168
imageData,
169169
pointInShapeFn,
170170
callback,
171+
returnPoints,
171172
}) {
172173
const [[iMin, iMax], [jMin, jMax], [kMin, kMax]] = bounds;
173174
const indexToWorld = createPositionCallback(imageData);
@@ -188,12 +189,14 @@ export function iterateOverPointsInShapeVoxelManager({
188189
const index = voxelManager.toIndex(pointIJK);
189190
const value = voxelManager.getAtIndex(index);
190191

191-
pointsInShape.push({
192-
value,
193-
index,
194-
pointIJK: [...pointIJK],
195-
pointLPS: pointLPS.slice(),
196-
});
192+
if (returnPoints) {
193+
pointsInShape.push({
194+
value,
195+
index,
196+
pointIJK: [...pointIJK],
197+
pointLPS: pointLPS.slice(),
198+
});
199+
}
197200

198201
callback?.({ value, index, pointIJK, pointLPS });
199202
}

0 commit comments

Comments
 (0)