{
  "id": 263613,
  "title": "Can I train a DL model with a tensor of a set of images?",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/263613",
  "author_name": "",
  "post_date": "2021-08-09T20:23:46.099132100Z",
  "votes": 7,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Do you know how can I train a deep learning model with a tensor of a set of images? I'd like to train the model with 4 features:</p>\n<p>1st feature:</p>\n<p>00000 - XXXXX<br>\n│   │<br>\n│   └─── FLAIR<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>2nd feature:</p>\n<p>│   └─── T1w<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>3rd feature:</p>\n<p>│   └─── T1wCE<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>4th feature:</p>\n<p>│   └─── T2w<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …..</p>\n<p>If someone knows a way to do this, please share the content or a link.</p>\n<p>Thanks!</p>",
  "messages": [
    {
      "id": "1462404",
      "postDate": "08/09/2021 20:23:46",
      "content": "<p>Do you know how can I train a deep learning model with a tensor of a set of images? I'd like to train the model with 4 features:</p>\n<p>1st feature:</p>\n<p>00000 - XXXXX<br>\n│   │<br>\n│   └─── FLAIR<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>2nd feature:</p>\n<p>│   └─── T1w<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>3rd feature:</p>\n<p>│   └─── T1wCE<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …</p>\n<p>4th feature:</p>\n<p>│   └─── T2w<br>\n│   │   │ Image-1.dcm<br>\n│   │   │ Image-2.dcm<br>\n│   │   │ …..</p>\n<p>If someone knows a way to do this, please share the content or a link.</p>\n<p>Thanks!</p>",
      "rawMarkdown": "Do you know how can I train a deep learning model with a tensor of a set of images? I'd like to train the model with 4 features:\n\n1st feature:\n\n00000 - XXXXX\n│   │\n│   └─── FLAIR\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n2nd feature:\n\n│   └─── T1w\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n3rd feature:\n\n│   └─── T1wCE\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n4th feature:\n\n│   └─── T2w\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ .....\n\nIf someone knows a way to do this, please share the content or a link.\n\nThanks!",
      "votes": null
    },
    {
      "id": "1463994",
      "postDate": "08/10/2021 12:11:53",
      "content": "<p>You can load each sequence separately and stacks them up as channels. But you'll have to use some tricks to make sure each sequence is of the same length.</p>\n<p>Also, Dicoms have a lot of metadata along with the image, you need to extract the image from the Dicom first. You can try pydicom for this</p>",
      "rawMarkdown": "You can load each sequence separately and stacks them up as channels. But you'll have to use some tricks to make sure each sequence is of the same length.\n\nAlso, Dicoms have a lot of metadata along with the image, you need to extract the image from the Dicom first. You can try pydicom for this",
      "votes": null
    },
    {
      "id": "1464278",
      "postDate": "08/10/2021 14:15:22",
      "content": "<p>do you know some literature explaining the stacking process as channels?</p>",
      "rawMarkdown": "do you know some literature explaining the stacking process as channels?",
      "votes": null
    },
    {
      "id": "1464370",
      "postDate": "08/10/2021 14:47:12",
      "content": "<p>I don't know of any literature but maybe you can find some notebooks doing this in this competition.</p>\n<p>You'd basically end up with a tensor of shape (4, 128, 128, 128) assuming you resized the images to 128x128 and selected 128 slices from the sequence. <br>\nFor selecting the slice you can do something like first 128 slices or middle 128 slices etc. You'll have to add padding in case number of available slices is less than 128.</p>",
      "rawMarkdown": "I don't know of any literature but maybe you can find some notebooks doing this in this competition.\n\nYou'd basically end up with a tensor of shape (4, 128, 128, 128) assuming you resized the images to 128x128 and selected 128 slices from the sequence. \nFor selecting the slice you can do something like first 128 slices or middle 128 slices etc. You'll have to add padding in case number of available slices is less than 128.",
      "votes": null
    },
    {
      "id": "1538145",
      "postDate": "10/08/2021 05:50:42",
      "content": "<p>You can check out <a href=\"https://www.kaggle.com/pranshu15/skipping-slices/notebook\" target=\"_blank\">this notebook</a> if you're still interested </p>",
      "rawMarkdown": "You can check out [this notebook](https://www.kaggle.com/pranshu15/skipping-slices/notebook) if you're still interested",
      "votes": null
    },
    {
      "id": "1539325",
      "postDate": "10/09/2021 10:25:52",
      "content": "<p>Stacking them as channels might not work because they are not aligned, but you can give it a try.</p>",
      "rawMarkdown": "Stacking them as channels might not work because they are not aligned, but you can give it a try.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1463994,
      "author_name": "pranshu15",
      "author_url": "",
      "post_date": "08/10/2021 12:11:53",
      "content": "<p>You can load each sequence separately and stacks them up as channels. But you'll have to use some tricks to make sure each sequence is of the same length.</p>\n<p>Also, Dicoms have a lot of metadata along with the image, you need to extract the image from the Dicom first. You can try pydicom for this</p>",
      "votes": null,
      "replies": [
        {
          "id": 1464278,
          "author_name": "hugovallejo",
          "author_url": "",
          "post_date": "08/10/2021 14:15:22",
          "content": "<p>do you know some literature explaining the stacking process as channels?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1464370,
          "author_name": "pranshu15",
          "author_url": "",
          "post_date": "08/10/2021 14:47:12",
          "content": "<p>I don't know of any literature but maybe you can find some notebooks doing this in this competition.</p>\n<p>You'd basically end up with a tensor of shape (4, 128, 128, 128) assuming you resized the images to 128x128 and selected 128 slices from the sequence. <br>\nFor selecting the slice you can do something like first 128 slices or middle 128 slices etc. You'll have to add padding in case number of available slices is less than 128.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1538145,
          "author_name": "pranshu15",
          "author_url": "",
          "post_date": "10/08/2021 05:50:42",
          "content": "<p>You can check out <a href=\"https://www.kaggle.com/pranshu15/skipping-slices/notebook\" target=\"_blank\">this notebook</a> if you're still interested </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1539325,
          "author_name": "gunesevitan",
          "author_url": "",
          "post_date": "10/09/2021 10:25:52",
          "content": "<p>Stacking them as channels might not work because they are not aligned, but you can give it a try.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1462404": "Do you know how can I train a deep learning model with a tensor of a set of images? I'd like to train the model with 4 features:\n\n1st feature:\n\n00000 - XXXXX\n│   │\n│   └─── FLAIR\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n2nd feature:\n\n│   └─── T1w\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n3rd feature:\n\n│   └─── T1wCE\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ ...\n\n4th feature:\n\n│   └─── T2w\n│   │   │ Image-1.dcm\n│   │   │ Image-2.dcm\n│   │   │ .....\n\nIf someone knows a way to do this, please share the content or a link.\n\nThanks!",
    "1463994": "You can load each sequence separately and stacks them up as channels. But you'll have to use some tricks to make sure each sequence is of the same length.\n\nAlso, Dicoms have a lot of metadata along with the image, you need to extract the image from the Dicom first. You can try pydicom for this",
    "1464278": "do you know some literature explaining the stacking process as channels?",
    "1464370": "I don't know of any literature but maybe you can find some notebooks doing this in this competition.\n\nYou'd basically end up with a tensor of shape (4, 128, 128, 128) assuming you resized the images to 128x128 and selected 128 slices from the sequence. \nFor selecting the slice you can do something like first 128 slices or middle 128 slices etc. You'll have to add padding in case number of available slices is less than 128.",
    "1538145": "You can check out [this notebook](https://www.kaggle.com/pranshu15/skipping-slices/notebook) if you're still interested",
    "1539325": "Stacking them as channels might not work because they are not aligned, but you can give it a try."
  },
  "source": "meta"
}