Page MenuHomePhabricator

AccessByItk_1 does not work with multi component images
Closed, ResolvedPublic

Description

The macros to call ITK filters (tested on AccessByItk_1) do not correctly convert multi component (tested on RGB) MITK images to ITK. The ItkImageType passed to the ITK filtes was in the example itk::Image<unsigned char, 2u> when called on an mitkImage with RGB pixel type ( unsigned char, 3 components).

Possible causes:

  • missing entry for non-scalar pixel types in the MITK_ACCESSBYITK_PIXEL_TYPES_SEQ (mitkConfig.h)
  • false extracting of the pixel type by the image->GetPixelType() method

Event Timeline

Fixed by filling the COMPOSTITE_PIXEL_TYPES sequence ( fix of T12682 )

The macro does not offer the composite types directly, the list has to be added manually to the macro call, i.e. like in the mitkImageWriter ( l.73 )

AccessFixedPixelTypeByItk_1( image, _mitkItkPictureWriteComposite, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES_SEQ , fileName);