{
  "id": 599849,
  "title": "It seems that there are some pairs of the mask and image nii files in segmentations have different affine.",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/599849",
  "author_name": "Yuzhi Xu",
  "post_date": "2025-08-19T11:51:57.053000",
  "votes": 0,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Many pairs of the mask and image nii files in segmentations have different affine. And most of these two matrix have opposite z directions and different orogin. And I calculate M=A^{-1}B. the diagonal of M is [1,1,-1,1] and only M(3,4) is not 0. It seems that the mask and image is not aligned in z-direction.</p>\n<p>For example \"1.2.826.0.1.3680043.8.498.10557880026294057874761753231388788828\"<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23396901%2F94edf31822db898e63c63106035efdd3%2F2025-08-19%20195001.png?generation=1755604242571323&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 3271704,
      "postDate": "2025-08-19T13:25:51.483Z",
      "content": "<p>The affine differences you are calculating are effectively negligible at the voxel scales of these images. When you load this image/segmentation pair in viewing software (e.g. Slicer or ITK-snap) you will see that the images/segmentations align. These small differences are due to different methods used for generating the images and the segmentations. Is this causing any issues for your processing? Because my assumption is that it should not be an issue.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8734370%2Fc59283b7553ac6987ed728f7a55e5f88%2FScreenshot%202025-08-19%20at%209.22.35AM.png?generation=1755609773954467&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "The affine differences you are calculating are effectively negligible at the voxel scales of these images. When you load this image/segmentation pair in viewing software (e.g. Slicer or ITK-snap) you will see that the images/segmentations align. These small differences are due to different methods used for generating the images and the segmentations. Is this causing any issues for your processing? Because my assumption is that it should not be an issue.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8734370%2Fc59283b7553ac6987ed728f7a55e5f88%2FScreenshot%202025-08-19%20at%209.22.35AM.png?generation=1755609773954467&alt=media)",
      "votes": 1
    },
    {
      "id": 3271675,
      "postDate": "2025-08-19T11:51:57.053Z",
      "content": "<p>Many pairs of the mask and image nii files in segmentations have different affine. And most of these two matrix have opposite z directions and different orogin. And I calculate M=A^{-1}B. the diagonal of M is [1,1,-1,1] and only M(3,4) is not 0. It seems that the mask and image is not aligned in z-direction.</p>\n<p>For example \"1.2.826.0.1.3680043.8.498.10557880026294057874761753231388788828\"<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23396901%2F94edf31822db898e63c63106035efdd3%2F2025-08-19%20195001.png?generation=1755604242571323&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Many pairs of the mask and image nii files in segmentations have different affine. And most of these two matrix have opposite z directions and different orogin. And I calculate M=A^{-1}B. the diagonal of M is [1,1,-1,1] and only M(3,4) is not 0. It seems that the mask and image is not aligned in z-direction.\n\nFor example \"1.2.826.0.1.3680043.8.498.10557880026294057874761753231388788828\"\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23396901%2F94edf31822db898e63c63106035efdd3%2F2025-08-19%20195001.png?generation=1755604242571323&alt=media)\n"
    }
  ],
  "comments": [
    {
      "id": 3271704,
      "author_name": "Evan Calabrese",
      "author_url": "",
      "post_date": "2025-08-19T13:25:51.483000",
      "content": "<p>The affine differences you are calculating are effectively negligible at the voxel scales of these images. When you load this image/segmentation pair in viewing software (e.g. Slicer or ITK-snap) you will see that the images/segmentations align. These small differences are due to different methods used for generating the images and the segmentations. Is this causing any issues for your processing? Because my assumption is that it should not be an issue.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8734370%2Fc59283b7553ac6987ed728f7a55e5f88%2FScreenshot%202025-08-19%20at%209.22.35AM.png?generation=1755609773954467&amp;alt=media\" alt=\"\"></p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3271704": "The affine differences you are calculating are effectively negligible at the voxel scales of these images. When you load this image/segmentation pair in viewing software (e.g. Slicer or ITK-snap) you will see that the images/segmentations align. These small differences are due to different methods used for generating the images and the segmentations. Is this causing any issues for your processing? Because my assumption is that it should not be an issue.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8734370%2Fc59283b7553ac6987ed728f7a55e5f88%2FScreenshot%202025-08-19%20at%209.22.35AM.png?generation=1755609773954467&alt=media)",
    "3271675": "Many pairs of the mask and image nii files in segmentations have different affine. And most of these two matrix have opposite z directions and different orogin. And I calculate M=A^{-1}B. the diagonal of M is [1,1,-1,1] and only M(3,4) is not 0. It seems that the mask and image is not aligned in z-direction.\n\nFor example \"1.2.826.0.1.3680043.8.498.10557880026294057874761753231388788828\"\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23396901%2F94edf31822db898e63c63106035efdd3%2F2025-08-19%20195001.png?generation=1755604242571323&alt=media)\n"
  }
}