add --json option and associated logic
closes #6 (closed)
Merge request reports
Activity
requested review from @mwebster
assigned to @thanayik
- Resolved by Taylor Hanayik
Why not template
print_value
on value type, so you can skip all thestring val=blah
lines and call directly with value?string val = to_string(nzmean); print_value(sarg, val, json, jsonOutput);
added 1 commit
- 08e56c46 - add previous avwutils tests and new fslstats test
I have added all previous avwutils tests from the
pyfeeds-tests
repo.There is also a new test for
fslstats
. I have confirmed that the output for the currentfslstats
and my proposed changes are identical. See linked files on this comment.@mwebster please let me know if you're cool with these tests. If so, I will add a new commit with the final test for the new
--json
option flag.@thanayik Have you ran the test script on Linux? I suspect that the numpy rng will produce different results on different platforms, so your current approach may not be viable. Perhaps a sufficient test would be to use an image with known (instead of random) data? e.g.:
# taken from fslchpixdim test def create_image(shape, pixdim): pixdim = list(pixdim) data = np.arange(np.prod(shape).reshape(shape).astype(np.float32) hdr = nib.Nifti1Header() hdr.set_data_dtype(np.float32) hdr.set_data_shape(shape) hdr.set_zooms(pixdim[:len(shape)]) return nib.Nifti1Image(data, np.eye(4), hdr)
- Resolved by Taylor Hanayik
mentioned in merge request pyfeeds-tests!53 (merged)
added 1 commit
- 475ab8aa - TEST: avscale is part of flirt, not avwutils