DebugSlicer: Visualizing Tensors and Volumetric Data in VS Code

VS Code extension DebugSlicer enables right-click three-view linked inspection of 3D segmentation tensors within the debugger.
DebugSlicer is a newly released VS Code extension that solves the problem of frequently writing matplotlib scripts to inspect tensors when debugging 3D segmentation models. It lets you right-click a tensor and scroll through it in three linked views within the debugger. It supports PyTorch tensors (automatically moved to CPU), MONAI MetaTensor, NumPy arrays, and PIL images, and provides color mapping for segmentation labels to visually detect misalignment. For multi-GB volumetric data, it uses chunked loading to avoid memory blowup. Available on the VS Code Marketplace and open source, individually maintained, it's positioned as quick data inspection at breakpoints rather than a full visualization analysis tool.
The Data Pain Points of Debugging 3D Segmentation Models
When training 3D segmentation models, losses that won't decrease and abnormal metrics often aren't caused by the model architecture itself—the data is usually the culprit: flipped axes, incorrectly written augmentation operations, or misaligned labels. Troubleshooting these issues typically means stopping at a breakpoint, then opening the editor to write a chunk of matplotlib code to plot the tensor and take a look. This workflow interrupts the debugging flow and has to be repeated every time.
DebugSlicer attempts to solve this step. It's a VS Code extension that lets developers right-click a tensor directly in the debugger and scroll through the data using three linked views. Recently released on reddit, this tool turns "inspecting a tensor" from writing a script into a single right-click operation.

Supported Tensor Types and Linked Views
DebugSlicer covers common deep learning data structures:
- PyTorch tensors: automatically moved to CPU, no manual device handling needed;
- MONAI MetaTensor: a common wrapper for medical image segmentation;
- NumPy arrays and PIL images;
- Color mapping for segmentation labels: distinguishes classes with different colors, making it easy to visually determine whether labels are misaligned.
The three linked views are designed for volumetric data inspection scenarios. In 3D segmentation tasks, a single slice won't reveal problems—you need to compare along multiple axes to spot axis flips or label offsets. Linked views let developers scroll in one view while the other views sync to the same position, which is far more intuitive than saving images one by one and comparing them.
MetaTensor is MONAI's subclass wrapper around torch.Tensor, retaining tensor computation capabilities while attaching metadata such as spatial coordinate systems (affine transformation matrices), original channel descriptions, and voxel spacing. This information is critical for medical image segmentation: if the same array has a different affine, the corresponding anatomical positions are completely different. When debugging, if you only look at values without checking metadata, it's easy to miss "axis flips" caused by incorrect orientation matrices. DebugSlicer recognizing MetaTensor directly means it can visualize without losing this metadata—users don't need to convert MetaTensor to a regular tensor first before inspecting.
Color mapping for segmentation labels is necessary because label tensors are typically integer class indices (e.g., 0 for background, 1 for liver, 2 for spleen), and adjacent classes are nearly indistinguishable when displayed as grayscale images. Color mapping assigns a distinct color to each class, letting developers see at a glance whether labels align with image content, or whether an entire class is offset or missing. For multi-class segmentation tasks, this visual verification often exposes data errors earlier than computing Dice metrics.
Chunked Loading for Large Arrays
Volumetric data can easily be several GB, and loading it all into memory at once is both slow and prone to blowing up. DebugSlicer uses chunked loading (load in pieces) for multi-GB arrays, making it possible to debug large medical imaging or remote sensing data. This is critical for real workflows: if a tool can only handle small tensors, its value in real projects is greatly diminished.
According to the publisher, the extension's positioning is "taking a quick look at data at a breakpoint," not replacing full visualization analysis tools. Its advantage is zero configuration, zero scripts, embedded directly into the existing VS Code debugging workflow.
Chunked loading means not reading the entire array into memory at once, but instead reading only the slices or data blocks needed for the current view on demand. For multi-GB 3D volumetric data, full loading could consume tens of GB of memory and trigger swapping, causing the debugger to freeze. The chunking strategy keeps only data near the visible area, loading corresponding blocks when scrolling to new positions. The trade-off is slight delay on first scroll, but what you get in return is the ability to inspect large medical imaging or remote sensing volumetric data on an ordinary development machine. This is also the key engineering implementation that distinguishes DebugSlicer from simply print(tensor.shape).
Installation and Access
DebugSlicer is available on the VS Code Marketplace—search for the extension name CH4LLENG3R.debugslicer-python to install. Source code is hosted on GitHub (CH4LLENG3R/debugslicer-python), released independently and currently maintained by the author individually.
For developers who frequently debug PyTorch segmentation models in VS Code, this tool is worth adding to the toolbox. It doesn't solve all data problems, but it compresses the most frequent question—"what does the tensor look like"—into a single right-click.
Use Cases and Limitations
DebugSlicer is best suited for scenarios where anomalies are discovered mid-training and you need to quickly confirm input tensor shapes, orientations, and label alignment at a breakpoint. For MONAI users, native MetaTensor support saves the hassle of type conversion.
Its limitations are also clear: it currently only supports the data structures mentioned above, not TensorFlow or other frameworks; the interaction depth of linked views doesn't match professional medical imaging software; and as an individually maintained open source project, its long-term update cadence remains to be seen. If your debugging needs lean toward deep exploration rather than quick inspection, you may still need to pair it with other tools.
Overall, DebugSlicer fills a niche gap: "instant visualization within the debugger." It doesn't aim for comprehensive features, but does one thing smoothly: making data inspection no longer interrupt debugging.
One-line Summary
VS Code extension DebugSlicer enables right-click three-view linked inspection of 3D segmentation tensors within the debugger.
Paragraph Summary
DebugSlicer is a newly released VS Code extension that addresses the frequent need to write matplotlib scripts for tensor inspection when debugging 3D segmentation models, providing the ability to right-click a tensor and scroll through it in three linked views within the debugger. It supports PyTorch tensors (automatically moved to CPU), MONAI MetaTensor, NumPy arrays, and PIL images, and provides color mapping for segmentation labels to visually detect misalignment. For multi-GB volumetric data, it uses chunked loading to avoid memory blowup. The tool is available on the VS Code Marketplace and open source, individually maintained, positioned as quick data inspection at breakpoints rather than a full visualization analysis tool.
Related articles

AI SDK Workflow 2.0.95 Update: Stream Transform API Removed
AI SDK Workflow 2.0.95 removes the experimental_transform option from WorkflowAgent.stream() and the StreamTextTransform type export, as stream transforms cannot reliably cross workflow step boundaries. This article covers the reasons, migration points, and upgrade advice.

AI SDK Vue 4.0.163 Patch Released: Full Dependency Chain Update
AI SDK Vue releases patch 4.0.163, synchronously upgrading dependencies including ai@7.0.163 and @ai-sdk/provider-utils@5.0.75. This article analyzes the practical impact of this dependency chain update.

AI SDK Voyage 2.0.75 Patch Release: What the Dependency Chain Update Means
AI SDK's Voyage Provider releases patch version 2.0.75, syncing only @ai-sdk/provider and provider-utils deps. We analyze the impact and upgrade guidance.