Skip to main content

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.

Metadata

Release files for picsl-brainmold 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picsl-brainmold 0.0.3
File Size Uploaded Provenance Actions
picsl_brainmold-0.0.3.tar.gz 40.4 kB With provenance Details for picsl_brainmold-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for picsl-brainmold 0.0.3
File Interpreter ABI Platform Actions
picsl_brainmold-0.0.3-py3-none-any.whl Python 3 none any Details for picsl_brainmold-0.0.3-py3-none-any.whl

Total release size: 52.4 kB

Release files / picsl_brainmold-0.0.3.tar.gz

Download URL picsl_brainmold-0.0.3.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d078635253440abe7ac9b9fee9a53787df5ae91ba90e76464992289df0982def
BLAKE2b-256 checksum
How to use checksums
4053041cd646cb7fc17ac1fb3c71cc8d568386a91a51f4679a9b9cb18a905a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2025.

Transparency log

Release files / picsl_brainmold-0.0.3-py3-none-any.whl

Download URL picsl_brainmold-0.0.3-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ab831b952fd5cedb49c34da4fb045573cae913e6667158c1ea36461040adcd2
BLAKE2b-256 checksum
How to use checksums
4c4f330c596ba8ec6f88fc6b58ff050fe173c1571cdba76bc4ae3303a4934feb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2025.

Transparency log

Security for picsl-brainmold 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for picsl_brainmold-0.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page