Connect EzDent to the original EzServer API

This commit is contained in:
SantaSpeen committed 2026-11-23 17:17:15 +03:00
1 parent 8d93e526c3
commit b11a8f62f9
13 files changed
+855 -108

No files matched your search

+9 -2
View File
@@ -25,7 +25,8 @@ struct DICOMVolume {
guard !urls.isEmpty, urls.count <= 4096 else { throw DICOMError.geometry }
let first = try DICOMImage(url: urls[0])
let planeSize = first.width * first.height
guard planeSize <= 64_000_000 / urls.count else { throw DICOMError.unsupported }
let voxelLimit = urls.count == 1 ? 64_000_000 : 96_000_000
guard planeSize <= voxelLimit / urls.count else { throw DICOMError.unsupported }
size = SIMD3(first.width, first.height, urls.count == 1 ? first.frames : urls.count)
window = first.window
inverted = first.monochrome1
@@ -56,7 +57,13 @@ struct DICOMVolume {
}
let sorted = try Self.sortSlices(geometry)
spacing = sorted.spacing
pixels = sorted.order.flatMap { slices[$0] }
var ordered: [Float] = []
ordered.reserveCapacity(planeSize * urls.count)
for index in sorted.order {
ordered.append(contentsOf: slices[index])
slices[index].removeAll()
}
pixels = ordered
}
minimum = pixels.min() ?? 0
maximum = pixels.max() ?? 1