diff --git a/notebooks/advanced_topics/ct_seg_to_tensors.ipynb b/notebooks/advanced_topics/ct_seg_to_tensors.ipynb index 7af6a27..2bb7b4e 100644 --- a/notebooks/advanced_topics/ct_seg_to_tensors.ipynb +++ b/notebooks/advanced_topics/ct_seg_to_tensors.ipynb @@ -50,7 +50,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q \"idc-index>=0.13\" \"highdicom>=0.28\" torch matplotlib" + "%pip install -q \"idc-index>=0.13\" \"highdicom>=0.29\" torch matplotlib" ] }, { @@ -233,11 +233,7 @@ " instead if you want a single label map in which each voxel holds a segment number.)\n", "- `.match_geometry(ct_volume)` rearranges the mask volume so that it lies on exactly the same voxel grid as the\n", " CT. This only pads, crops, flips, and/or permutes the array; it never interpolates, and it raises an error if the two\n", - " volumes cannot be aligned.\n", - "\n", - "We pass `tol=1e-4` (in units of voxels) to `match_geometry()` because the SEG files in this collection store\n", - "positions and pixel spacing with fewer decimal places than the CT files, so the two grids differ by a tiny\n", - "rounding error." + " volumes cannot be aligned." ] }, { @@ -247,7 +243,7 @@ "metadata": {}, "outputs": [], "source": [ - "mask_volume = seg.get_volume(combine_segments=False).match_geometry(ct_volume, tol=1e-4)\n", + "mask_volume = seg.get_volume(combine_segments=False).match_geometry(ct_volume)\n", "\n", "print(\"CT shape: \", ct_volume.shape)\n", "print(\"Mask shape:\", mask_volume.shape)" @@ -339,7 +335,7 @@ " dtype=np.float32,\n", " )\n", " seg = hd.seg.segread(seg_file)\n", - " mask_volume = seg.get_volume(combine_segments=False).match_geometry(ct_volume, tol=1e-4)\n", + " mask_volume = seg.get_volume(combine_segments=False).match_geometry(ct_volume)\n", "\n", " image = torch.from_numpy(ct_volume.array).unsqueeze(0)\n", " masks = torch.from_numpy(mask_volume.array).permute(3, 0, 1, 2)\n",