liveBook · Manning

Slice

As explained in Deep Learning with PyTorch, Second Edition

A two-dimensional cross-section extracted from a CT scan for segmentation training or visualization.

A slice is a two-dimensional cross-section extracted from a volumetric CT scan. Treating each slice as a separate image lets a 2D model such as SAM segment suspected nodules while keeping results easier to visualize. section 15.6.1 section 15.1

A CT slice supports the segmentation workflow by providing:

Extracting one slice

The extraction code converts an XYZ center into image coordinates, selects one axis of the CT array, and returns a two-dimensional tensor. A retrieved example has shape torch.Size([512, 512]) and can be plotted with its candidate nodule point. section 15.6.2

Figure 15.10 Lung CT scan slice with segmentation mask over nodule
figure

View a lung CT slice with a segmentation mask over a nodule. section 15.6.1

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Explains extraction, coordinates, dimensions, visualization, caching, and spacing tradeoffs, but stops short of full 3D processing.
Examples
Uses lung CT slices, candidate nodule points, segmentation masks, coordinate-based extraction, and 512-by-512 tensors.
What it assumes
Assumes volumetric CT data, candidate coordinates, and basic dataset handling while teaching how to obtain a 2D slice.
What you can do after
Build it from scratch by extracting, inspecting, plotting, caching, and pairing CT slices with masks for segmentation training.
How it connects
Connects CT scans with segmentation, masks, datasets, SAM, and classification.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.