brainvisa / aims-free

Analysis of Images and Signal for neuroimaging
Other
6 stars 3 forks source link

2D distance map creation problem #63

Closed tdelzescaux closed 3 years ago

tdelzescaux commented 3 years ago

When creating a distance map from a 2D binary mask, only the FORWARD step is applied.

denisri commented 3 years ago

Can you precise please ? I don't know what you are talking about (which kind of distance map, or command, or...?)

tdelzescaux commented 3 years ago

Here is an example with a disk: data.zip AimsChamferDistanceMap -i disk.ima -o disk_dist.ima Also tried to modify z mask size with the same result. Data attached. data.zip

denisri commented 3 years ago

I see... That's strange, the behavior is different in 3D, but still strange (we get negative distances). Has it always been so ? (I don't know as we use Fastmarching distance maps most of the time, nowadays)

denisri commented 3 years ago

The negative values are normal in "signed" distance mode (the default). So the problem is really that it doesn't work on 2D images. Trying older releases it seems that it was working in brainvisa 4.5, and broken in 4.6. However the code for the chamfer distance maps has not been modified for 12 years (way older than 4.5), so it's probably a subtle side effect of volume structures modification, border handling or something like that (or the random of uninitialized borders).