Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions darwin/exporter/formats/nifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def build_output_volumes(

output_volumes[series_instance_uid] = {
class_name: Volume(
pixel_array=np.zeros(volume_dims),
pixel_array=np.zeros(volume_dims, dtype=np.uint8),
affine=affine,
original_affine=original_affine,
dims=volume_dims,
Expand Down Expand Up @@ -460,7 +460,7 @@ def populate_output_volumes_from_raster_layer(
next_global_id += 1

# Initialize multilabel volume
multilabel_volume = np.zeros(slot.metadata["shape"][1:])
multilabel_volume = np.zeros(slot.metadata["shape"][1:], dtype=np.uint8)

# Second pass: populate the multilabel volume using the global mapping
for frame_idx in sorted(frames.keys()):
Expand All @@ -470,7 +470,7 @@ def populate_output_volumes_from_raster_layer(
mask_2d = decode_rle(dense_rle, slot.width, slot.height)

# Convert the mask_2d using the global mapping
converted_mask_2d = np.zeros_like(mask_2d)
converted_mask_2d = np.zeros_like(mask_2d, dtype=np.uint8)
local_mapping = frame_data.data["mask_annotation_ids_mapping"]

for mask_id, local_id in local_mapping.items():
Expand Down