{
  "id": 170496,
  "title": "Image Shapes",
  "url": "/competitions/siim-isic-melanoma-classification/discussion/170496",
  "author_name": "",
  "post_date": "2020-07-28T01:11:44.977878Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi, very new to kaggle competitions and deep learning. I imported the dicom files and looked the shape of the pixel_array and noticed that they were 3D with shape (4000, 6000, 3). Not sure why the arrays are in three dimensions, can someone explain why? And are there other ways to import the images?</p>",
  "messages": [
    {
      "id": "948457",
      "postDate": "07/28/2020 01:11:44",
      "content": "<p>Hi, very new to kaggle competitions and deep learning. I imported the dicom files and looked the shape of the pixel_array and noticed that they were 3D with shape (4000, 6000, 3). Not sure why the arrays are in three dimensions, can someone explain why? And are there other ways to import the images?</p>",
      "rawMarkdown": "Hi, very new to kaggle competitions and deep learning. I imported the dicom files and looked the shape of the pixel_array and noticed that they were 3D with shape (4000, 6000, 3). Not sure why the arrays are in three dimensions, can someone explain why? And are there other ways to import the images?",
      "votes": null
    },
    {
      "id": "948492",
      "postDate": "07/28/2020 02:31:21",
      "content": "<p>They are color images and they have three channels (red, green, blue), so they are 3 dimensions (height, width, channels). For other ways to import the images, check out some of the notebooks (<a href=\"https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks\">https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks</a>). You don't have to use the <code>dicom</code> files, the <code>jpegs</code> are also provided on the Data page, and you can use Pillow (<code>PIL.Image.open</code>) or OpenCV (<code>cv2.imread</code>) to import them. Chris Deotte has also provided them in <code>TFRecords</code> format (<a href=\"https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579\">https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579</a>). </p>",
      "rawMarkdown": "They are color images and they have three channels (red, green, blue), so they are 3 dimensions (height, width, channels). For other ways to import the images, check out some of the notebooks (https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks). You don't have to use the `dicom` files, the `jpegs` are also provided on the Data page, and you can use Pillow (`PIL.Image.open`) or OpenCV (`cv2.imread`) to import them. Chris Deotte has also provided them in `TFRecords` format (https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579).",
      "votes": null
    },
    {
      "id": "948580",
      "postDate": "07/28/2020 04:35:42",
      "content": "<p>Hi, the 3 dimensions that you see in image shape are expected when using colored images. The first 2 numbers are the pixel resolution and third one (3) is for storing RGB color value. \nComputers sees an input image as an array of pixels. Based on the image resolution, it will see h x w x d ( h = Height, w = Width, d = Dimension ). If the image is colored with 32 by 32 resolution then it will see it as 32 x 32 x 3 (where 3 refers to RGB values) and if the image is grayscale then it will see it as 4 x 4 x 1 (or as 4 x 4) array of matrix. Hope that helps.</p>",
      "rawMarkdown": "Hi, the 3 dimensions that you see in image shape are expected when using colored images. The first 2 numbers are the pixel resolution and third one (3) is for storing RGB color value. \nComputers sees an input image as an array of pixels. Based on the image resolution, it will see h x w x d ( h = Height, w = Width, d = Dimension ). If the image is colored with 32 by 32 resolution then it will see it as 32 x 32 x 3 (where 3 refers to RGB values) and if the image is grayscale then it will see it as 4 x 4 x 1 (or as 4 x 4) array of matrix. Hope that helps.",
      "votes": null
    },
    {
      "id": "948838",
      "postDate": "07/28/2020 09:02:39",
      "content": "<p>First two define the location of each pixel, while the third represents its RGB value - try \"Edit colors\"  in Paint to have an intuition on how the RGB [0-255][0-255][0-255] works</p>",
      "rawMarkdown": "First two define the location of each pixel, while the third represents its RGB value - try \"Edit colors\"  in Paint to have an intuition on how the RGB [0-255][0-255][0-255] works",
      "votes": null
    },
    {
      "id": "949032",
      "postDate": "07/28/2020 11:52:02",
      "content": "<p>Hi there!!</p>\n\n<p>I haven't worked with dicom but the three at end denotes the number of color channels. Had it been 1, then your image would be a grayscale image(like you see in the old movies).</p>\n\n<p>This might help in visualizing :  </p>\n\n<p><img src=\"https://i.ytimg.com/vi/cTDtYnYOahw/maxresdefault.jpg\" alt=\"This Illustration\"></p>",
      "rawMarkdown": "Hi there!!\n\nI haven't worked with dicom but the three at end denotes the number of color channels. Had it been 1, then your image would be a grayscale image(like you see in the old movies).\n\nThis might help in visualizing :  \n\n![This Illustration](https://i.ytimg.com/vi/cTDtYnYOahw/maxresdefault.jpg)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 948492,
      "author_name": "brandenkmurray",
      "author_url": "",
      "post_date": "07/28/2020 02:31:21",
      "content": "<p>They are color images and they have three channels (red, green, blue), so they are 3 dimensions (height, width, channels). For other ways to import the images, check out some of the notebooks (<a href=\"https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks\">https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks</a>). You don't have to use the <code>dicom</code> files, the <code>jpegs</code> are also provided on the Data page, and you can use Pillow (<code>PIL.Image.open</code>) or OpenCV (<code>cv2.imread</code>) to import them. Chris Deotte has also provided them in <code>TFRecords</code> format (<a href=\"https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579\">https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579</a>). </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 948580,
      "author_name": "ektasharma",
      "author_url": "",
      "post_date": "07/28/2020 04:35:42",
      "content": "<p>Hi, the 3 dimensions that you see in image shape are expected when using colored images. The first 2 numbers are the pixel resolution and third one (3) is for storing RGB color value. \nComputers sees an input image as an array of pixels. Based on the image resolution, it will see h x w x d ( h = Height, w = Width, d = Dimension ). If the image is colored with 32 by 32 resolution then it will see it as 32 x 32 x 3 (where 3 refers to RGB values) and if the image is grayscale then it will see it as 4 x 4 x 1 (or as 4 x 4) array of matrix. Hope that helps.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 948838,
      "author_name": "andreyraav",
      "author_url": "",
      "post_date": "07/28/2020 09:02:39",
      "content": "<p>First two define the location of each pixel, while the third represents its RGB value - try \"Edit colors\"  in Paint to have an intuition on how the RGB [0-255][0-255][0-255] works</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 949032,
      "author_name": "fireheart7",
      "author_url": "",
      "post_date": "07/28/2020 11:52:02",
      "content": "<p>Hi there!!</p>\n\n<p>I haven't worked with dicom but the three at end denotes the number of color channels. Had it been 1, then your image would be a grayscale image(like you see in the old movies).</p>\n\n<p>This might help in visualizing :  </p>\n\n<p><img src=\"https://i.ytimg.com/vi/cTDtYnYOahw/maxresdefault.jpg\" alt=\"This Illustration\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "948457": "Hi, very new to kaggle competitions and deep learning. I imported the dicom files and looked the shape of the pixel_array and noticed that they were 3D with shape (4000, 6000, 3). Not sure why the arrays are in three dimensions, can someone explain why? And are there other ways to import the images?",
    "948492": "They are color images and they have three channels (red, green, blue), so they are 3 dimensions (height, width, channels). For other ways to import the images, check out some of the notebooks (https://www.kaggle.com/c/siim-isic-melanoma-classification/notebooks). You don't have to use the `dicom` files, the `jpegs` are also provided on the Data page, and you can use Pillow (`PIL.Image.open`) or OpenCV (`cv2.imread`) to import them. Chris Deotte has also provided them in `TFRecords` format (https://www.kaggle.com/c/siim-isic-melanoma-classification/discussion/155579).",
    "948580": "Hi, the 3 dimensions that you see in image shape are expected when using colored images. The first 2 numbers are the pixel resolution and third one (3) is for storing RGB color value. \nComputers sees an input image as an array of pixels. Based on the image resolution, it will see h x w x d ( h = Height, w = Width, d = Dimension ). If the image is colored with 32 by 32 resolution then it will see it as 32 x 32 x 3 (where 3 refers to RGB values) and if the image is grayscale then it will see it as 4 x 4 x 1 (or as 4 x 4) array of matrix. Hope that helps.",
    "948838": "First two define the location of each pixel, while the third represents its RGB value - try \"Edit colors\"  in Paint to have an intuition on how the RGB [0-255][0-255][0-255] works",
    "949032": "Hi there!!\n\nI haven't worked with dicom but the three at end denotes the number of color channels. Had it been 1, then your image would be a grayscale image(like you see in the old movies).\n\nThis might help in visualizing :  \n\n![This Illustration](https://i.ytimg.com/vi/cTDtYnYOahw/maxresdefault.jpg)"
  },
  "source": "meta"
}