Skip to main content

NeuroModex VNet DBS: segmentation and conductivity mapping utilities

Project description

Neuromodex VNet DBS

Deep‑learning utilities for DBS workflows, including MRI brain tissue segmentation (VNet) and conductivity mapping. This repository provides a Python package and optional 3D Slicer modules to integrate the models into imaging workflows.

Note: This project is still under development.

Features

  • VNet‑based multi‑class brain tissue segmentation
  • Conductivity mapping utilities
  • Pre/post‑processing
  • PyTorch inference with automatic device selection (CPU/GPU)
  • 3D Slicer plugin scaffolding for GUI‑based use
  • The segmentation model was trained using labels generated with ELMA, a semi‑automatic DBS tissue classification/segmentation tool (commonly used to classify tissues such as grey matter, white matter, blood, and CSF for patient‑specific DBS FEM modeling workflows). [1] [2]

Installation

Requirements: Python 3.9+

pip install neuromodex-vnet-dbs

The wheel bundles the neuromodex_vnet_dbs/weights/ directory so the packaged models can load without any extra downloads.

Quick start Segmentation

Note that the input image must be skull stripped and preferably N4 bias corrected. Good choices are HD_BET and SimpleITK's N4BiasFieldCorrection.

import SimpleITK as sitk
from neuromodex_vnet_dbs import SegmentationPipeline

# Load an input image (e.g., NIfTI)
img = sitk.ReadImage("/path/to/volume.nii.gz")
# or
img = "path/to/volume.nii.gz"

# Run the segmentation pipeline
pipe = SegmentationPipeline(img)  # pass either as string or sitk volume
result = pipe.segment_fast(img)  # ~7 seconds

# or this for clearer csf segmentation
result = pipe.segment_gmm_csf(img)  # ~1.5 minutes

# The returned object is the segmented image

You can also use the segment_vnet function to segment a volume with a single command:

from neuromodex_vnet_dbs.easy_segment import segment_vnet

segmented = segment_vnet("path/to/mri_image.nii.gz")

Quick Start Conductivity Mapping

import SimpleITK as sitk
from neuromodex_vnet_dbs import ConductivityProcessingPipeline

mri_img = sitk.ReadImage("path/to/mri_image.nii.gz")
seg_img = sitk.ReadImage("path/to/seg_image.nii.gz")

pipe = ConductivityProcessingPipeline(seg_img, mri_img)
result = pipe.run()

Or use the easy wrapper:

from neuromodex_vnet_dbs.easy_conductivity_mapping import map_conductivities

conductivities = map_conductivities("path/to/mri_image.nii.gz", "path/to/seg_image.nii.gz")

3D Slicer integration

This repo includes helper scripts and example module folders under slicer/. These scripts can also be used as CLI tools.

  • To install one or more module folders into your local Slicer profile, run either:
from neuromodex_vnet_dbs.slicer import interactive_installation

interactive_installation()

or

python neuromodex_vnet_dbs/slicer/slicer_install_plugin.py

Follow the prompts to choose the plugin(s) and target Slicer installation. Restart Slicer afterwards.

The plugins can then be found in Segmentation/BrainSegmentation and Electrical Conductivity/ConductivityMapping.

Note: The first execution in slicer will take a few minutes to download all the required data.

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

Citation

If you use this project in your research, please cite the appropriate papers for VNet and any downstream methods you apply.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuromodex_vnet_dbs-0.2.2.tar.gz (28.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuromodex_vnet_dbs-0.2.2-py3-none-any.whl (28.3 MB view details)

Uploaded Python 3

File details

Details for the file neuromodex_vnet_dbs-0.2.2.tar.gz.

File metadata

  • Download URL: neuromodex_vnet_dbs-0.2.2.tar.gz
  • Upload date:
  • Size: 28.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for neuromodex_vnet_dbs-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0b1cf9852e9e27492d01ce0ffd164b46565f7bb64b90ceae1df9d085e4512c18
MD5 6f9fab13239ac634bc84ec0d4b3fd31a
BLAKE2b-256 63e86186828e62c0d7d48c6fc28e7420094a4d19c94ee0473ed6251e552bf40d

See more details on using hashes here.

File details

Details for the file neuromodex_vnet_dbs-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for neuromodex_vnet_dbs-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4677411d617ee6611d482fa9fbfe745d2b7def31ea0156cfa5aed92ab4ded57f
MD5 d3595923dd90964367da478f241d3411
BLAKE2b-256 b38903e17c7d778bae62c950f8738795fe7f8b589af706d464885ae5e0628c61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page