Skip to main content

BrainMold: Package for 3D printing cutting molds for ex vivo MRI

Project description

PICSL BrainMold

PICSL BrainMold is a tool designed to generate 3D printed brain molds, slab masks, and paper templates for precise brain cutting. This tool can be used for processing MRI brain scans to create molds for hemispheres and masks for slabs, with support for additional processing such as dot placement guidance.

Installation

You can install picsl_brainmold via pip:

pip install picsl_brainmold

Usage

The picsl_brainmold tool provides three main commands to guide the user through the process of generating brain molds, slabs, and paper templates:

  1. Mold Mode: Generate a cutting mold for a hemisphere.
  2. Slabs Mode: Generate masks for individual slabs.
  3. Paper Mode: Generate a paper template for block cutting.

Command Line Interface

General Syntax

python -m picsl_brainmold <command> [options]

Where <command> is one of:

  • mold: For generating the cutting mold for a hemisphere.
  • slabs: For generating slab masks.
  • paper: For generating a paper template for cutting.

Mold Mode

Generates a cutting mold for one hemisphere of the brain.

python -m picsl_brainmold mold -s <subject_id> -H <hemisphere> -i <mri_file> <mask_file> -w <work_dir> [options]

Required options:

  • -s, --subject: The subject ID, used in naming files.
  • -H, --hemisphere: Hemisphere to process ("L" for left or "R" for right).
  • -i, --input: The input MRI file and brain mask (generate using ITK-SNAP).
  • -w, --work: The work directory for output (will be created if needed).

Optional options:

  • -g, --guide: Generate guide images for dot placement at a given depth (in mm) from the anterior.

Slabs Mode

Generates masks for individual slabs based on a dots segmentation image. It is recommended that all dots be placed on the same plane within each slab, using the dot guidance image.

python -m picsl_brainmold slabs -w <work_dir> -d <dots_image>

Required options:

  • -w, --work: The work directory (from previous run of the tool).
  • -d, --dots: The dots segmentation image file.

Paper Mode

Generates a paper template for block cutting based on the generated slabs.

python -m picsl_brainmold paper -w <work_dir>

Required options:

  • -w, --work: The work directory.

Example Workflow

Here’s an example workflow for processing a brain scan and generating the necessary files:

  1. Generate the brain mold:
python -m picsl_brainmold mold -s subj001 -H L -i subj001_reslice.nii.gz subj001_hemisphere_mask.nii.gz -g 0.2 -w ./work
  1. Generate slab masks:
python -m picsl_brainmold slabs -w ./work -d subj001_cortex_dots_final.nii.gz
  1. Generate a paper template:
python -m picsl_brainmold paper -w ./work

License

This project is licensed under the MIT License.

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

picsl_brainmold-0.0.3.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

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

picsl_brainmold-0.0.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file picsl_brainmold-0.0.3.tar.gz.

File metadata

  • Download URL: picsl_brainmold-0.0.3.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for picsl_brainmold-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d078635253440abe7ac9b9fee9a53787df5ae91ba90e76464992289df0982def
MD5 def1bf0ff57187487193363f5ed91084
BLAKE2b-256 4053041cd646cb7fc17ac1fb3c71cc8d568386a91a51f4679a9b9cb18a905a27

See more details on using hashes here.

Provenance

The following attestation bundles were made for picsl_brainmold-0.0.3.tar.gz:

Publisher: python-publish.yml on pyushkevich/brainmold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picsl_brainmold-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for picsl_brainmold-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab831b952fd5cedb49c34da4fb045573cae913e6667158c1ea36461040adcd2
MD5 db4a0d8561d3ac01e0a691d003bfbb8b
BLAKE2b-256 4c4f330c596ba8ec6f88fc6b58ff050fe173c1571cdba76bc4ae3303a4934feb

See more details on using hashes here.

Provenance

The following attestation bundles were made for picsl_brainmold-0.0.3-py3-none-any.whl:

Publisher: python-publish.yml on pyushkevich/brainmold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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