cKNUSPeR / i2nca

Interactive MSI Quality Control and Assesment tools
GNU General Public License v3.0
0 stars 0 forks source link

utils/Mask_bad_image #8

Closed cKNUSPeR closed 2 months ago

cKNUSPeR commented 3 months ago

mask bad image uses np.NaN , but shoulkd use a -1 integer as bad pixels

cKNUSPeR commented 2 months ago

for added description: this error occurs when loading datasets with empty pixels:

ValueError: cannot convert float NaN to integer

cKNUSPeR commented 2 months ago

Tool Standard Error

Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/i2ncalinroll/bin/i2nca_agnostic_qc", line 8, in sys.exit(i2nca_angostic_qc()) ^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/i2nca/workflows/cli/agnostic_qc_cli.py", line 24, in i2nca_angostic_qc report_agnostic_qc(I, args.output) File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/i2nca/qctools/qc_tools.py", line 53, in report_agnostic_qc image_feature_number(image_stats, I, File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/i2nca/qctools/visualization.py", line 196, in image_feature_number image_basic_heatmap(mask_bad_image(image_stats["index_nr"], image_stats["peak_nr"], make_index_image(Image)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/i2nca/qctools/utils.py", line 73, in mask_bad_image return translate(image) ^^^^^^^^^^^^^^^^ File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/numpy/lib/function_base.py", line 2372, in call return self._call_as_normal(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/numpy/lib/function_base.py", line 2365, in _call_as_normal return self._vectorize_call(func=func, args=vargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/anaconda3/envs/i2ncalinroll/lib/python3.12/site-packages/numpy/lib/function_base.py", line 2458, in _vectorize_call res = asanyarray(outputs, dtype=otypes[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: cannot convert float NaN to integer

cKNUSPeR commented 2 months ago

fixed

cKNUSPeR commented 2 months ago

now for good