MICAflow Pipeline

Overview

The MICAflow pipeline provides a comprehensive framework for processing structural and diffusion MRI data through a series of coordinated steps implemented as a Snakemake workflow.

The pipeline is organized into several processing stages that are executed in a specific order, with dependencies managed automatically by Snakemake:

  1. Structural Processing: - Skull stripping of T1w and FLAIR images - Bias field correction - SynthSeg segmentation

  2. Registration: - T1w to MNI152 space - FLAIR to T1w space - DWI to T1w space (if DWI data is available)

  3. Texture Feature Generation: - Gradient magnitude maps - Relative intensity maps

  4. Diffusion Processing (Optional): - Denoising - Motion correction - Susceptibility distortion correction - Computation of FA and MD maps

  5. Quality Metrics: - Jaccard similarity for registration accuracy

Implementation Details

The pipeline implementation follows a modular design where each processing step is encapsulated as a separate rule in the Snakefile:

# Key pipeline rules from Snakefile
rule skull_strip:
    # Extract brain tissue from T1w/FLAIR images

rule bias_field_correction:
    # Correct intensity non-uniformities

rule synthseg_t1w:
    # AI-based segmentation of T1w images

rule registration_t1w:
    # Register FLAIR to T1w space

rule registration_mni152:
    # Register T1w to standard space

rule run_texture:
    # Generate texture feature maps

# Additional DWI processing rules when enabled
if RUN_DWI:
    rule dwi_denoise:
        # Remove noise from diffusion images

    rule dwi_motion_correction:
        # Correct for head motion in diffusion data

    # ... additional DWI rules ...

Quality Control

The pipeline includes quality assessment metrics to evaluate the performance of critical processing steps:

  1. Registration Accuracy: Jaccard similarity metrics between registered images

  2. Transformation Files: All transformation matrices and warp fields are saved for inspection

  3. Intermediate Results: Preprocessed images at each stage for quality checks

For complete implementation details, refer to the Snakefile in the repository.