Skip to content

Commit

Permalink
Use defined slice_thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
erikogabrielsson committed Oct 28, 2024
1 parent add1df1 commit 89cf25f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wsidicom/instance/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def create_instance_dataset(
# DICOM 2022a part 3 IODs - C.8.12.4.1.2 Imaged Volume Width,
# Height, Depth. Depth must not be 0. Default to 0.5 microns
slice_thickness = 0.0005
pixel_measure_sequence.SliceThickness = DSfloat(0.0005, True)
pixel_measure_sequence.SliceThickness = DSfloat(slice_thickness, True)
shared_functional_group_sequence.PixelMeasuresSequence = DicomSequence(
[pixel_measure_sequence]
)
Expand Down Expand Up @@ -899,7 +899,7 @@ def _ext_depth_of_field(self) -> Tuple[bool, Optional[int], Optional[float]]:
@staticmethod
def _get_spacing_between_slices_for_focal_planes(
focal_planes: Sequence[float],
) -> float:
) -> Optional[float]:
"""Return spacing between slices in mm for focal planes (defined in
um). Spacing must be the same between all focal planes for TILED_FULL
arrangement.
Expand All @@ -911,12 +911,12 @@ def _get_spacing_between_slices_for_focal_planes(
Returns
-------
float
Spacing between focal planes.
Optional[float]
Spacing between focal planes, or None if only one focal plane.
"""
if len(focal_planes) == 1:
return 0.0
return None
spacing: Optional[float] = None
sorted_focal_planes = sorted(focal_planes)
for index in range(len(sorted_focal_planes) - 1):
Expand Down

0 comments on commit 89cf25f

Please sign in to comment.