Correct custom transform documentation - #1493
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: baf5f11a-f67c-44dc-804e-6be849fa9160
Contributor
📖 Docs PreviewPreview of the documentation for this PR: 🔗 https://smokeshow.helpmanual.io/4m3c1l0i3269293o6w67/ Built from f6c059e |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR corrects and expands TorchIO v2 documentation around custom transforms and batching, aligning migration and transform-concepts docs with the v2 hook architecture and batched metadata behavior.
Changes:
- Document v2 custom-transform hooks (
make_params(batch)/apply_transform(batch, params)) and the automatic Subject↔SubjectsBatch wrapping. - Add guidance and examples for 4D→5D tensor handling, batched metadata, and per-instance vs shared behavior.
- Remove the unsafe “replay by calling
apply_transformdirectly” example and replace it with safer guidance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/get-started/migration.md | Adds/clarifies migration guidance for rewriting custom transforms to the v2 batch hook model, including metadata and per-subject escape hatches. |
| docs/concepts/transforms.md | Updates transform design documentation with a v2-aligned custom transform example and clarifies batching/metadata semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 13, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: baf5f11a-f67c-44dc-804e-6be849fa9160
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: baf5f11a-f67c-44dc-804e-6be849fa9160
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: baf5f11a-f67c-44dc-804e-6be849fa9160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Generated by a coding agent]
Summary
apply_transformreplay exampleValidation
Stack (merge bottom-up)