{
  "id": 350759,
  "title": "How to check slice order/orientation in test dataset?",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/350759",
  "author_name": "tomoo inubushi",
  "post_date": "2022-09-07T01:00:00.815000",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hi kagglers.<br>\nI found that some dicom loading functions in popular public notebooks do not properly work for some patients (e.g., 1.2.826.0.1.3680043.16729). <br>\nI think the current best choice is using torchio in <a href=\"https://www.kaggle.com/code/fepegar/torchio-3d-loading-preprocessing-augmentation/notebook\" target=\"_blank\">this notebook</a> by <a href=\"https://www.kaggle.com/fepegar\" target=\"_blank\">@fepegar</a>, but I am not sure whether it works for test dataset.<br>\nDo you have any ideas about confirming our dicom loading functions are free from slice order/orientation problem in test dataset?</p>\n<p>P.S. It seems that torchio currently does not support data loading of test set. I am happy if anyone teach me how to fix it.</p>",
  "messages": [
    {
      "id": 1945089,
      "postDate": "2022-09-18T20:29:22.913Z",
      "content": "<p>I think you can use dicom dictionary to kind of sort this out, a bit.  <br>\n<a href=\"https://www.kaggle.com/code/junhyeonkwon/about-dcm-orientation\" target=\"_blank\">Here</a> is my example of using <code>ImageOrientationPatient</code>.  </p>\n<p>I didn't submit any results yet but here's what I'll probably do:  </p>\n<ul>\n<li>read dcm slices</li>\n<li>rotate &amp; stack slices into 3D tensor (using matrix operations like transpose or smth)</li>\n<li>apply torchvision.transforms (resize, affine, etc)  </li>\n</ul>\n<p>However, I couldn't fully address the problems like less than 30 degree rotation variance, severe text neck like in 1.2.826.0.1.3680043.16729.</p>",
      "rawMarkdown": "I think you can use dicom dictionary to kind of sort this out, a bit.  \n[Here](https://www.kaggle.com/code/junhyeonkwon/about-dcm-orientation) is my example of using ```ImageOrientationPatient```.  \n\nI didn't submit any results yet but here's what I'll probably do:  \n- read dcm slices\n- rotate & stack slices into 3D tensor (using matrix operations like transpose or smth)\n- apply torchvision.transforms (resize, affine, etc)  \n\nHowever, I couldn't fully address the problems like less than 30 degree rotation variance, severe text neck like in 1.2.826.0.1.3680043.16729.",
      "votes": 1
    },
    {
      "id": 1929303,
      "postDate": "2022-09-07T01:00:00.817Z",
      "content": "<p>Hi kagglers.<br>\nI found that some dicom loading functions in popular public notebooks do not properly work for some patients (e.g., 1.2.826.0.1.3680043.16729). <br>\nI think the current best choice is using torchio in <a href=\"https://www.kaggle.com/code/fepegar/torchio-3d-loading-preprocessing-augmentation/notebook\" target=\"_blank\">this notebook</a> by <a href=\"https://www.kaggle.com/fepegar\" target=\"_blank\">@fepegar</a>, but I am not sure whether it works for test dataset.<br>\nDo you have any ideas about confirming our dicom loading functions are free from slice order/orientation problem in test dataset?</p>\n<p>P.S. It seems that torchio currently does not support data loading of test set. I am happy if anyone teach me how to fix it.</p>",
      "rawMarkdown": "Hi kagglers.\nI found that some dicom loading functions in popular public notebooks do not properly work for some patients (e.g., 1.2.826.0.1.3680043.16729). \nI think the current best choice is using torchio in [this notebook](https://www.kaggle.com/code/fepegar/torchio-3d-loading-preprocessing-augmentation/notebook) by @fepegar, but I am not sure whether it works for test dataset.\nDo you have any ideas about confirming our dicom loading functions are free from slice order/orientation problem in test dataset?\n\nP.S. It seems that torchio currently does not support data loading of test set. I am happy if anyone teach me how to fix it.",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 1945089,
      "author_name": "JunHyeonKwon",
      "author_url": "",
      "post_date": "2022-09-18T20:29:22.913000",
      "content": "<p>I think you can use dicom dictionary to kind of sort this out, a bit.  <br>\n<a href=\"https://www.kaggle.com/code/junhyeonkwon/about-dcm-orientation\" target=\"_blank\">Here</a> is my example of using <code>ImageOrientationPatient</code>.  </p>\n<p>I didn't submit any results yet but here's what I'll probably do:  </p>\n<ul>\n<li>read dcm slices</li>\n<li>rotate &amp; stack slices into 3D tensor (using matrix operations like transpose or smth)</li>\n<li>apply torchvision.transforms (resize, affine, etc)  </li>\n</ul>\n<p>However, I couldn't fully address the problems like less than 30 degree rotation variance, severe text neck like in 1.2.826.0.1.3680043.16729.</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1945089": "I think you can use dicom dictionary to kind of sort this out, a bit.  \n[Here](https://www.kaggle.com/code/junhyeonkwon/about-dcm-orientation) is my example of using ```ImageOrientationPatient```.  \n\nI didn't submit any results yet but here's what I'll probably do:  \n- read dcm slices\n- rotate & stack slices into 3D tensor (using matrix operations like transpose or smth)\n- apply torchvision.transforms (resize, affine, etc)  \n\nHowever, I couldn't fully address the problems like less than 30 degree rotation variance, severe text neck like in 1.2.826.0.1.3680043.16729.",
    "1929303": "Hi kagglers.\nI found that some dicom loading functions in popular public notebooks do not properly work for some patients (e.g., 1.2.826.0.1.3680043.16729). \nI think the current best choice is using torchio in [this notebook](https://www.kaggle.com/code/fepegar/torchio-3d-loading-preprocessing-augmentation/notebook) by @fepegar, but I am not sure whether it works for test dataset.\nDo you have any ideas about confirming our dicom loading functions are free from slice order/orientation problem in test dataset?\n\nP.S. It seems that torchio currently does not support data loading of test set. I am happy if anyone teach me how to fix it."
  }
}