Hi Felix,
The problem with deprecated methods like mitk::Image::GetPixelValue is, that
they have a huge overhead for accessing a single pixel value. For example, with
each access it is necessary to find the right type among all possible types. If
you use ImageAccessors, you need to do this step only once for the requested
region.
Unfortunately, we haven’t provided an interface yet to use ImageAccessors
without template parameters. However, you can use one of the macros in
mitkPixelTypeMultiplex.h as they are used in mitk::Image::GetPixelValue to
implement it on your own easily. You only need to write a template function,
which passes its type parameter to the ImagePixelAccessor. Your function can
then be called by one of the mitkPixelTypeMultiplex macros. They also allow you
to add further parameters (e.g. mitkTypeMultiplex3 passes 3 additional
parameters).
Regards,
Joseph
Von: Félix C. Morency [mailto:[email protected]]
Gesendet: Donnerstag, 18. April 2013 18:00
An: [email protected]
Betreff: [mitk-users] Image pixel accessor
Hi,
The mitk::Image::GetPixelValue* methods are deprecated as of 2012.09 and are
replaced by the ImagePixelReadAccessor templated class. However, you need to
know the type and the dimensions of your image to create such accessor at
compile time. Is it me or this goes against the purpose of the mitk::Image
where you don't need to bother about the pixel type and the image dimensions?
Is there a utility method that creates an accessor of the correct type from a
MITK image automagically?
Regards,
--
Félix C. Morency, M.Sc.
Plateforme d’analyse et de visualisation d’images
Centre Hospitalier Universitaire de Sherbrooke
Centre de recherche clinique Étienne-Le Bel
Local Z5-3031 | 819.346.1110 ext 16634
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users