{
  "id": 428583,
  "title": "Clarification on segmentation",
  "url": "/competitions/rsna-2023-abdominal-trauma-detection/discussion/428583",
  "author_name": "David Roberts",
  "post_date": "2023-08-02T02:40:03.930000",
  "votes": 8,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I noticed that the segmentation files are rotated 90 degrees clockwise. Someone posted that they're in sagittal plane, but I've only seen axial masks. Also, it appears the mask instances are backward from the actual scans. That is, the scan images start at the top and go down through the abdomen/pelvis, but the segments start at the bottom and go up.</p>\n<p>Since the image instance numbers don't always start at zero .. i.e. 0.dcm, 1.dcm etc, the segmentation indexes don't line up. So, if a study has 500 images starting at index 150 (150.dcm-649.dcm), and the segmentation mask has 500 frames as well. Image 150.dcm will match the last mask in the array .. <code>mask[:,:,499]</code></p>\n<p>The last, most inferior image (649.dcm) will match the first label .. <code>mask[:,:,0]</code></p>\n<p>Is it correct that all masks are in the axial plane, are rotated 90 degrees clockwise, and instances are reversed from the scan instances?</p>",
  "messages": [
    {
      "id": 2369764,
      "postDate": "2023-08-02T02:40:03.930Z",
      "content": "<p>I noticed that the segmentation files are rotated 90 degrees clockwise. Someone posted that they're in sagittal plane, but I've only seen axial masks. Also, it appears the mask instances are backward from the actual scans. That is, the scan images start at the top and go down through the abdomen/pelvis, but the segments start at the bottom and go up.</p>\n<p>Since the image instance numbers don't always start at zero .. i.e. 0.dcm, 1.dcm etc, the segmentation indexes don't line up. So, if a study has 500 images starting at index 150 (150.dcm-649.dcm), and the segmentation mask has 500 frames as well. Image 150.dcm will match the last mask in the array .. <code>mask[:,:,499]</code></p>\n<p>The last, most inferior image (649.dcm) will match the first label .. <code>mask[:,:,0]</code></p>\n<p>Is it correct that all masks are in the axial plane, are rotated 90 degrees clockwise, and instances are reversed from the scan instances?</p>",
      "rawMarkdown": "I noticed that the segmentation files are rotated 90 degrees clockwise. Someone posted that they're in sagittal plane, but I've only seen axial masks. Also, it appears the mask instances are backward from the actual scans. That is, the scan images start at the top and go down through the abdomen/pelvis, but the segments start at the bottom and go up.\n\nSince the image instance numbers don't always start at zero .. i.e. 0.dcm, 1.dcm etc, the segmentation indexes don't line up. So, if a study has 500 images starting at index 150 (150.dcm-649.dcm), and the segmentation mask has 500 frames as well. Image 150.dcm will match the last mask in the array .. `mask[:,:,499]`\n\nThe last, most inferior image (649.dcm) will match the first label .. `mask[:,:,0]`\n\nIs it correct that all masks are in the axial plane, are rotated 90 degrees clockwise, and instances are reversed from the scan instances?",
      "votes": 8
    },
    {
      "id": 2370725,
      "postDate": "2023-08-02T15:46:04.493Z",
      "content": "<p>Please see this post: <a href=\"https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538</a></p>\n<p>\"Please be aware that the NIFTI files and DICOM files are not in the same orientation. Use the NIFTI header information along with DICOM metadata to determine the appropriate orientation such that the DICOM images and segmentation match\"</p>\n<p>The NIFTI files are indeed not in the same orientation. And as you mentioned, they could also be flipped on the Z-axis. The NIFTI header and DICOM metadata should contain all the information you need to correct for this misalignment. </p>",
      "rawMarkdown": "Please see this post: https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538\n\n\"Please be aware that the NIFTI files and DICOM files are not in the same orientation. Use the NIFTI header information along with DICOM metadata to determine the appropriate orientation such that the DICOM images and segmentation match\"\n\nThe NIFTI files are indeed not in the same orientation. And as you mentioned, they could also be flipped on the Z-axis. The NIFTI header and DICOM metadata should contain all the information you need to correct for this misalignment. ",
      "votes": 5,
      "replies": [
        {
          "id": 2370867,
          "postDate": "2023-08-02T17:08:45.320Z",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/huiminglin\" target=\"_blank\">@huiminglin</a>, I missed that post.</p>",
          "rawMarkdown": "Thanks @huiminglin, I missed that post.",
          "replies": [
            {
              "id": 2372777,
              "postDate": "2023-08-04T00:21:22.693Z",
              "content": "<p>Is there any resources that teach us how to adjust the masks to correct orientation using nifti header and dicom metadata?</p>",
              "rawMarkdown": "Is there any resources that teach us how to adjust the masks to correct orientation using nifti header and dicom metadata?",
              "votes": 2
            }
          ]
        }
      ]
    },
    {
      "id": 2370631,
      "postDate": "2023-08-02T14:27:40.713Z",
      "content": "<p>I drew the same conclusions as you did, and it seems that the label mapping is the following : <br>\n1: liver<br>\n2: spleen<br>\n3: LK<br>\n4: RK<br>\n5: bowel</p>",
      "rawMarkdown": "I drew the same conclusions as you did, and it seems that the label mapping is the following : \n1: liver\n2: spleen\n3: LK\n4: RK\n5: bowel",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 2370725,
      "author_name": "Hui Ming Lin",
      "author_url": "",
      "post_date": "2023-08-02T15:46:04.493000",
      "content": "<p>Please see this post: <a href=\"https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538</a></p>\n<p>\"Please be aware that the NIFTI files and DICOM files are not in the same orientation. Use the NIFTI header information along with DICOM metadata to determine the appropriate orientation such that the DICOM images and segmentation match\"</p>\n<p>The NIFTI files are indeed not in the same orientation. And as you mentioned, they could also be flipped on the Z-axis. The NIFTI header and DICOM metadata should contain all the information you need to correct for this misalignment. </p>",
      "votes": 5,
      "replies": [
        {
          "id": 2370867,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2023-08-02T17:08:45.320000",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/huiminglin\" target=\"_blank\">@huiminglin</a>, I missed that post.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2372777,
              "author_name": "Feng Qilong",
              "author_url": "",
              "post_date": "2023-08-04T00:21:22.693000",
              "content": "<p>Is there any resources that teach us how to adjust the masks to correct orientation using nifti header and dicom metadata?</p>",
              "votes": 2,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2370631,
      "author_name": "Gregoire D",
      "author_url": "",
      "post_date": "2023-08-02T14:27:40.713000",
      "content": "<p>I drew the same conclusions as you did, and it seems that the label mapping is the following : <br>\n1: liver<br>\n2: spleen<br>\n3: LK<br>\n4: RK<br>\n5: bowel</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2369764": "I noticed that the segmentation files are rotated 90 degrees clockwise. Someone posted that they're in sagittal plane, but I've only seen axial masks. Also, it appears the mask instances are backward from the actual scans. That is, the scan images start at the top and go down through the abdomen/pelvis, but the segments start at the bottom and go up.\n\nSince the image instance numbers don't always start at zero .. i.e. 0.dcm, 1.dcm etc, the segmentation indexes don't line up. So, if a study has 500 images starting at index 150 (150.dcm-649.dcm), and the segmentation mask has 500 frames as well. Image 150.dcm will match the last mask in the array .. `mask[:,:,499]`\n\nThe last, most inferior image (649.dcm) will match the first label .. `mask[:,:,0]`\n\nIs it correct that all masks are in the axial plane, are rotated 90 degrees clockwise, and instances are reversed from the scan instances?",
    "2370725": "Please see this post: https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/428538\n\n\"Please be aware that the NIFTI files and DICOM files are not in the same orientation. Use the NIFTI header information along with DICOM metadata to determine the appropriate orientation such that the DICOM images and segmentation match\"\n\nThe NIFTI files are indeed not in the same orientation. And as you mentioned, they could also be flipped on the Z-axis. The NIFTI header and DICOM metadata should contain all the information you need to correct for this misalignment. ",
    "2370631": "I drew the same conclusions as you did, and it seems that the label mapping is the following : \n1: liver\n2: spleen\n3: LK\n4: RK\n5: bowel"
  }
}