Results 1 to 4 of 4

Thread: Working with single channel images? (Is it possible?)

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    2

    Working with single channel images? (Is it possible?)

    Hi,

    I've been starting to play with OpenCL. We have single channel medical images (16-bits). First tried to create a image with this format:

    Code :
          format.image_channel_order = CL_R;
          format.image_channel_data_type = CL_SIGNED_INT16;

    Assuming that the memory layout would be:
    Code :
      RRRRRRRRR....

    However, this gave an image of all zeros.

    When I pad to RGBA, all sees better.
    Code :
          format.image_channel_order = CL_RGBA;
          format.image_channel_data_type = CL_SIGNED_INT16;
     
       RGBARGBA...  (where R is from my single channel image, GBA is 0)

    Seeing the same behavior on Mac and a Linux/Tesla board setup. Am I doing something wrong? Any experience/comments?

    Thanks,
    -dan

  2. #2
    Junior Member
    Join Date
    Jul 2010
    Posts
    2

    Re: Working with single channel images? (Is it possible?)

    Sorry to answer my own question... The kernel was using

    Code :
    float4 value = read_imagef ( ... )

    For a integer image, this is undefined. So I was getting garbage. Using

    Code :
    int4 value = read_imagei ( ...)

    Does the proper thing.

    Best,
    -dan

  3. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    26

    Re: Working with single channel images? (Is it possible?)

    Good to know it works though . I've been working with CL_RGBA recently and have had no time to try anything with CL_R

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    5

    Re: Working with single channel images? (Is it possible?)

    Did you try ?

    format.image_channel_order = CL_LUMINANCE;

Similar Threads

  1. Replies: 1
    Last Post: 11-18-2011, 08:13 AM
  2. Replies: 4
    Last Post: 03-16-2011, 02:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •