Skip to content

Commit d37c400

Browse files
committed
fix: rescale to range 0-254 instead of 0-255 for mahotas
1 parent 1c8ce01 commit d37c400

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

package/PartSegCore/analysis/measurement_calculation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ def _rescale_image(data: np.ndarray):
15351535
return data
15361536
min_val = data.min()
15371537
max_val = data.max()
1538-
return ((data - min_val) / ((max_val - min_val) / 255)).astype(np.uint8)
1538+
return ((data - min_val) / ((max_val - min_val) / 254)).astype(np.uint8)
15391539

15401540

15411541
class HaralickParameters(BaseModel):

package/tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ def history_element(image, lower_threshold_profile):
269269
def pytest_collection_modifyitems(session, config, items):
270270
image_tests = [x for x in items if "PartSegImage" in str(x.fspath)]
271271
core_tests = [x for x in items if "PartSegCore" in str(x.fspath)]
272+
core_test_batch = [x for x in core_tests if "test_analysis_batch" in str(x.fspath)]
273+
core_tests_non_batch = [x for x in core_tests if x not in core_test_batch]
274+
core_tests = core_tests_non_batch + core_test_batch
272275
other_test = [x for x in items if "PartSegCore" not in str(x.fspath) and "PartSegImage" not in str(x.fspath)]
273276
items[:] = image_tests + core_tests + other_test
274277

0 commit comments

Comments
 (0)