fix: the null value check issue in image spacing calculation (#5726)

Co-authored-by: 顾争 <zheng.gu-rd@djhealthunion.com.cn>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
zhenggu_rkie 2026-01-22 10:59:20 +08:00 committed by GitHub
parent 3cfddc1f64
commit afe184ec78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,9 @@ export default function areAllImageSpacingEqual(
return;
}
const lastIpp = toNumber(instances[instances.length - 1].ImagePositionPatient);
if (!lastIpp) {
return;
}
const averageSpacingBetweenFrames =
_getPerpendicularDistance(firstImagePositionPatient, lastIpp) / (instances.length - 1);