HABIT
3.0.0

Get started

  • Installation
    • 1. Install Miniconda
    • 2. Open the conda terminal
    • 3. Create and activate the habit env
    • 4. Install HABIT from official PyPI
    • 5. Optional: PyTorch GPU
    • 6. Optional: PyRadiomics
    • Optional packages
    • From source (developers)
    • Problems?
  • Quickstart: Python API
    • Load the images
    • Build the analysis step by step
    • How many habitats, and why
    • Habitat maps
    • The feature table
    • What those numbers look like for one subject
    • Reuse the model on a new patient
    • Where to go next
  • Quickstart: YAML
    • Write the file and run it
    • Look at one habitat map
  • Quickstart: run the demo (YAML + CLI)
    • 1. Work directory and demo configs
    • 2. Get demo data
    • 3. Activate and check
    • 4. Run
    • Next

Habitat Guide

  • Habitat Guide
    • 0. Complete analysis
      • A complete habitat analysis
    • 1. Data In
      • Load from directory
      • Load from SimpleITK
      • Load from NumPy arrays
      • Load from NIfTI files
    • 2. Each stage
      • Voxel features
      • Custom features
      • Expression voxel features
      • Voxel texture and GPU
      • Feature preprocessing
      • Supervoxel feature extraction and acceleration
      • Preprocessing voxel texture before clustering
      • Extracting voxel intensities
      • Extracting a voxel texture
      • Clustering habitats from a derived map
      • Clustering habitats from a texture field
      • Preprocessing features before clustering
      • Comparing habitat maps with and without preprocessing
      • Partitioning a ROI into supervoxels
      • Fitting a cohort habitat model
      • Assigning habitat labels
    • 3. Habitat Quantification
      • Volume and fractions
      • Multiregional spatial interaction (MSI)
      • Intratumoral heterogeneity (ITH)
      • Graph features
      • Per-habitat radiomics
      • Whole-habitat radiomics
      • Deep-learning habitat embeddings
    • 4. Three habitat designs
      • Defining habitats in two steps
      • Defining habitats inside each subject
      • Pooling voxels across the cohort
    • 5. Apply a saved model
      • Applying a saved habitat model
    • 6. Matching Habitat Labels
      • Why habitat ids must be matched
      • Matching maps of the same voxels by overlap
      • Prototype matching step by step
      • Choosing the distance for prototype matching
      • Naming a new cohort with frozen prototypes
      • What matching changes in a cohort feature table
      • Matching habitat labels across subjects
    • 7. Parallel runs
      • Running the same study on each backend
    • 8. Precise Feature Screening
      • Precise voxel features

