Open m13slash9 opened 2 years ago
Thank you for pointing that out @m13slash9.
@ShreyasFadnavis will give you feedback ASAP.
Hi @m13slash9 -- Thanks for pointing this out, I had not thought of this edge case!
Your solution : diff_denoised_data = patch2self(np.concatenate((diff_data,diff_data,diff_data),2), gradient_table.bvals, model='ols', shift_intensity=True, clip_negative_vals=False, b0_threshold=25)
should work as a good workaround without hampering the performance!
@skoudoro : Following up with a PR to fix this.
Great! Thanks @ShreyasFadnavis !
Description
When calling a patch2self denoising routine for single-slice data, a np.pad fails (presumably in the 2nd dismension)
Way to reproduce
For the traceback above the
diff_data.shape
is(94, 124, 1, 13)
and
gradient_table.bvals.shape
is(13,)
then
diff_denoised_data = patch2self(diff_data, gradient_table.bvals, model='ols', shift_intensity=True, clip_negative_vals=False, b0_threshold=25)
results in the traceback above.Attempting
diff_denoised_data = patch2self(np.concatenate((diff_data,diff_data,diff_data),2), gradient_table.bvals, model='ols', shift_intensity=True, clip_negative_vals=False, b0_threshold=25)
works with no errorsEnvironment
Windows-10-10.0.19043-SP0 Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:15:42) [MSC v.1916 64 bit (AMD64)] dipy 1.4.1 NumPy 1.21.3 SciPy 1.7.1 Nibabel 3.2.1 H5py 3.4.0