A lightweight, cross-platform DICOM viewer built with .NET MAUI.
Focus areas:
- fast metadata inspection
- side-by-side comparison
- basic metadata editing
- simple conversions (e.g., extracting encapsulated video)
- highlighting of non-conformant values
- Cross-platform UI (Windows, macOS/MacCatalyst, Android, iOS)
- Two-pane workflow: load a DICOM on the left/right and compare tag-by-tag
- Fast metadata browser with search, tag filter, sorting, and a “differences only” toggle
- Inline editing of left/right values with instant highlighting
- Validation cues for obviously invalid or mismatched values
- Multi-frame support: frame slider + simple timer-based playback
- Encapsulated video (H.264/MPEG-4) extraction to a temp file and inline playback
- Pragmatic preview: renders a first frame when it is not a video
- File association friendly (open from OS into a side)
-
.NET SDK 8.0 (or the version used in the solution)
-
.NET MAUI workloads for your target platforms
-
NuGet packages:
FellowOakDicomCommunityToolkit.MauiCommunityToolkit.Maui.MediaElementSixLabors.ImageSharp
using CommunityToolkit.Maui;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMediaElement()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
return builder.Build();
}
}xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"If you use native codecs/transcoding, initialize once at startup:
using FellowOakDicom;
using FellowOakDicom.Imaging;
new DicomSetupBuilder()
.RegisterServices(s => s.AddFellowOakDicom())
.SkipValidation()
.Build();# Restore and build
dotnet restore
dotnet build
# Example: run on Windows
dotnet run -f net8.0-windows10.0.19041.0Use Visual Studio to select and run Android, iOS, or MacCatalyst targets.
-
Loader (
DicomLoader)- Opens DICOM via Fellow Oak DICOM
- Builds safe metadata (skips large/binary tags)
- Detects encapsulated video; if present, extracts the elementary stream (H.264/MPEG-4) to the app cache and exposes a path
- For images, renders a first frame and exposes a delegate to render arbitrary frames for multi-frame studies
-
Per-file ViewModel (
DicomFileViewModel)- Holds
FileName,Image(preview),Metadata(read-only),Rows, andRowMap - Video case:
VideoPathset (e.g.,.mp4),FrameCount = 0,GetFrameImageSource = null - Multi-frame case:
VideoPath = null,FrameCount = NumberOfFrames,GetFrameImageSource = idx => RenderFrameAsImageSource(ds, idx)
- Holds
-
Main ViewModel (
MainViewModel)- Holds Left and Right files, combined comparison table, filtering/sorting state
- Multi-frame playback via
IDispatcherTimer(videos play inMediaElement) - Exposes
LeftHasVideo,Left/RightVideoSource,Left/RightHasMultiFrame,FrameCount,FrameIndex, etc.
-
UI (XAML)
- Each side shows either an
Image(no video) or aMediaElement(video) - Compact overlay shows key patient/study fields
- Bottom half shows the combined metadata grid with inline editing
- Each side shows either an
-
Open files Click the L (left) or R (right) button to pick a DICOM file for that side.
-
Preview
- Video:
MediaElementwith playback controls (viaCommunityToolkit.Maui.MediaElement) - Multi-frame: frame slider and play/pause
- Single-frame: static preview of frame 0
- Video:
-
Browse and filter metadata
- Free-text filter (tag, name, or value)
- Tag-Filter list to focus on a single tag
- Toggles: “Only differences” and “Only invalid”
-
Edit values
- Edit left/right values inline; highlighting updates immediately
-
Encapsulated video extraction If the DICOM contains H.264/MPEG-4, the elementary stream is written to the app cache (e.g.,
.mp4) and bound to the player. -
Future ideas Transfer syntax normalization, anonymization, bulk export.
- Basic heuristics flag suspicious or invalid values and differences between sides.
- Extend validators as needed (e.g., stricter VR/VM checks, modality-specific rules).
-
Video does not play
- Ensure
CommunityToolkit.Maui.MediaElementis installed and enabled inMauiProgram.cs. - Confirm platform codec support (H.264 recommended).
- Check that
LeftVideoSource/RightVideoSourcepoints to a valid file (app cache).
- Ensure
-
No preview or wrong colors
- Some uncommon photometric interpretations or high bit depths may need extra handling.
-
Large files slow UI
- Large/binary tags are skipped; consider virtualization for extremely large tag lists.
- Optional write-back of edited metadata
- Expanded validators and conformance profiles
- Bulk conversion/export tools
- Keyboard shortcuts and advanced tag editors
Apache-2.0