Skip to content

[bug]: Removal of below threshold doesn't prevent thresholding below #1334

@SylviaWhittle

Description

@SylviaWhittle

Checklist

  • Run using the main branch to check if the issue persists. Instructions on how to do this can be found here.
  • Find the offending file in the output. If processing halts, re-run analysis with topostats --core 1 process.
  • Describe the bug.
  • Include the configuration file.
  • Copy of the log-file from running with topostats --log-level debug <command>.
  • The exact command that failed. This is what you typed at the command line, including any options.
  • TopoStats version, this is reported by topostats --version
  • Operating System and Python Version

Describe the bug

I don't have time to write this up right now properly, pressure to get things done fast.

TDLR:

I removed the below threshold from the list in the config file as such:

Image

But TS still ran the thresholding with it, resulting in a full mask.

Copy of the log-file from running with topostats --log-level debug <command>

[Fri, 10 Apr 2026 13:10:01] [INFO ] [topostats] [minicircle.spm] : *** Grain Finding ***
[Fri, 10 Apr 2026 13:10:01] [INFO ] [topostats] [minicircle.spm] : Finding below grains, threshold: ([])
traditional_full_mask_tensor.shape: (1024, 1024, 1) unique: [ True] sum: 1048576
class sums: [1048576]

Include the configuration file

Default config with the grains.threshold_absolute.below set to [].

This would be easily fixed by #1332 I think.

To Reproduce

Run topostats with described config edit.

TopoStats Version

Git main branch

Python Version

3.11

Operating System

MacOS M1/M2 (post-2021)

Python Packages

absl-py==2.4.0
AFMReader==0.0.1
annotated-types==0.7.0
art==6.5
asttokens==2.4.1
astunparse==1.6.3
biopython==1.86
certifi==2026.2.25
charset-normalizer==3.4.5
cheap_repr==0.5.2
contourpy==1.2.1
coverage==7.6.1
cycler==0.12.1
decorator==5.1.1
et_xmlfile==2.0.0
executing==2.0.1
filetype==1.2.0
flatbuffers==25.12.19
fonttools==4.53.1
gast==0.7.0
google-pasta==0.2.0
grpcio==1.78.0
h5py==3.11.0
idna==3.11
igor2==0.5.8
imageio==2.35.1
iniconfig==2.0.0
ipython==8.26.0
jedi==0.19.1
Jinja2==3.1.4
joblib==1.4.2
keras==3.13.2
kiwisolver==1.4.5
lazy_loader==0.4
libclang==18.1.1
llvmlite==0.46.0
loguru==0.7.2
markdown-it-py==4.0.0
MarkupSafe==2.1.5
matplotlib==3.9.2
matplotlib-inline==0.1.7
mdurl==0.1.2
ml_dtypes==0.5.4
namex==0.1.0
networkx==3.3
numba==0.64.0
numpy==2.0.2
numpyencoder==0.3.0
opencv-python==4.10.0.84
openpyxl==3.1.5
opt_einsum==3.4.0
optree==0.19.0
packaging==24.1
pandas==2.2.2
parso==0.8.4
pexpect==4.9.0
pillow==10.4.0
pluggy==1.5.0
prompt_toolkit==3.0.47
protobuf==7.34.0
psutil==5.9.8
ptyprocess==0.7.0
pure_eval==0.2.3
pydantic==2.12.5
pydantic_core==2.41.5
pyfiglet==1.0.2
Pygments==2.18.0
pyparsing==3.1.2
pyspm==0.6.3
pytest==7.4.4
pytest-cov==5.0.0
pytest-github-actions-annotate-failures==0.2.0
pytest-lazy-fixture==0.6.3
pytest-mpl==0.17.0
pytest-regtest==2.1.1
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.2
requests==2.32.5
rich==14.3.3
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
schema==0.7.7
scikit-image==0.24.0
scikit-learn==1.5.1
scipy==1.14.0
seaborn==0.13.2
setuptools==82.0.1
six==1.16.0
skan==0.13.1
snoop==0.4.3
stack-data==0.6.3
tensorflow==2.21.0
termcolor==3.3.0
threadpoolctl==3.5.0
tifffile==2024.8.10
toolz==1.1.0
topoly==1.1.0
-e git+ssh://git@github.com/AFM-SPM/TopoStats.git@80543d675064be9c6e86071a4e197bfc5d3c3040#egg=topostats
tqdm==4.66.5
traitlets==5.14.3
ty==0.0.22
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2024.1
urllib3==2.6.3
wcwidth==0.2.13
wheel==0.46.3
wrapt==2.1.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions