fix: stdValue in TMTV mode (#4278)
This commit is contained in:
parent
6102e5d80f
commit
b2c629123c
@ -370,15 +370,16 @@ const commandsModule = ({ servicesManager, commandsManager, extensionManager }:
|
||||
voxelCount++;
|
||||
}
|
||||
}
|
||||
const mean = segmentationValues.reduce((a, b) => a + b, 0) / voxelCount;
|
||||
|
||||
const stats = {
|
||||
minValue: segmentationMin,
|
||||
maxValue: segmentationMax,
|
||||
meanValue: segmentationValues.reduce((a, b) => a + b, 0) / voxelCount,
|
||||
meanValue: mean,
|
||||
stdValue: Math.sqrt(
|
||||
segmentationValues.reduce((a, b) => a + b * b, 0) / voxelCount -
|
||||
segmentationValues.reduce((a, b) => a + b, 0) / voxelCount ** 2
|
||||
),
|
||||
segmentationValues
|
||||
.map((k) => (k - mean) ** 2)
|
||||
.reduce((acc, curr) => acc + curr, 0) / voxelCount),
|
||||
volume: voxelCount * spacing[0] * spacing[1] * spacing[2] * 1e-3,
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user