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++;
|
voxelCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const mean = segmentationValues.reduce((a, b) => a + b, 0) / voxelCount;
|
||||||
|
|
||||||
const stats = {
|
const stats = {
|
||||||
minValue: segmentationMin,
|
minValue: segmentationMin,
|
||||||
maxValue: segmentationMax,
|
maxValue: segmentationMax,
|
||||||
meanValue: segmentationValues.reduce((a, b) => a + b, 0) / voxelCount,
|
meanValue: mean,
|
||||||
stdValue: Math.sqrt(
|
stdValue: Math.sqrt(
|
||||||
segmentationValues.reduce((a, b) => a + b * b, 0) / voxelCount -
|
segmentationValues
|
||||||
segmentationValues.reduce((a, b) => a + b, 0) / voxelCount ** 2
|
.map((k) => (k - mean) ** 2)
|
||||||
),
|
.reduce((acc, curr) => acc + curr, 0) / voxelCount),
|
||||||
volume: voxelCount * spacing[0] * spacing[1] * spacing[2] * 1e-3,
|
volume: voxelCount * spacing[0] * spacing[1] * spacing[2] * 1e-3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user