smistad / FAST

A framework for high-performance medical image processing, neural network inference and visualization
https://fast.eriksmistad.no
BSD 2-Clause "Simplified" License
433 stars 101 forks source link

PW classifier predictions are off-by-one when renderering #152

Closed andreped closed 2 years ago

andreped commented 2 years ago

Describe the bug When running a simple pw-classification pipeline, using runPipeline, I observed that the predictions were off-by-one. Both horizontally and vertically.

To Reproduce The FPL file and corresponding model and WSI can be downloaded from this URL: https://drive.google.com/drive/folders/1jeovs5hco5U2wPrTHXiWghwiaugP6F6L?usp=sharing

Simply update the paths and run using runPipeline.

To make it easier to debug, I would disable heatmap interpolation (that is useInterpolation = false in FP). I have not started doing heatmap stuff with runPipeline yet in FP by default, and therefore not noticed that this was not possible to set this using an Attribute with Pipelines. Simply add option for Attribute here (setInterpolation method already exists): https://github.com/smistad/FAST/blob/e47eb8bb75dbb5f4a9983471d261edd09b5250cf/source/FAST/Visualization/HeatmapRenderer/HeatmapRenderer.cpp#L16

Otherwise I can make a PR for that.

System:

Expected behavior One-to-one correspondence between WSI and heatmap, aligned in a way that makes sense.

Screenshots example-off-by-one

Disclaimer The newest commit of FAST was not used for doing the tests, but rather an older release (probably a month old). If it works for you I can try updating FAST and redoing the tests.

andreped commented 2 years ago

I have added interpolation attribute to HeatmapRenderer in PR #153, but the off-by-one issue still remains.

smistad commented 2 years ago

Patch generator was skipping patches at top and left edges, this was fixed in: https://github.com/smistad/FAST/commit/e8ad46f108053307d11f66508c6fe4110fa79b3e

Still, there is functionality missing for stitching tensor patches (https://github.com/smistad/FAST/blob/master/source/FAST/Algorithms/ImagePatch/PatchStitcher.cpp#L89) including:

smistad commented 2 years ago

I think this might be fixed now, works fine here at least.

andreped commented 2 years ago

I just ran experiments using runPipeline and FastPathology and the off-by-one issue seem to have been solved using the newest release of FAST v4.3.0 on Win10.