Download dwidenoise/validation/README.md from neurodeskorg/webapps: direct link, hf CLI and curl.
- Browser
- Download file 2.86 kB
-
https://huggingface.co/datasets/neurodeskorg/webapps/resolve/main/dwidenoise/validation/README.md
- Command line
-
hf download hf://datasets/neurodeskorg/webapps/dwidenoise/validation/README.md
-
curl -L -o README.md https://huggingface.co/datasets/neurodeskorg/webapps/resolve/main/dwidenoise/validation/README.md
dwidenoise validation: Patch2Self reference on the ds005134 slab
| File | Content |
|---|---|
sub-01_dir-AP_desc-slabpatch2self_dwi.nii.gz |
Patch2Self output of the noddi example slab, float32, 67 × 92 × 10 × 137 |
Input
noddi/examples/sub-01_dir-AP_desc-slab_dwi.nii.gz with its .bval in this dataset
(OpenNeuro ds005134 sub-01, CC0; see noddi/examples/README.md). The input is not copied here.
Input SHA-256: 1e7c8461d9bfc3c80633f930dc1df16d892a6bfd5e15db4c5a2be9d021e48d00.
Volumes: 13 b0, 12 × b500, 48 × b1000, 64 × b2000.
Method
Patch2Self (Fadnavis et al., NeurIPS 2020), DIPY version 1 with patch radius 0: each volume is predicted by ordinary least squares with an intercept from the other volumes of its group, fitted over all voxels (no mask) and applied to all voxels. The b0 volumes (bval <= 50) and the DWI volumes are two separate groups. No intensity shift, no clipping.
Software: DIPY 1.12.1, scikit-learn 1.9.1, NumPy 2.5.4, Python 3.12.13, Linux x86-64.
The input was read as float64 (get_fdata(dtype=np.float64)), computed in float64, and cast
to float32 for this file (largest rounding change 3.1e-5). The NIfTI header is the input's
header with the data type set to float32 and slope 1, intercept 0.
from dipy.denoise.patch2self import patch2self
from sklearn import linear_model
from sklearn.base import BaseEstimator
linear_model.BaseEstimator = BaseEstimator # see note 1
model = linear_model.Ridge(alpha=1e-10, copy_X=True)
den = patch2self(data, bvals, model=model, b0_threshold=50, version=1, patch_radius=0)
Notes
- DIPY 1.12.1 accepts a model instance only when it is an instance of
sklearn.linear_model.BaseEstimator. scikit-learn 1.9 does not export that name, so the alias is set tosklearn.base.BaseEstimatorbefore the call. This changes nothing else. - The model is given explicitly because
model="ols"in DIPY 1.12.1 makesRidge(alpha=1e-10, copy_X=False). Withcopy_X=False, scikit-learn centres the regressor array in place duringfit, and version 1 then callspredicton the centred array. Each output volume then has a constant error equal tomean(X) . w(about 46 signal units on this data; RMSE / raw noise 5.4 on the simulation). The fit itself is the same: themodel="ols"output plus that per-volume constant equals this file's float64 values to 4e-14 of the signal range. Version 3 (the DIPY default) is not affected. - An independent float64 implementation (Gram matrix of the volumes in one pass, Cholesky
solve per volume,
spec.pyin the dwidenoise port) reproduces the float64 values to 2.3e-14 of the signal range (largest absolute difference 1.4e-11).
Checksums
SHA256SUMS lists the files in this directory. Upload under dwidenoise/validation/ and pin
the commit in the app's manifest.