ITK changed to consistent center-based indices and physical coordinates. MITK still has some inconsistencies.
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | None | T2206 Add missing Pixel access Method to mitk::Image | ||
Duplicate | None | T2401 MPR displays pixel brightness mismatch | ||
Invalid | None | T4007 BoundingObjectCutter produces offset | ||
Resolved | None | T4948 segmented pixel does not match selected pixel | ||
Resolved | None | T4692 Inconsistent handling of pixel and voxel centers |
Event Timeline
Are you sure with consistent center-based?
They changed to edge-based index coords just in 3.16.
(In reply to comment #1)
Are you sure with consistent center-based?
They changed to edge-based index coords just in 3.16.
Can you please give a reference where you read this?
There is a variable ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY in the main CMakeLists.txt of ITK, which is set to ON since release 3.16. The name rather suggests that ITK uses center-based coordinates (hopefully) everywhere since then, doesn't it?
See
http://www.itk.org/cgi-bin/viewcvs.cgi/CMakeLists.txt?view=annotate&root=Insight
(currently line 267, changed in rev. 1.350, rel 3.16 is 1.353).
All info I had were from:
There has been quite a discussion about this in ITK bug tracker
(http://www.itk.org/Bug/view.php?id=6558).
This even lead to a Wiki page on this topic
(http://www.itk.org/Wiki/Proposals:Refactoring_Index_Point_Coordinate_System).
The attached patch solves the issue according to the description on the wiki page. The patch includes testing code to check that the ITK coordinate system is indeed center-based (included in mitkGeometry3DTest).
[SVN revision 25020]
COMP (#4692): Replaced templated call to itk::Math::RoundHalfIntegerUp with non templated one to fix compiler errors.
[SVN revision 25025]
COMP (#4692): mitk::Image::GetPixelValueByIndex takes an mitk::Index3D instead of mitk::Point3D now
(In reply to comment #9)
[SVN revision 25020]
COMP (#4692): Replaced templated call to itk::Math::RoundHalfIntegerUp with non
templated one to fix compiler errors.
According to the ITK docu one should use the templated versions:
"These methods have been deprecated as of ITK 3.16. Please use the templated methods of the form itk::Math::XXX<TReturn,TINput(TInput x) instead." (itkMath.h)
So to finally fix this bug, we should replace it by the templated variant (in a way that gcc and vc2005 understands...).
attached a patch, that should correct the IsIndexInside function, when it is an image geometry
As the IsIndexInside methods get longer and longer...
-> Please move implementation to .cpp file.
[SVN revision 26151]
FIX (#4692): Added if-check for imagegeometries to the function mitkGeometry3D::IsIndexInside, so it can produce correct output