HumanBrainProject / neuroglancer-scripts

Conversion of neuroimaging data for display in Neuroglancer
MIT License
27 stars 18 forks source link

fix nibabel get_data deprecation #28

Closed xgui3783 closed 1 year ago

xgui3783 commented 1 year ago

per https://nipy.org/nibabel/reference/nibabel.dataobj_images.html#nibabel.dataobj_images.DataobjImage.get_data nibabel.get_data will raise Exception as of >=5.0

Per suggestion, this PR now uses numpy.asanyarray(img.dataobj)

another option is img.get_fdata(img.header.get_data_dtype())

codecov[bot] commented 1 year ago

Codecov Report

Merging #28 (4fd3f02) into master (b1baf42) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   92.45%   92.45%           
=======================================
  Files          25       25           
  Lines        1485     1485           
  Branches      219      219           
=======================================
  Hits         1373     1373           
  Misses         63       63           
  Partials       49       49           
Impacted Files Coverage Δ
src/neuroglancer_scripts/volume_reader.py 82.69% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

xgui3783 commented 1 year ago

probably supercedes #27

xgui3783 commented 1 year ago

@ylep can you take a look at this PR, but also a number of other possible fixes (#27) or using img.get_fdata(img.header.get_data_dtype()) instead of numpy.asanyarray(img.dataobj) (this PR) ?

blowekamp commented 1 year ago

Thank you for a proper fix.

Any idea when the next published release will occur?

xgui3783 commented 1 year ago

Thank you for a proper fix.

Any idea when the next published release will occur?

already happened, I think: https://pypi.org/project/neuroglancer-scripts/#history