When using the paint tool (same with wipe, erase), the selected pixels do not match the segmented pixels. Instead the segmentation result is shifted half an pixel to the upper left.
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | None | T4948 segmented pixel does not match selected pixel | ||
Resolved | None | T5557 segmentation interpolation moves down | ||
Resolved | None | T4692 Inconsistent handling of pixel and voxel centers |
Event Timeline
problem occurs in all the tools of the manual segmentation bundle. Reverted some of the changes made in rev 19782 to compensate offset.
mitkContourUtils.cpp -- Checked
mitkCorrectorAlgorithm.cpp -- need to be checked
mitkContourTool.cpp -- Checked
mitkPaintbrushTool.cpp -- need to be checked
mitkRegionGrowingTool.cpp -- Checked (but maybe another bug detected. Starting Region sometimes quite far away from starting pixel)
mitkSegTool2D.cpp -- Checked
mitkSetRegionTool.cpp -- need to be checked (fill/erase)
seems that there is still a problem when transforming worldcoordinates into unitbased pixel coordinates. setting dependency to T4692
The function WorldToIndex In mitkGeometry3D (line 323), which takes world coordinates in mm and processes them into discrete index coordinates in units, might do something wrong.
e.g. continous index values of 0.0 to 0.9 should become a discrete index value of 0 (just cutting off values after period). Instead the function rounds mathematically values of 0.5 to 1.4 to an discrete index value of 1.
The ordinary flow should be:
world coordinates(wc)-> continous index coordinates(cic) -> discrete index coordinates(dic)
since we use center-based-pixels, it should convert like this:
wc [-0.5, 0.5) ->
cic [0.0, 1.0) ->
dic [0]
<-- current status-->
We changed the code locally to the expected behaviour but still have to check all consequences!
[SVN revision 25833]
FIX (#4948): Corrected some offset issues, see bugtracker for more details
commited the changes of the attached patch, to make the segmentationbundle usable again. Still some files still have to be checked.