Quick Start¶
This guide will walk you through running your first SPIMquant workflow.
Prerequisites¶
Before starting, ensure you have:
- Installed SPIMquant
- A BIDS-formatted SPIM dataset (see SPIMprep for converting raw data)
- Sufficient disk space and memory (see Hardware Requirements)
Step 1: Prepare Your Data¶
SPIMquant requires a BIDS dataset with SPIM microscopy data. Your directory structure should look like:
bids_dataset/
├── dataset_description.json
├── participants.tsv
└── sub-01/
└── micr/
└── sub-01_sample-brain_stain-YOPRO_SPIM.ome.zarr.zip
Using SPIMprep
Use SPIMprep to convert your raw microscopy data to BIDS format.
Step 2: Run a Dry Run¶
Always start with a dry run to verify the workflow:
The -n flag performs a dry run that:
- Validates your input data
- Shows what jobs would be executed
- Checks for missing files or configuration issues
- Does not actually process any data
Using Test Data
For your first run, use the absolute path to the test dataset:
Step 3: Run the Workflow¶
Once the dry run succeeds, run the full workflow:
Options explained:
participant: Run subject-level analysis--cores all: Use all available CPU cores- Alternative:
--cores 8to use 8 cores
For Zarr Zipstore Data¶
If your SPIM files end with *.ome.zarr.zip, add the filter option:
pixi run spimquant /path/to/bids/dir /path/to/output/dir participant \
--filter-spim extension='ome.zarr.zip' \
--cores all
Step 4: Monitor Progress¶
SPIMquant will display progress as it processes:
Building DAG of jobs...
Job counts:
count jobs
1 all
3 create_template_crop
...
[Mon Jan 15 10:23:45 2024]
rule convert_to_nifti:
input: ...
output: ...
Processing time depends on:
- Dataset size
- Available compute resources
- Number of subjects
- Resolution of data
Step 5: View Results¶
After processing completes, find your results in the output directory.
Key output files:
micr/*_space-{template}_SPIM.nii.gz: Registered SPIM data in template spaceseg/*_mask.ozx: Full-resolution segmentation resultsparc/*_from-{template}_dseg.nii.gz: Atlas-based parcellation mapstabular/*_segstats.tsv: Quantitative statistics by brain regiongroup/*_groupstats.tsv: Group-level statistical results
Step 6: Generate a Report¶
Create an HTML report of the workflow:
This generates report.html with:
- Workflow graph with all jobs
- Runtime statistics
- Configuration details
- Clickable nodes to inspect code
Common Issues¶
Memory Errors¶
If you encounter out-of-memory errors:
# Use fewer cores
pixi run spimquant ... --cores 4
# Or process one subject at a time
pixi run spimquant ... --cores all --until convert_to_nifti
Input Data Not Found¶
Ensure your data follows BIDS naming conventions:
- Files must have proper BIDS entities (sub-, sample-, stain-)
- Must be in correct directory structure (sub-XX/micr/)
- Check file extensions match your filter
Registration Failures¶
If registration fails:
- Check input data quality
- Verify template compatibility
- Try different registration stain
- Adjust registration parameters in config
Next Steps¶
- Configuration Guide: Customize your workflow
- Group Analysis: Compare across experimental groups
- CLI Reference: Explore all command options
- Tutorials: In-depth workflow examples
Example Workflows¶
Basic Processing¶
# Process all subjects with default settings
pixi run spimquant ./bids ./output participant --cores all
Custom Template¶
# Use specific template
pixi run spimquant ./bids ./output participant \
--template gubra \
--cores all