Reference

  • API Reference
    • Habitat analysis pipeline
      • habit.recipes: named study designs
        • Classes
        • Functions
        • Supporting recipes
      • Spec, RunPolicy, and YAML isomorphism
        • Classes
        • Functions
        • Stage and HabitatSpec.stages (source of truth)
        • Named-field constructor (deprecated)
        • Save / load and runnable YAML
        • Feature trees and the expression form
        • RunPolicy
        • Detect, validate, migrate YAML
        • Run the translated spec with a recipe
        • CLI
      • habit.contracts: in-memory data model
        • Classes
        • Functions
      • habit.voxel_features: per-voxel descriptors
        • Classes
        • Functions
      • habit.supervoxel: partition an ROI
        • Classes
        • Functions
      • habit.habitat_model: fit and assign habitats
        • Classes
        • Functions
      • habit.habitat_features: quantify habitats
        • Classes
        • Functions
      • habit.feature_preprocessing: scale voxel-feature matrices
        • Classes
        • Functions
      • habit.precision: repeatability screen
        • Classes
        • Functions
      • habit.pipeline: compose subject / table pipelines
        • Classes
        • Functions
      • habit.combiners: compose feature trees
        • Classes
        • Functions
      • habit.report: run-scoped persistence and figures
        • Classes
        • Functions
      • habit.viz: publication overlays
        • Classes
        • Functions
      • Execution backends
        • Classes
        • Functions
        • Backend selection from CLI and run_from_yaml
        • SerialBackend
        • Failure policy: continue vs fail_fast
        • ProcessPoolBackend
        • CheckpointStore
      • Adapters (habit.adapters)
        • Classes
        • Functions
        • DirectoryDataSource
        • FileImageRef
        • DirectoryResultWriter
      • habit.datasets: demo pack and synthetic builders
        • Classes
        • Functions
      • Numeric kernels (habit.kernels)
        • Classes
        • Functions
        • Habitat metrics (examples)
        • Graph topology kernels
        • ICC kernels
        • Image perturbation
        • Classification statistics
        • Habitat label matching
        • Stability
      • Component registry
        • Classes
      • Plugin introspection API
        • Classes
        • Functions
        • load_plugins resilience
        • v1 protocol domains
        • Which Spec / create names exist
        • Types
        • Registering a third-party plugin
      • Errors and optional dependencies
        • Classes
        • When each exception is raised
        • Soft-failure switches (not exceptions)
    • Supporting bookmarks
      • Tabular ML (bookmark)
        • Classes
        • Functions
      • Low-level image I/O helpers
        • Classes
        • Functions
        • GeometryPolicy modes
        • Low-level radiomics extraction
      • Image preprocessing (bookmark)
        • Functions
    • Narrative guides
      • Python API guide (v2.0)
        • Architecture in one diagram
        • Mental model
        • Primary entry: Study (cohort recipe)
        • Advanced: declare stages yourself
        • Common workflows
        • Canonical end-to-end example
        • Where to go next
        • Tabular machine learning
      • Data model (habit.contracts)
        • Geometry
        • Image references and volumes
        • Subject and Cohort
        • Habitat artefacts
        • FeatureTable
        • Outcome
        • Provenance
        • RunManifest and StudyResult
        • Operator protocols
      • Domain protocols and registries
        • Import style
        • Single-subject operators
        • Five habitat protocols
        • Hand-assembled two-step chain
        • SubjectPipeline
        • HabitatComponents (spec → live objects)
        • Composing features: trees, combiners, and statistics
        • Precision screen: perturbations and precise features
        • Randomness (Seedable)
        • Built-in registry domains
        • See also
      • Habitat domain API
        • Protocols
        • Ordered stages and the shared executor
        • Registry pattern (all domains)
        • Voxel feature extractors
        • Supervoxelizers
        • Supervoxel feature extractors
        • Step inspection (optional)
        • Habitat model fitters
        • Habitat assigners
        • Habitat feature extractors
        • SubjectPipeline
        • Hand-assembled two-step chain
        • Image preprocessing domain
      • Table ML domain API
        • Table preprocessors
        • Feature selectors
        • Classifiers
        • Metrics
        • Statistical helpers
        • TablePipeline
        • TablePipeline is an sklearn.pipeline.Pipeline
  • Habitat Spec component catalog
    • How a HabitatSpec is assembled
    • Python and YAML are the same document
    • 1. Voxel feature extraction
      • A. Single-modality voxel extraction
      • B. Multi-modality voxel composition
      • voxel_feature_extractor
    • 2. Feature preprocessing
      • feature_preprocessing_method
    • 3. Supervoxel partition
      • supervoxelizer
    • 4. Supervoxel features
      • A. Single-modality supervoxel extraction
      • B. Multi-modality supervoxel composition
      • supervoxel_feature_extractor
    • 5. Pool
      • pooling
    • 6. Fit habitats
      • habitat_model_fitter
    • 7. Assign
      • habitat_assigner
    • 8. Quantify
      • habitat_feature_extractor
    • What to read next
  • Features from habitat maps
    • MSI Features
      • Output
      • Definition
      • Formula
      • Output columns
      • Implementation
      • References
    • ITH Score
      • Output
      • Definition
      • Formula
      • Output columns
      • Notes
      • Implementation
      • References
    • Graph topology features
      • Output
      • Notation and domains
      • Graph construction
        • Nodes (connected regions)
        • Edges: centroid distance
        • Edges: minimum voxel distance
        • Edges: voxel adjacency (opt-in)
      • Single-habitat metrics
      • Pairwise metrics
      • Extended metrics
        • Small-worldness and random-graph nulls
      • VOI-normalized companions
      • Null-model comparisons for topology
      • Construction options
      • What this family does not claim
      • Implementation
      • References
      • See also
    • Non-radiomics Morphology
      • Output
      • Definition
      • Formula
      • Output columns
      • Implementation
    • Traditional Radiomics
      • Definition
      • Implementation
      • Output columns
      • Feature definitions
        • PyRadiomics alignment
        • IBSI-1 Phase 1 digital phantom
    • Whole / Each Habitat Radiomics
      • whole_habitat
        • Output
        • Definition
        • Output columns
        • Implementation
      • each_habitat
        • Output
        • Definition
        • Output columns
        • Implementation
      • Compare habitats (cohort or one subject)
  • Matching habitat labels across fits and subjects
    • When matching is needed
    • Choosing a method
    • Why a single reference is not enough
    • Prototype matching (cohort)
      • What describes a habitat
      • Algorithm
      • Two subjects: pairwise matching as a special case
      • Distance metrics
      • Naming new subjects with frozen prototypes
      • Different habitat counts
    • Assumptions and limitations
    • Usage
    • References
  • CLI and YAML
    • Configuration recipe catalog
      • By workflow
      • Starter demos
      • Field reference pages
    • Habitat Segmentation Configuration
      • Habitat Analysis Configuration Parameters
        • habitat_segmentation.supervoxel — SLIC Superpixel Configuration
        • Habitat Stage-1 Parallelism and Checkpoint Resume (Top-Level Field Reference)
    • Feature Extraction Configuration
    • Traditional Radiomics Configuration
      • paths
      • processing
      • export
      • logging
      • Backward-compatible flat keys
      • PyRadiomics parameter YAML
    • Preprocessing Configuration
      • Preprocessing configuration parameters
      • DICOM sort configuration (habit sort-dicom)
    • DICOM Sort Configuration
      • Top-level fields
      • Notes
    • Auxiliary Tools and Data Configuration
      • Data configuration parameters
      • ICC analysis configuration (habit icc)
      • Traditional radiomics CLI configuration (habit radiomics)
      • Repository configuration template index
      • Configuration file validation
      • FAQ
    • Supporting bookmarks
  • Command reference
  • FAQ
    • Install
    • Run
    • Data
  • Upstream Dependencies and Documentation Links
    • Image preprocessing (habit preprocess)
    • Habitat segmentation (habit get-habitat)
    • Habitat features and traditional radiomics (habit extract / habit radiomics)
    • Machine learning (habit model / habit cv)
    • Model comparison (habit compare)
    • ICC / Test–retest / other
    • ROI delineation (external tools)

