[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-voxelmorph--voxelmorph":3,"tool-voxelmorph--voxelmorph":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",160784,2,"2026-04-19T11:32:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":64,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":72,"owner_location":72,"owner_email":72,"owner_twitter":72,"owner_website":75,"owner_url":76,"languages":77,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":10,"env_os":90,"env_gpu":91,"env_ram":92,"env_deps":93,"category_tags":101,"github_topics":102,"view_count":32,"oss_zip_url":72,"oss_zip_packed_at":72,"status":17,"created_at":111,"updated_at":112,"faqs":113,"releases":114},9742,"voxelmorph\u002Fvoxelmorph","voxelmorph","Unsupervised Learning for Image Registration","VoxelMorph 是一个专为医学图像配准设计的开源深度学习库，旨在通过无监督学习技术，自动将不同时间、设备或个体获取的图像进行精准对齐。它主要解决了传统图像配准方法计算速度慢、依赖人工调参以及难以处理复杂形变的痛点，能够高效建模图像间的非线性变形关系。\n\n该工具特别适合医学影像领域的研究人员、算法工程师及开发者使用。无论是需要处理脑部 MRI、CT 扫描数据，还是希望探索无需标注数据即可训练模型的学术场景，VoxelMorph 都能提供强大的支持。其核心亮点在于引入了“无监督学习”范式，模型仅需原始图像对即可训练，无需昂贵的人工标注真值；同时支持多种变形模型（如微分同胚），确保变换的物理合理性。此外，项目还提供了丰富的教程和预训练模型，涵盖从基础配准到跨模态（如 CT 转 MRI）合成数据训练等多种进阶应用，帮助用户快速上手并定制专属的图像分析流程。","# VoxelMorph: learning-based image registration\n\n**VoxelMorph** is a general purpose library for learning-based tools for alignment\u002Fregistration, and more generally modelling with deformations.\n\n> ⚠️ **Warning**: VoxelMorph pytorch is under active development. Interfaces may change.\n\n> **For users who want to use the stable TensorFlow version**, use either `pip install voxelmorph`, or pull\u002Fclone from the [`dev-tensorflow`](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Ftree\u002Fdev-tensorflow) branch.\n\n## Install\n\nTo use the VoxelMorph library, either clone this repository and install the requirements listed in `setup.py` or install directly with pip.\n\n```\npip install voxelmorph\n```\n\n# Tutorial\n\nWe have several VoxelMorph tutorials:\n  - the main [VoxelMorph tutorial](http:\u002F\u002Ftutorial.voxelmorph.net\u002F) explains VoxelMorph and learning-based registration\n  - a [deformable SynthMorph demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1zaDnAJGUokS0knqWttuTgrRJMb6zxukI?usp=sharing) showing how to train a registration model without data\n  - an [affine SynthMorph demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1QClknfaZIYklBjmBy-nUn83h85bpo8r0?usp=sharing) on learning anatomy-aware and acquisition-agnostic affine registration\n  - a [CT-to-MRI SynthMorph demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1aWbFiyQw5mtJbTglpniAOMimGo_l8BYP?usp=drive_link) clipping the Hounsfield scale for multi-modal registration\n  - a [SynthMorph shapes demo](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F14s2h0j_Aoncp587vmpjsQBe6PQTxyVP5) that walks through the steps of running a trained 3D shapes model\n  - a [tutorial on training VoxelMorph](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ZefmWXBupRNsnIbBbGquhVDsk-7R7L1S?usp=sharing) on [OASIS data](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets\u002Fblob\u002Fmaster\u002Fneurite-oasis.md), which we processed and released for free for HyperMorph\n  - an [additional small tutorial](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1V0CutSIfmtgDJg1XIkEnGteJuw0u7qT-#scrollTo=h1KXYz-Nauwn) on warping annotations together with images\n  - another tutorial on [template (atlas) construction](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1SkQbrWTQHpQFrG4J2WoBgGZC9yAzUas2?usp=sharing) with VoxelMorph\n  - visualize [warp](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1F8f1imh5WfyBv-crllfeJBFY16-KHl9c?usp=sharing) as warped grid\n  - [inverting warps](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1juAJRYhPPDNbO9yRtlc0VGhbIFSuhpJ2?usp=sharing) that are not diffeomorphisms\n\n\n# Instructions\n\nTo use the VoxelMorph library, clone this repository and install the requirements listed in `setup.py`.\n\n> **Note**: The `pip install voxelmorph` command is not yet supported. Please install directly from GitHub:\n\n```\npip install git+https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph.git\n```\n\n## Pre-trained models\n\nSee list of pre-trained models available [here](data\u002Freadme.md#models).\n\n## Training\n\nIf you would like to train your own model, you will likely need to customize some of the data-loading code in `voxelmorph\u002Fgenerators.py` for your own datasets and data formats. However, it is possible to run many of the example scripts out-of-the-box, assuming that you provide a list of filenames in the training dataset. Training data can be in the NIfTI, MGZ, or npz (numpy) format, and it's assumed that each npz file in your data list has a `vol` parameter, which points to the image data to be registered, and an optional `seg` variable, which points to a corresponding discrete segmentation (for semi-supervised learning). It's also assumed that the shape of all training image data is consistent, but this, of course, can be handled in a customized generator if desired.\n\nFor a given image list file `\u002Fimages\u002Flist.txt` and output directory `\u002Fmodels\u002Foutput`, the following script will train an image-to-image registration network (described in MICCAI 2018 by default) with an unsupervised loss. Model weights will be saved to a path specified by the `--model-dir` flag.\n\n```\n.\u002Fscripts\u002Ftf\u002Ftrain.py --img-list \u002Fimages\u002Flist.txt --model-dir \u002Fmodels\u002Foutput --gpu 0\n```\n\nThe `--img-prefix` and `--img-suffix` flags can be used to provide a consistent prefix or suffix to each path specified in the image list. Image-to-atlas registration can be enabled by providing an atlas file, e.g. `--atlas atlas.npz`. If you'd like to train using the original dense CVPR network (no diffeomorphism), use the `--int-steps 0` flag to specify no flow integration steps. Use the `--help` flag to inspect all of the command line options that can be used to fine-tune network architecture and training.\n\n\n## Registration\n\nIf you simply want to register two images, you can use the `register.py` script with the desired model file. For example, if we have a model `model.h5` trained to register a subject (moving) to an atlas (fixed), we could run:\n\n```\n.\u002Fscripts\u002Ftf\u002Fregister.py --moving moving.nii.gz --fixed atlas.nii.gz --moved warped.nii.gz --model model.h5 --gpu 0\n```\n\nThis will save the moved image to `warped.nii.gz`. To also save the predicted deformation field, use the `--save-warp` flag. Both npz or nifty files can be used as input\u002Foutput in this script.\n\n\n## Testing (measuring Dice scores)\n\nTo test the quality of a model by computing dice overlap between an atlas segmentation and warped test scan segmentations, run:\n\n```\n.\u002Fscripts\u002Ftf\u002Ftest.py --model model.h5 --atlas atlas.npz --scans scan01.npz scan02.npz scan03.npz --labels labels.npz\n```\n\nJust like for the training data, the atlas and test npz files include `vol` and `seg` parameters and the `labels.npz` file contains a list of corresponding anatomical labels to include in the computed dice score.\n\n\n## Parameter choices\n\n\n### CVPR version\n\nFor the CC loss function, we found a reg parameter of 1 to work best. For the MSE loss function, we found 0.01 to work best.\n\n\n### MICCAI version\n\nFor our data, we found `image_sigma=0.01` and `prior_lambda=25` to work best.\n\nIn the original MICCAI code, the parameters were applied after the scaling of the velocity field. With the newest code, this has been \"fixed\", with different default parameters reflecting the change. We recommend running the updated code. However, if you'd like to run the very original MICCAI2018 mode, please use `xy` indexing and `use_miccai_int` network option, with MICCAI2018 parameters.\n\n\n## Spatial transforms and integration\n\n- The spatial transform code, found at `voxelmorph.layers.SpatialTransformer`, accepts N-dimensional affine and dense transforms, including linear and nearest neighbor interpolation options. Note that original development of VoxelMorph used `xy` indexing, whereas we are now emphasizing `ij` indexing.\n\n- For the MICCAI2018 version, we integrate the velocity field using `voxelmorph.layers.VecInt`. By default we integrate using scaling and squaring, which we found efficient.\n\n\n# VoxelMorph papers\n\nIf you use VoxelMorph or some part of the code, please cite (see [bibtex](citations.bib)):\n\n  * HyperMorph, avoiding the need to tune registration hyperparameters:   \n\n    **Learning the Effect of Registration Hyperparameters with HyperMorph**  \n    Andrew Hoopes, [Malte Hoffmann](https:\u002F\u002Fmalte.cz), Bruce Fischl, [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    MELBA: Machine Learning for Biomedical Imaging. 2022. [eprint arXiv:2203.16680](https:\u002F\u002Farxiv.org\u002Fabs\u002F2203.16680)\n\n    **HyperMorph: Amortized Hyperparameter Learning for Image Registration.**  \n    Andrew Hoopes, [Malte Hoffmann](https:\u002F\u002Fmalte.cz), Bruce Fischl, [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    IPMI: Information Processing in Medical Imaging. 2021. [eprint arXiv:2101.01035](https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.01035)\n\n  * [SynthMorph](https:\u002F\u002Fsynthmorph.voxelmorph.net), avoiding the need to have data at training (!):  \n\n    **Anatomy-aware and acquisition-agnostic joint registration with SynthMorph.**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz), Andrew Hoopes, Douglas N. Greve, Bruce Fischl, [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    Imaging Neuroscience. 2024. [eprint arXiv:2301.11329](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.11329)\n\n    **Anatomy-specific acquisition-agnostic affine registration learned from fictitious images.**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz), Andrew Hoopes, Bruce Fischl, [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    SPIE Medical Imaging: Image Processing. 2023.\n\n    **SynthMorph: learning contrast-invariant registration without acquired images.**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz), Benjamin Billot, [Juan Eugenio Iglesias](https:\u002F\u002Fscholar.harvard.edu\u002Figlesias), Bruce Fischl, [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    IEEE TMI: Transactions on Medical Imaging. 2022. [eprint arXiv:2004.10282](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.10282)\n\n  * For the atlas formation model:  \n  \n    **Learning Conditional Deformable Templates with Convolutional Networks**  \n  [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu), [Marianne Rakic](https:\u002F\u002Fmariannerakic.github.io\u002F), [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \n  NeurIPS 2019. [eprint arXiv:1908.02738](https:\u002F\u002Farxiv.org\u002Fabs\u002F1908.02738)\n\n  * For the diffeomorphic or probabilistic model:\n\n    **Unsupervised Learning of Probabilistic Diffeomorphic Registration for Images and Surfaces**  \n[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu), [Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F), [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \nMedIA: Medial Image Analysis. 2019. [eprint arXiv:1903.03545](https:\u002F\u002Farxiv.org\u002Fabs\u002F1903.03545) \n\n    **Unsupervised Learning for Fast Probabilistic Diffeomorphic Registration**  \n[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu), [Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F), [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \nMICCAI 2018. [eprint arXiv:1805.04605](https:\u002F\u002Farxiv.org\u002Fabs\u002F1805.04605)\n\n  * For the original CNN model, MSE, CC, or segmentation-based losses:\n\n    **VoxelMorph: A Learning Framework for Deformable Medical Image Registration**  \n[Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F), [Amy Zhao](http:\u002F\u002Fpeople.csail.mit.edu\u002Fxamyzhao\u002F), [Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F), [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \nIEEE TMI: Transactions on Medical Imaging. 2019. \n[eprint arXiv:1809.05231](https:\u002F\u002Farxiv.org\u002Fabs\u002F1809.05231)\n\n    **An Unsupervised Learning Model for Deformable Medical Image Registration**  \n[Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F), [Amy Zhao](http:\u002F\u002Fpeople.csail.mit.edu\u002Fxamyzhao\u002F), [Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F), [John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F), [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \nCVPR 2018. [eprint arXiv:1802.02604](https:\u002F\u002Farxiv.org\u002Fabs\u002F1802.02604)\n\n\n# Notes\n- **keywords**: machine learning, convolutional neural networks, alignment, mapping, registration  \n- **data in papers**: \nIn our initial papers, we used publicly available data, but unfortunately we cannot redistribute it (due to the constraints of those datasets). We do a certain amount of pre-processing for the brain images we work with, to eliminate sources of variation and be able to compare algorithms on a level playing field. In particular, we perform FreeSurfer `recon-all` steps up to skull stripping and affine normalization to Talairach space, and crop the images via `((48, 48), (31, 33), (3, 29))`. \n\nWe encourage users to download and process their own data. See [a list of medical imaging datasets here](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets). Note that you likely do not need to perform all of the preprocessing steps, and indeed VoxelMorph has been used in other work with other data.\n\n\n# Creation of deformable templates\n\nTo experiment with this method, please use `train_template.py` for unconditional templates and `train_cond_template.py` for conditional templates, which use the same conventions as VoxelMorph (please note that these files are less polished than the rest of the VoxelMorph library).\n\nWe've also provided an unconditional atlas in `data\u002Fgenerated_uncond_atlas.npz.npy`. \n\nModels in h5 format weights are provided for [unconditional atlas here](http:\u002F\u002Fpeople.csail.mit.edu\u002Fadalca\u002Fvoxelmorph\u002Fatlas_creation_uncond_NCC_1500.h5), and [conditional atlas here](http:\u002F\u002Fpeople.csail.mit.edu\u002Fadalca\u002Fvoxelmorph\u002Fatlas_creation_cond_NCC_1022.h5).\n\n**Explore the atlases [interactively here](http:\u002F\u002Fvoxelmorph.mit.edu\u002Fatlas_creation\u002F)** with tipiX!\n\n\n# SynthMorph\n\nSynthMorph is a strategy for learning registration without acquired imaging data, producing powerful networks agnostic to contrast induced by MRI ([eprint arXiv:2004.10282](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.10282)). For a video and a demo showcasing the steps of generating random label maps from noise distributions and using these to train a network, visit [synthmorph.voxelmorph.net](https:\u002F\u002Fsynthmorph.voxelmorph.net).\n\nWe provide model files for a [\"shapes\" variant](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fshapes-dice-vel-3-res-8-16-32-256f.h5) of SynthMorph, that we train using images synthesized from random shapes only, and a [\"brains\" variant](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fbrains-dice-vel-0.5-res-16-256f.h5), that we train using images synthesized from brain label maps. We train the brains variant by optimizing a loss term that measures volume overlap of a [selection of brain labels](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Ffs-labels.npy). For registration with either model, please use the `register.py` script with the respective model weights.\n\nAccurate registration requires the input images to be min-max normalized, such that voxel intensities range from 0 to 1, and to be resampled in the affine space of a [reference image](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fref.nii.gz). The affine registration can be performed with a variety of packages, and we choose FreeSurfer. First, we skull-strip the images with [SAMSEG](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Ffswiki\u002FSamseg), keeping brain labels only. Second, we run [mri_robust_register](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Ffswiki\u002Fmri_robust_register):\n\n```\nmri_robust_register --mov in.nii.gz --dst out.nii.gz --lta transform.lta --satit --iscale\nmri_robust_register --mov in.nii.gz --dst out.nii.gz --lta transform.lta --satit --iscale --ixform transform.lta --affine\n```\n\nwhere we replace `--satit --iscale` with `--cost NMI` for registration across MRI contrasts.\n\n\n# Data\nWhile we cannot release most of the data used in the VoxelMorph papers as they prohibit redistribution, we thorough processed and [re-released OASIS1](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets\u002Fblob\u002Fmaster\u002Fneurite-oasis.md) while developing [HyperMorph](http:\u002F\u002Fhypermorph.voxelmorph.net\u002F). We now include a quick [VoxelMorph tutorial](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ZefmWXBupRNsnIbBbGquhVDsk-7R7L1S?usp=sharing) to train VoxelMorph on neurite-oasis data.\n\n# Contact\nFor any code-related problems or questions please [open an issue](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Fissues\u002Fnew?labels=voxelmorph) or [start a discussion](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Fdiscussions) of general registration\u002FVoxelMorph topics.\n","# VoxelMorph：基于学习的图像配准\n\n**VoxelMorph** 是一个通用的库，用于构建基于学习的对齐\u002F配准工具，以及更广泛地使用形变进行建模。\n\n> ⚠️ **警告**：VoxelMorph PyTorch 版本仍在积极开发中，接口可能会发生变化。\n\n> **对于希望使用稳定 TensorFlow 版本的用户**，可以使用 `pip install voxelmorph`，或者从 [`dev-tensorflow`](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Ftree\u002Fdev-tensorflow) 分支拉取\u002F克隆。\n\n## 安装\n\n要使用 VoxelMorph 库，您可以克隆此仓库并安装 `setup.py` 中列出的依赖项，或者直接通过 pip 进行安装。\n\n```\npip install voxelmorph\n```\n\n# 教程\n\n我们提供了多个 VoxelMorph 教程：\n  - 主要的 [VoxelMorph 教程](http:\u002F\u002Ftutorial.voxelmorph.net\u002F) 解释了 VoxelMorph 和基于学习的配准；\n  - 一个 [可变形 SynthMorph 演示](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1zaDnAJGUokS0knqWttuTgrRJMb6zxukI?usp=sharing)，展示了如何在没有数据的情况下训练配准模型；\n  - 一个 [仿射 SynthMorph 演示](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1QClknfaZIYklBjmBy-nUn83h85bpo8r0?usp=sharing)，介绍如何学习解剖结构感知且与采集无关的仿射配准；\n  - 一个 [CT 到 MRI 的 SynthMorph 演示](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1aWbFiyQw5mtJbTglpniAOMimGo_l8BYP?usp=drive_link)，演示了为多模态配准裁剪亨氏单位尺度的方法；\n  - 一个 [SynthMorph 形状演示](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F14s2h0j_Aoncp587vmpjsQBe6PQTxyVP5)，逐步展示了运行已训练的 3D 形状模型的步骤；\n  - 一个 [训练 VoxelMorph 的教程](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ZefmWXBupRNsnIbBbGquhVDsk-7R7L1S?usp=sharing)，基于 [OASIS 数据](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets\u002Fblob\u002Fmaster\u002Fneurite-oasis.md)，这些数据我们经过处理后免费发布用于 HyperMorph；\n  - 另一个简短的教程 [将标注与图像一起变形](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1V0CutSIfmtgDJg1XIkEnGteJuw0u7qT-#scrollTo=h1KXYz-Nauwn)；\n  - 还有一个关于使用 VoxelMorph 构建模板（图谱）的教程 [链接](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1SkQbrWTQHpQFrG4J2WoBgGZC9yAzUas2?usp=sharing)；\n  - 可视化 [变形场](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1F8f1imh5WfyBv-crllfeJBFY16-KHl9c?usp=sharing) 作为变形后的网格；\n  - [反演非微分同胚的变形场](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1juAJRYhPPDNbO9yRtlc0VGhbIFSuhpJ2?usp=sharing)。\n\n# 使用说明\n\n要使用 VoxelMorph 库，需克隆此仓库，并安装 `setup.py` 中列出的依赖项。\n\n> **注意**：目前尚不支持 `pip install voxelmorph` 命令。请直接从 GitHub 安装：\n\n```\npip install git+https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph.git\n```\n\n## 预训练模型\n\n预训练模型列表请参见 [此处](data\u002Freadme.md#models)。\n\n## 训练\n\n如果您想训练自己的模型，可能需要针对您的数据集和数据格式自定义 `voxelmorph\u002Fgenerators.py` 中的部分数据加载代码。不过，在提供训练数据集的文件名列表的前提下，许多示例脚本可以直接运行。训练数据可以是 NIfTI、MGZ 或 npz（numpy）格式，假设您提供的每个 npz 文件都包含 `vol` 参数，指向待配准的图像数据；以及可选的 `seg` 变量，指向对应的离散分割标签（用于半监督学习）。此外，还假定所有训练图像数据的形状一致，当然，如果需要，也可以通过自定义生成器来处理这一问题。\n\n对于给定的图像列表文件 `\u002Fimages\u002Flist.txt` 和输出目录 `\u002Fmodels\u002Foutput`，以下脚本将使用无监督损失训练一个图像到图像的配准网络（默认采用 MICCAI 2018 中描述的架构），并将模型权重保存到由 `--model-dir` 标志指定的路径。\n\n```\n.\u002Fscripts\u002Ftf\u002Ftrain.py --img-list \u002Fimages\u002Flist.txt --model-dir \u002Fmodels\u002Foutput --gpu 0\n```\n\n`--img-prefix` 和 `--img-suffix` 标志可用于为图像列表中指定的每个路径添加一致的前缀或后缀。若要启用图像到图谱的配准，可以提供一个图谱文件，例如 `--atlas atlas.npz`。如果您希望使用原始的稠密 CVPR 网络（非微分同胚），请使用 `--int-steps 0` 标志指定不进行流积分步骤。使用 `--help` 标志可以查看所有可用于微调网络架构和训练过程的命令行选项。\n\n## 配准\n\n如果您只是想配准两张图像，可以使用 `register.py` 脚本并指定所需的模型文件。例如，如果我们有一个模型 `model.h5`，用于将受试者（移动图像）配准到图谱（固定图像），则可以运行：\n\n```\n.\u002Fscripts\u002Ftf\u002Fregister.py --moving moving.nii.gz --fixed atlas.nii.gz --moved warped.nii.gz --model model.h5 --gpu 0\n```\n\n这会将配准后的图像保存为 `warped.nii.gz`。若同时保存预测的变形场，可使用 `--save-warp` 标志。该脚本的输入和输出均可使用 npz 或 nifty 文件。\n\n## 测试（计算 Dice 分数）\n\n要通过计算图谱分割与变形后测试扫描分割之间的 Dice 重叠率来评估模型质量，可运行：\n\n```\n.\u002Fscripts\u002Ftf\u002Ftest.py --model model.h5 --atlas atlas.npz --scans scan01.npz scan02.npz scan03.npz --labels labels.npz\n```\n\n与训练数据类似，图谱和测试的 npz 文件均包含 `vol` 和 `seg` 参数，而 `labels.npz` 文件则包含用于计算 Dice 分数的相应解剖学标签列表。\n\n## 参数选择\n\n### CVPR 版本\n\n对于 CC 损失函数，我们发现 reg 参数设为 1 时效果最佳。而对于 MSE 损失函数，0.01 是最佳选择。\n\n### MICCAI 版本\n\n对于我们的数据，我们发现 `image_sigma=0.01` 和 `prior_lambda=25` 的设置效果最好。\n\n在原始的 MICCAI 代码中，这些参数是在速度场缩放之后应用的。而在最新版本的代码中，这一点已被“修复”，默认参数也反映了这一变化。我们建议使用更新后的代码。然而，如果您希望运行最原始的 MICCAI 2018 模式，请使用 `xy` 索引，并启用 `use_miccai_int` 网络选项，同时采用 MICCAI 2018 的参数设置。\n\n## 空间变换与积分\n\n- 空间变换代码位于 `voxelmorph.layers.SpatialTransformer`，支持 N 维的仿射和稠密变换，包括线性插值和最近邻插值选项。需要注意的是，VoxelMorph 的早期开发使用的是 `xy` 索引，而我们现在强调使用 `ij` 索引。\n\n- 对于 MICCAI 2018 版本，我们使用 `voxelmorph.layers.VecInt` 来积分速度场。默认情况下，我们采用缩放平方法进行积分，这种方法被证明是高效的。\n\n# VoxelMorph 相关论文\n\n如果您使用了 VoxelMorph 或其部分代码，请引用以下文献（参见 [bibtex](citations.bib)）：\n\n  * HyperMorph，无需调参即可实现配准：  \n\n    **利用 HyperMorph 学习配准超参数的影响**  \n    Andrew Hoopes、[Malte Hoffmann](https:\u002F\u002Fmalte.cz)、Bruce Fischl、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    MELBA：生物医学影像中的机器学习。2022年。[arXiv 预印本 2203.16680](https:\u002F\u002Farxiv.org\u002Fabs\u002F2203.16680)\n\n    **HyperMorph：用于图像配准的超参数摊销学习。**  \n    Andrew Hoopes、[Malte Hoffmann](https:\u002F\u002Fmalte.cz)、Bruce Fischl、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    IPMI：医学影像中的信息处理。2021年。[arXiv 预印本 2101.01035](https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.01035)\n\n  * [SynthMorph](https:\u002F\u002Fsynthmorph.voxelmorph.net)，无需训练数据即可实现配准（！）：  \n\n    **基于 SynthMorph 的解剖学感知且采集无关的联合配准。**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz)、Andrew Hoopes、Douglas N. Greve、Bruce Fischl、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    影像神经科学。2024年。[arXiv 预印本 2301.11329](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.11329)\n\n    **从虚构图像中学习的解剖特异性、采集无关的仿射配准。**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz)、Andrew Hoopes、Bruce Fischl、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    SPIE 医疗影像：图像处理。2023年。\n\n    **SynthMorph：无需实际采集图像即可学习对比度不变的配准。**  \n    [Malte Hoffmann](https:\u002F\u002Fmalte.cz)、Benjamin Billot、[Juan Eugenio Iglesias](https:\u002F\u002Fscholar.harvard.edu\u002Figlesias)、Bruce Fischl、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    IEEE TMI：医学影像汇刊。2022年。[arXiv 预印本 2004.10282](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.10282)\n\n  * 关于图谱生成模型：  \n\n    **利用卷积网络学习条件变形模板**  \n    [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)、[Marianne Rakic](https:\u002F\u002Fmariannerakic.github.io\u002F)、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \n    NeurIPS 2019。[arXiv 预印本 1908.02738](https:\u002F\u002Farxiv.org\u002Fabs\u002F1908.02738)\n\n  * 关于微分同胚或概率模型：\n\n    **面向图像和表面的概率性微分同胚配准的无监督学习**  \n    [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)、[Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F)、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \n    MedIA：医学图像分析。2019年。[arXiv 预印本 1903.03545](https:\u002F\u002Farxiv.org\u002Fabs\u002F1903.03545) \n\n    **快速概率性微分同胚配准的无监督学习**  \n    [Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)、[Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F)、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)  \n    MICCAI 2018。[arXiv 预印本 1805.04605](https:\u002F\u002Farxiv.org\u002Fabs\u002F1805.04605)\n\n  * 关于原始 CNN 模型、MSE、CC 或基于分割的损失函数：\n\n    **VoxelMorph：用于可变形医学图像配准的学习框架**  \n    [Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F)、[Amy Zhao](http:\u002F\u002Fpeople.csail.mit.edu\u002Fxamyzhao\u002F)、[Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    IEEE TMI：医学影像汇刊。2019年。  \n    [arXiv 预印本 1809.05231](https:\u002F\u002Farxiv.org\u002Fabs\u002F1809.05231)\n\n    **用于可变形医学图像配准的无监督学习模型**  \n    [Guha Balakrishnan](http:\u002F\u002Fpeople.csail.mit.edu\u002Fbalakg\u002F)、[Amy Zhao](http:\u002F\u002Fpeople.csail.mit.edu\u002Fxamyzhao\u002F)、[Mert R. Sabuncu](http:\u002F\u002Fsabuncu.engineering.cornell.edu\u002F)、[John Guttag](https:\u002F\u002Fpeople.csail.mit.edu\u002Fguttag\u002F)、[Adrian V. Dalca](http:\u002F\u002Fadalca.mit.edu)  \n    CVPR 2018。[arXiv 预印本 1802.02604](https:\u002F\u002Farxiv.org\u002Fabs\u002F1802.02604)\n\n\n# 注释\n- **关键词**：机器学习、卷积神经网络、对齐、映射、配准  \n- **论文中的数据**：  \n在我们最初的几篇论文中，我们使用了公开可用的数据，但遗憾的是我们无法重新分发这些数据（受限于相关数据集的协议）。对于所使用的脑部图像，我们会进行一定程度的预处理，以消除变异来源，从而能够在公平的条件下比较不同算法。具体来说，我们会执行 FreeSurfer 的 `recon-all` 流程，直到去颅骨和仿射归一化到 Talairach 空间，并通过 `((48, 48), (31, 33), (3, 29))` 对图像进行裁剪。  \n\n我们鼓励用户自行下载并处理数据。请参阅 [此处的医学影像数据集列表](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets)。请注意，您可能并不需要执行所有预处理步骤，事实上，VoxelMorph 已经被应用于其他研究中，使用不同的数据集。\n\n\n# 可变形模板的创建\n\n要尝试此方法，请使用 `train_template.py` 进行无条件模板的训练，以及 `train_cond_template.py` 进行条件模板的训练，这两者均采用与 VoxelMorph 相同的约定（请注意，这些文件的完善程度不如 VoxelMorph 库的其他部分）。  \n\n我们还在 `data\u002Fgenerated_uncond_atlas.npz.npy` 中提供了一个无条件图谱。  \n\n以 h5 格式保存的模型权重分别提供给 [无条件图谱](http:\u002F\u002Fpeople.csail.mit.edu\u002Fadalca\u002Fvoxelmorph\u002Fatlas_creation_uncond_NCC_1500.h5) 和 [条件图谱](http:\u002F\u002Fpeople.csail.mit.edu\u002Fadalca\u002Fvoxelmorph\u002Fatlas_creation_cond_NCC_1022.h5)。\n\n**请在此处[交互式地探索这些图谱](http:\u002F\u002Fvoxelmorph.mit.edu\u002Fatlas_creation\u002F)**，借助 tipiX！\n\n# SynthMorph\n\nSynthMorph 是一种无需采集影像数据即可学习配准的策略，能够生成对 MRI 对比度无关的强大网络（[eprint arXiv:2004.10282](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.10282)）。如需观看一段视频及演示，了解如何从噪声分布中生成随机标签图，并利用这些标签图训练网络，请访问 [synthmorph.voxelmorph.net](https:\u002F\u002Fsynthmorph.voxelmorph.net)。\n\n我们提供了 SynthMorph 的两种变体模型文件：一种是“shapes”变体（[下载链接](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fshapes-dice-vel-3-res-8-16-32-256f.h5)），该模型仅使用由随机形状合成的图像进行训练；另一种是“brains”变体（[下载链接](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fbrains-dice-vel-0.5-res-16-256f.h5)），它使用由脑部标签图合成的图像进行训练。在训练“brains”变体时，我们优化了一个衡量特定脑部标签体积重叠程度的损失项（相关标签列表见 [这里](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Ffs-labels.npy)）。无论是使用哪种模型进行配准，都请使用 `register.py` 脚本，并加载相应的模型权重。\n\n为了实现准确的配准，输入图像需要进行 min-max 归一化，使体素强度范围在 0 到 1 之间，并且需要在一张参考图像的仿射空间内进行重采样（参考图像可从 [这里](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Fftp\u002Fdata\u002Fvoxelmorph\u002Fsynthmorph\u002Fref.nii.gz) 下载）。仿射配准可以使用多种工具完成，我们选择 FreeSurfer。首先，我们使用 [SAMSEG](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Ffswiki\u002FSamseg) 对图像进行去颅骨处理，仅保留脑部标签；其次，运行 [mri_robust_register](https:\u002F\u002Fsurfer.nmr.mgh.harvard.edu\u002Ffswiki\u002Fmri_robust_register) 命令：\n\n```\nmri_robust_register --mov in.nii.gz --dst out.nii.gz --lta transform.lta --satit --iscale\nmri_robust_register --mov in.nii.gz --dst out.nii.gz --lta transform.lta --satit --iscale --ixform transform.lta --affine\n```\n\n其中，若需跨 MRI 对比度进行配准，可将 `--satit --iscale` 替换为 `--cost NMI`。\n\n# 数据\n尽管我们无法公开 VoxelMorph 论文中使用的大部分数据，因为这些数据的再分发受到限制，但在开发 [HyperMorph](http:\u002F\u002Fhypermorph.voxelmorph.net\u002F) 期间，我们对 OASIS1 数据集进行了彻底的处理并重新发布（详见 [此处](https:\u002F\u002Fgithub.com\u002Fadalca\u002Fmedical-datasets\u002Fblob\u002Fmaster\u002Fneurite-oasis.md)）。目前，我们还提供了一个简短的 [VoxelMorph 教程](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ZefmWXBupRNsnIbBbGquhVDsk-7R7L1S?usp=sharing)，指导用户如何使用 neurite-oasis 数据训练 VoxelMorph 模型。\n\n# 联系方式\n如您在代码使用过程中遇到任何问题或疑问，请在 [GitHub 仓库的 Issues 页面](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Fissues\u002Fnew?labels=voxelmorph) 提交 Issue，或在 [讨论区](https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph\u002Fdiscussions) 中发起关于通用配准及 VoxelMorph 相关话题的讨论。","# VoxelMorph 快速上手指南\n\nVoxelMorph 是一个基于深度学习的通用医学图像配准（对齐）库，支持变形建模。它主要用于将移动图像（moving image）对齐到固定图像（fixed image）或图谱（atlas）。\n\n> **注意**：目前 PyTorch 版本仍在积极开发中，接口可能变动。本指南基于稳定的 **TensorFlow** 版本编写。\n\n## 1. 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux 或 macOS（Windows 需使用 WSL 或 Docker）。\n*   **Python 版本**：推荐 Python 3.8 - 3.10。\n*   **GPU 支持**：强烈建议使用 NVIDIA GPU 以加速训练和推理。\n    *   需安装对应的 **CUDA** 和 **cuDNN**。\n    *   确保已安装与 CUDA 版本匹配的 `tensorflow-gpu`。\n*   **前置依赖**：\n    *   `numpy`, `scipy`, `nibabel` (用于处理 NIfTI 医疗图像格式)。\n    *   `matplotlib` (可选，用于可视化)。\n\n## 2. 安装步骤\n\n虽然支持 `pip install voxelmorph`，但为了获取最新稳定功能，建议直接从 GitHub 源码安装。\n\n### 方法一：使用 pip 直接安装（推荐）\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph.git\n```\n\n> **国内加速提示**：如果下载速度较慢，可以使用清华或阿里镜像源加速安装依赖：\n> ```bash\n> pip install git+https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph.git -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n### 方法二：克隆仓库安装（适合开发者）\n\n如果您需要修改源码或运行示例脚本：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fvoxelmorph\u002Fvoxelmorph.git\ncd voxelmorph\npip install -e .\n```\n\n## 3. 基本使用\n\nVoxelMorph 的核心工作流分为 **训练模型** 和 **执行配准**。以下是最简单的命令行使用示例。\n\n### 场景 A：使用预训练模型进行图像配准\n\n如果您已经有一个训练好的模型（例如 `model.h5`），可以将一张“移动图像”配准到“固定图像”。\n\n假设您有：\n*   移动图像：`moving.nii.gz`\n*   固定图像（或图谱）：`atlas.nii.gz`\n*   模型文件：`model.h5`\n\n运行以下命令：\n\n```bash\n.\u002Fscripts\u002Ftf\u002Fregister.py --moving moving.nii.gz --fixed atlas.nii.gz --moved warped.nii.gz --model model.h5 --gpu 0\n```\n\n*   `--moved`: 输出配准后的图像文件名。\n*   `--save-warp`: （可选）添加此参数可同时保存预测的形变场（deformation field）。\n*   支持输入\u002F输出格式：`.nii.gz` (NIfTI) 或 `.npz` (NumPy)。\n\n### 场景 B：训练自己的配准模型\n\n若要训练新模型，需准备一个包含图像路径的文本列表文件（如 `\u002Fimages\u002Flist.txt`），每行一个文件路径。数据支持 NIfTI (`.nii\u002F.nii.gz`)、MGZ 或 NPZ 格式。\n\n**无监督训练示例**（基于 MICCAI 2018 架构）：\n\n```bash\n.\u002Fscripts\u002Ftf\u002Ftrain.py --img-list \u002Fimages\u002Flist.txt --model-dir \u002Fmodels\u002Foutput --gpu 0\n```\n\n*   `--img-list`: 包含训练图像路径的文本文件。\n*   `--model-dir`: 模型权重保存目录。\n*   `--atlas atlas.npz`: （可选）若进行“图像到图谱”的配准，指定图谱文件。\n*   `--int-steps 0`: （可选）若使用原始 CVPR 网络（非微分同胚），设置此参数为 0。\n\n### 场景 C：评估模型质量 (Dice Score)\n\n通过计算图谱分割与配准后测试图像分割的重叠率（Dice 系数）来测试模型：\n\n```bash\n.\u002Fscripts\u002Ftf\u002Ftest.py --model model.h5 --atlas atlas.npz --scans scan01.npz scan02.npz --labels labels.npz\n```\n\n*   `--scans`: 测试扫描文件列表。\n*   `--labels`: 包含解剖标签的文件，用于计算特定结构的 Dice 分数。\n\n---\n\n**提示**：\n*   代码中默认使用 `ij` 索引方式（较新版本），旧版代码可能使用 `xy` 索引。\n*   对于多模态配准（如 CT 到 MRI）或无需真实数据的训练（SynthMorph），请参考官方提供的 Colab 教程链接。","某三甲医院影像科研究员正在构建阿尔茨海默病早期筛查系统，需要将数百名患者的脑部 MRI 扫描图像与标准脑图谱进行高精度对齐，以量化海马体萎缩程度。\n\n### 没有 voxelmorph 时\n- **耗时极长**：依赖传统迭代优化算法（如 ANTs），单对图像配准需数分钟至半小时，处理千级数据集需数周，严重拖慢科研进度。\n- **参数调优困难**：传统方法需人工反复调整正则化系数和步长，不同患者因脑部病变差异大，难以找到通用最优参数。\n- **多模态支持弱**：在尝试将患者 CT 影像与 MRI 图谱对齐时，因灰度分布差异巨大，传统基于强度的算法经常失效或产生错误形变。\n- **标注同步复杂**：若需同时变换医生手动勾画的病灶掩膜，需额外编写脚本确保插值逻辑与图像变换严格一致，极易出错。\n\n### 使用 voxelmorph 后\n- **秒级推理速度**：利用预训练的深度学习模型，单次配准仅需毫秒级时间，千例数据可在几分钟内完成批量处理，效率提升万倍。\n- **端到端自适应**：voxelmorph 通过无监督学习自动捕捉解剖结构特征，无需人工干预参数即可适应不同病理形态的脑部图像。\n- **原生多模态能力**：借助 SynthMorph 策略，voxelmorph 能直接学习模态不变的解剖特征，轻松实现 CT 到 MRI 的高精度跨模态配准。\n- **场变换同步应用**：提供内置函数可将计算出的形变场直接应用于分割标签，保证图像与病灶掩膜的变换严格数学一致，消除人为误差。\n\nvoxelmorph 将原本需要数周的医学图像配准工作压缩至分钟级，并显著提升了跨模态与复杂病例的处理鲁棒性，让大规模临床数据分析成为可能。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvoxelmorph_voxelmorph_0fc16097.png",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fvoxelmorph_658f0303.png","dev team for voxelmorph - learning based image registration","http:\u002F\u002Fvoxelmorph.mit.edu","https:\u002F\u002Fgithub.com\u002Fvoxelmorph",[78,82],{"name":79,"color":80,"percentage":81},"Python","#3572A5",98.2,{"name":83,"color":84,"percentage":85},"TeX","#3D6117",1.8,2698,632,"2026-04-17T05:09:15","Apache-2.0","Linux, macOS","训练和推理脚本支持通过 --gpu 标志指定 GPU（基于 TensorFlow 后端），具体型号、显存大小及 CUDA 版本未在文中明确说明，但医学图像配准通常建议配备 NVIDIA GPU。","未说明",{"notes":94,"python":92,"dependencies":95},"该工具目前有两个主要版本：稳定的 TensorFlow 版本（可通过 pip 安装或 dev-tensorflow 分支获取）和正在积极开发中的 PyTorch 版本（接口可能变动）。数据支持 NIfTI、MGZ 和 NPZ 格式。训练时若使用原始 MICCAI2018 模式需注意参数索引方式（xy vs ij）的调整。官方提供了多个 Colab 教程供快速上手。",[96,97,98,99,100],"tensorflow (稳定版)","pytorch (开发版)","numpy","nibabel (隐含，用于 NIfTI\u002FMGZ 处理)","scipy (隐含，用于空间变换)",[15,14],[103,104,105,106,107,108,109,110],"image-registration","image-alignment","machine-learning","deep-learning","probabilistic","diffeomorphism","unsupervised-learning","optical-flow","2026-03-27T02:49:30.150509","2026-04-20T04:04:28.021285",[],[]]