{
  "id": 157371,
  "title": "Openslide showing bad image data?",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/157371",
  "author_name": "fergusoci",
  "post_date": "2020-06-10T12:19:51.378000",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Wondering if anybody else has noticed issues with Openslide?</p>\n\n<p>For certain images (typically the very large ones) I get areas of blanks in the images when I open level 1, but not level 0.</p>\n\n<p>Take 70256626a66f83e38b69a88a68967130.tiff for example:\n<code>\nslide = openslide.open_slide('/kaggle/input/prostate-cancer-grade-assessment/train_images/70256626a66f83e38b69a88a68967130.tiff')\nslide_image = slide.read_region((0, 0), 0, slide.level_dimensions[0]).convert(\"RGB\")\n</code></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2Fbd52e65119ae3041ef5f4111a889a890%2F70256626a66f83e38b69a88a68967130_level0_.png?generation=1591790740324197&amp;alt=media\" alt=\"\">\n<code>\n slide_image = slide.read_region((0, 0), 1, slide.level_dimensions[1]).convert(\"RGB\")\n</code>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2F42ad067f4af8f01cb7d804c52fe210cf%2F70256626a66f83e38b69a88a68967130_level1_.png?generation=1591790767041420&amp;alt=media\" alt=\"\"></p>\n\n<p>There are many files where this is the case. I can't check out whether skimage / imageio give the same issues as I can't get them to work in kernels.  Has anyone else come across this? Do you know if it is a problem with the file rather than the openslide package? (i.e. does it work in skimage/imageio)?</p>\n\n<p>Thanks</p>",
  "messages": [
    {
      "id": 880598,
      "postDate": "2020-06-10T12:19:51.377Z",
      "content": "<p>Wondering if anybody else has noticed issues with Openslide?</p>\n\n<p>For certain images (typically the very large ones) I get areas of blanks in the images when I open level 1, but not level 0.</p>\n\n<p>Take 70256626a66f83e38b69a88a68967130.tiff for example:\n<code>\nslide = openslide.open_slide('/kaggle/input/prostate-cancer-grade-assessment/train_images/70256626a66f83e38b69a88a68967130.tiff')\nslide_image = slide.read_region((0, 0), 0, slide.level_dimensions[0]).convert(\"RGB\")\n</code></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2Fbd52e65119ae3041ef5f4111a889a890%2F70256626a66f83e38b69a88a68967130_level0_.png?generation=1591790740324197&amp;alt=media\" alt=\"\">\n<code>\n slide_image = slide.read_region((0, 0), 1, slide.level_dimensions[1]).convert(\"RGB\")\n</code>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2F42ad067f4af8f01cb7d804c52fe210cf%2F70256626a66f83e38b69a88a68967130_level1_.png?generation=1591790767041420&amp;alt=media\" alt=\"\"></p>\n\n<p>There are many files where this is the case. I can't check out whether skimage / imageio give the same issues as I can't get them to work in kernels.  Has anyone else come across this? Do you know if it is a problem with the file rather than the openslide package? (i.e. does it work in skimage/imageio)?</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "Wondering if anybody else has noticed issues with Openslide?\n\nFor certain images (typically the very large ones) I get areas of blanks in the images when I open level 1, but not level 0.\n\nTake 70256626a66f83e38b69a88a68967130.tiff for example:\n```\nslide = openslide.open_slide('/kaggle/input/prostate-cancer-grade-assessment/train_images/70256626a66f83e38b69a88a68967130.tiff')\nslide_image = slide.read_region((0, 0), 0, slide.level_dimensions[0]).convert(\"RGB\")\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2Fbd52e65119ae3041ef5f4111a889a890%2F70256626a66f83e38b69a88a68967130_level0_.png?generation=1591790740324197&amp;alt=media)\n```\n slide_image = slide.read_region((0, 0), 1, slide.level_dimensions[1]).convert(\"RGB\")\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2F42ad067f4af8f01cb7d804c52fe210cf%2F70256626a66f83e38b69a88a68967130_level1_.png?generation=1591790767041420&amp;alt=media)\n\nThere are many files where this is the case. I can't check out whether skimage / imageio give the same issues as I can't get them to work in kernels.  Has anyone else come across this? Do you know if it is a problem with the file rather than the openslide package? (i.e. does it work in skimage/imageio)?\n\nThanks",
      "votes": 1
    },
    {
      "id": 880685,
      "postDate": "2020-06-10T13:48:19.233Z",
      "content": "<p>I wasn't able to reproduce this problem with the latest docker. What are you using for displaying the cases? Maybe you can share a notebook to show where the problem occurs.</p>",
      "rawMarkdown": "I wasn't able to reproduce this problem with the latest docker. What are you using for displaying the cases? Maybe you can share a notebook to show where the problem occurs.",
      "replies": [
        {
          "id": 880727,
          "postDate": "2020-06-10T14:21:56.867Z",
          "content": "<p>Ah, could be that. I'll play around and see. Thanks</p>",
          "rawMarkdown": "Ah, could be that. I'll play around and see. Thanks"
        }
      ]
    },
    {
      "id": 880636,
      "postDate": "2020-06-10T13:04:25.010Z",
      "content": "<p>Update on this: I managed to get imageio working and I'm not seeing the same issue for the sample file above when using that.</p>",
      "rawMarkdown": "Update on this: I managed to get imageio working and I'm not seeing the same issue for the sample file above when using that."
    }
  ],
  "comments": [
    {
      "id": 880685,
      "author_name": "Wouter Bulten",
      "author_url": "",
      "post_date": "2020-06-10T13:48:19.233000",
      "content": "<p>I wasn't able to reproduce this problem with the latest docker. What are you using for displaying the cases? Maybe you can share a notebook to show where the problem occurs.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 880727,
          "author_name": "fergusoci",
          "author_url": "",
          "post_date": "2020-06-10T14:21:56.867000",
          "content": "<p>Ah, could be that. I'll play around and see. Thanks</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 880636,
      "author_name": "fergusoci",
      "author_url": "",
      "post_date": "2020-06-10T13:04:25.010000",
      "content": "<p>Update on this: I managed to get imageio working and I'm not seeing the same issue for the sample file above when using that.</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "880598": "Wondering if anybody else has noticed issues with Openslide?\n\nFor certain images (typically the very large ones) I get areas of blanks in the images when I open level 1, but not level 0.\n\nTake 70256626a66f83e38b69a88a68967130.tiff for example:\n```\nslide = openslide.open_slide('/kaggle/input/prostate-cancer-grade-assessment/train_images/70256626a66f83e38b69a88a68967130.tiff')\nslide_image = slide.read_region((0, 0), 0, slide.level_dimensions[0]).convert(\"RGB\")\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2Fbd52e65119ae3041ef5f4111a889a890%2F70256626a66f83e38b69a88a68967130_level0_.png?generation=1591790740324197&amp;alt=media)\n```\n slide_image = slide.read_region((0, 0), 1, slide.level_dimensions[1]).convert(\"RGB\")\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F621560%2F42ad067f4af8f01cb7d804c52fe210cf%2F70256626a66f83e38b69a88a68967130_level1_.png?generation=1591790767041420&amp;alt=media)\n\nThere are many files where this is the case. I can't check out whether skimage / imageio give the same issues as I can't get them to work in kernels.  Has anyone else come across this? Do you know if it is a problem with the file rather than the openslide package? (i.e. does it work in skimage/imageio)?\n\nThanks",
    "880685": "I wasn't able to reproduce this problem with the latest docker. What are you using for displaying the cases? Maybe you can share a notebook to show where the problem occurs.",
    "880636": "Update on this: I managed to get imageio working and I'm not seeing the same issue for the sample file above when using that."
  }
}