Developer

  • Architecture
    • Design principles
    • The six layers
    • Two execution paths
    • Key components
    • Subsystems
    • CLI-to-core mapping
    • Design philosophy
    • Habitat and API glossary
    • Invariants
    • Where to look in the repo
    • See also
  • Contributing
    • How to contribute
      • Report bugs
      • Submit code
    • Code style
    • Documentation
    • Development setup
    • How to run tests
    • Pull requests
    • Code of conduct
  • Extending HABIT
    • v1 registry and entry points
    • v1 custom voxel feature extractors
    • Extension principles
    • Image preprocessing and tabular ML
    • FAQ
    • Next steps

Changelog

  • Changelog

Acknowledgments

  • Acknowledgments
    • Core developers
    • Future developers
    • Clinical collaborators
    • Special thanks
    • Open source community
    • How to contribute
    • Contact
HABIT
  • CLI and YAML
  • View page source

CLI and YAML

YAML templates and habit commands live only here, not in the Habitat Guide. Copy a file from config/, edit the ★ fields (usually data and output paths), and run the matching command.

Command list: Command reference. Catalog of templates: Configuration recipe catalog.

  • Configuration recipe catalog
    • By workflow
    • Starter demos
    • Field reference pages
  • Habitat Segmentation Configuration
    • Habitat Analysis Configuration Parameters
  • Feature Extraction Configuration
  • Traditional Radiomics Configuration
    • paths
    • processing
    • export
    • logging
    • Backward-compatible flat keys
    • PyRadiomics parameter YAML
  • Preprocessing Configuration
    • Preprocessing configuration parameters
    • DICOM sort configuration (habit sort-dicom)
  • DICOM Sort Configuration
    • Top-level fields
    • Notes
  • Auxiliary Tools and Data Configuration
    • Data configuration parameters
    • ICC analysis configuration (habit icc)
    • Traditional radiomics CLI configuration (habit radiomics)
    • Repository configuration template index
    • Configuration file validation
    • FAQ

Supporting bookmarks

These are not Habitat Guide pages. Templates live under config/.

  • Image preprocessing (N4, resample, registration): Preprocessing Configuration

  • DICOM sort / rename: DICOM Sort Configuration

  • Dice, ICC, merge-csv, and other utilities: Auxiliary Tools and Data Configuration

  • Whole-ROI radiomics CLI: Traditional Radiomics Configuration

Previous Next

© Copyright 2024, HABIT Team.

Built with Sphinx using a theme provided by Read the Docs.