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:
- Mold Mode: Generate a cutting mold for a hemisphere.
- Slabs Mode: Generate masks for individual slabs.
- 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:
- 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
- Generate slab masks:
python -m picsl_brainmold slabs -w ./work -d subj001_cortex_dots_final.nii.gz
- Generate a paper template:
python -m picsl_brainmold paper -w ./work
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for picsl_brainmold-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7afcf009949b24e83f56f7cfb9821cfdec379b04da22329c0e9549212b8effaf |
|
MD5 | 82cb569b13ac7604bad7efc3cc3bd0ac |
|
BLAKE2b-256 | 1823ee5ebf09c4c4c3c9c759ae8f03ee1b0dceb7564b75163abf69acbece13aa |