Page MenuHomePhabricator

Add missing Pixel access Method to mitk::Image
Closed, ResolvedPublic

Description

It would be nice to have a method which provides easy access to pixel values in a mitk::Image without using the IpPicdescriptor and the mitkIpPicTypeMultiplex methods outside the image class.

Event Timeline

patch contains two convenience methods for mitk::image to access the pixel value.
GetPixelValuebyIndex(...)
GetPixelValuebyWorld(...)

Not committed because test is still missing AND this feature depends on T2401

Hi,

some comments on the change request

  • Cause of the bug: does not apply
  • how was GetPixelValueByIndex called before?
  • for better readability GetPixelValueByWorld should be named GetPixelValueByWorldCoordinate (because the parameter is a coordinate, not a whole world)

What do you mean with the first comment? If you mean that the sentence was incomplete, you are right :) Should be more clear now. It is not really a bug by the way, only the absence of a convenient method.
With regard to name giving, the GetPixelByIndex should than also be called GetPixelByIndexCoordinate.

Discussed with Thomas, we changed the change request minimally:

  • changing the paragraph "cause of the bug" to "does not apply"
  • changing the new name to Get...WorldCoordinate

And Thomas has already written a test case which will be committed before this bug is closed.

[SVN revision 20887]
ENH (#2206): added a method GetPixelValueByWorldCoordinate to mitkImage that allows retrieving pixel values by providing a world coordinate instead of an index coordinates. GetPixelValue was renamed to GetPixelValueByIndex. mitkImageTest was extended to test the new method using an image containing nonidentity orientation.

A dependent class could not compile. Reopening bug to solve this problem.

[SVN revision 20891]
COMP (#2206): Changed GetPixelValue to GetPixelValueByIndex to solve compiler error.