Vuresoft.Dicom.Sqlite
0.2.5
dotnet add package Vuresoft.Dicom.Sqlite --version 0.2.5
NuGet\Install-Package Vuresoft.Dicom.Sqlite -Version 0.2.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vuresoft.Dicom.Sqlite" Version="0.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vuresoft.Dicom.Sqlite" Version="0.2.5" />
<PackageReference Include="Vuresoft.Dicom.Sqlite" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Vuresoft.Dicom.Sqlite --version 0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vuresoft.Dicom.Sqlite, 0.2.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Vuresoft.Dicom.Sqlite@0.2.5
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Vuresoft.Dicom.Sqlite&version=0.2.5
#tool nuget:?package=Vuresoft.Dicom.Sqlite&version=0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Vuresoft.Dicom.Sqlite
** BETA VERSION **
A .NET library for storing DICOM medical images in SQLite databases. Each DICOM study is stored in its own SQLite database file, containing all instances with their complete image data.
Features
- Store complete DICOM studies in single SQLite database files
- One database per study for easy management and portability
- Retrieve DICOM data by Study, Series, and Instance UIDs
- Memory-efficient streaming APIs for large datasets
- Bulk import from directories or file lists
Installation
Add reference to Vuresoft.Dicom.Sqlite
project or NuGet package (when available).
Basic Usage
Create a database from a directory of DICOM files
using Vuresoft.Dicom.Sqlite;
// Create a new database from a folder containing DICOM files
var db = await SqliteDicomStudyDb.CreateFromDirectoryAsync(
sourceDirectory: @"C:\DicomFiles\Study123",
databasePath: @"C:\Studies\study123.db"
);
Add DICOM files to an existing database
using var db = new SqliteDicomStudyDb(@"C:\Studies\study123.db");
// Add a single file
await db.AddInstanceFromFileAsync(@"C:\DicomFiles\image.dcm");
// Import multiple files
var files = new[] { "file1.dcm", "file2.dcm", "file3.dcm" };
await db.ImportFilesAsync(files);
// Import entire directory
await db.ImportDirectoryAsync(@"C:\DicomFiles\Study123");
Retrieve DICOM data
using var db = new SqliteDicomStudyDb(@"C:\Studies\study123.db");
// Get a single instance as DicomDataset
var dataset = await db.GetInstanceAsync(studyUid, seriesUid, sopUid);
// Get raw DICOM bytes
var bytes = await db.GetInstanceBytesAsync(studyUid, seriesUid, sopUid);
// Get all instances in a series
var seriesDatasets = await db.GetSeriesAsync(studyUid, seriesUid);
Stream large datasets efficiently
using var db = new SqliteDicomStudyDb(@"C:\Studies\study123.db");
// Stream all DICOM datasets without loading into memory
await foreach (var dataset in db.GetAllInstancesDataSetsStreamAsync())
{
// Process each dataset as it streams from the database
var patientName = dataset.GetSingleValue<string>(DicomTag.PatientName);
Console.WriteLine($"Processing: {patientName}");
}
// Stream raw DICOM bytes for an entire study
await foreach (var imageBytes in db.GetStudyBytesStreamAsync(studyUid))
{
// Process each DICOM file's raw bytes
await ProcessDicomBytesAsync(imageBytes);
}
Database Structure
Each SQLite database contains:
- Study table - Study Instance UID
- Series table - Series Instance UIDs linked to studies
- Instance table - SOP Instance UIDs with complete DICOM file data stored as BLOB
Dependencies
- fo-dicom - DICOM file parsing
- Microsoft.EntityFrameworkCore.Sqlite - Database access
- .NET 10.0 or later
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- fo-dicom (>= 5.2.2)
- Microsoft.EntityFrameworkCore (>= 9.0.9)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.