Skip to content

sdc: SyN-SDC pipeline package (packages/sdc) for the browser and Node #464

Open

Description

@gdevenyi

Context

Chain preprocessing, restricted SyN registration and the field-map fit in one package that the app and the command line both import.

  • Q51 (fixed): the outputs keep the b0 volumes.
  • Q52 (fixed): the default mask is MindGrab (model mindgrab) of the mean b0. The user can upload a mask instead.

Size: L (one large PR, or split it in the PR plan).

Decisions (20 October 2026): this issue follows the sdc plan (PR #499, section 9).

Scope

  • packages/sdc: EPI reference from the b0 volumes, MindGrab masks (or an uploaded mask), anat clip and DenoiseImage, epi2anat affine, Laplacians, the prior warp through the T1w-to-MNI affine of Q59 (with a "no prior" option), restricted SyN, field-map fit (sdc: Rust crate for displacement-to-field-map conversion and B-spline approximation #463), one resampling of the DWI series.
  • Read the PE direction and TotalReadoutTime from the sidecar or the sidebar. Else compute TotalReadoutTime from EffectiveEchoSpacing, as get_trt does. Do not use EstimatedTotalReadoutTime or sdcflows' fallback. Refuse without both (Q62). Never guess the polarity.
  • Add the sdc/prior/ files to models/sdc.manifest.json (Q60).
  • Outputs (plan section 5): *_desc-sdc_dwi.nii.gz (b0 volumes kept, Jacobian factor), bval and bvec passed through, *_desc-preproc_fieldmap.nii.gz in Hz, *_desc-coeff_fieldmap.nii.gz, *_from-orig_to-sdc_mode-image_xfm.nii.gz, *_desc-brain_mask.nii.gz, JSON sidecars.
  • Inject runtimes (browser workers or Node drivers), as packages/brain2print does.

Acceptance criteria

  • A Node test runs the full pipeline on the full-brain ds005134 sub-01 on the 2 mm grid (Q67, Q68) and meets the gate of Q66 against sdc/reference/: d ≤ max(spread, 0.05 Hz) and d < 0.5 Hz. It runs in a native workflow job (pull requests that change the SDC code, nightly, manual) with a require variable.
  • A Node test runs the pipeline on the slab with the full T1w (Q64) and reports its difference from the native slab runs (report only).
  • Refusal tests: a missing PE direction, a missing TotalReadoutTime and a missing T1w give clear errors.
  • The output names and sidecars follow BIDS derivatives. A test loads the outputs with the input path of n4 and of noddi (NIfTI + bval + bvec), and both accept them.
  • Cancellation through an AbortSignal stops the workers.
  • A changeset describes the change (pnpm changeset).

References

Dependencies

Activity

  1. stebo85 commented on Oct 29, 2026

    @stebo85
    Contributor

    open issue audit run — 2026-10-29

    P2 · Finish HMC limits and validate SDC · validation

    SyN-SDC package depends on #462 passing its accuracy/memory gates; cannot treat as a quick isolated implementation.

    Next action: Complete shared browser/Node pipeline after accepted #462; preserve numerical gate and pinned reference verification.

    Evidence: source 1 · source 2

    Priority is an audit recommendation. Closure candidates remain open pending the stated verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions