{
  "id": 603094,
  "title": "[Maybe Not Fixed]Still hit Error reading multiframe dicom in hidden testset, which works for all train series",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/603094",
  "author_name": "RihanPiggy",
  "post_date": "2025-08-31T16:06:20.265000",
  "votes": 12,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I know many of the submissions on the LB have try except in their code and that may cause some potential data issue to be ignored. The fix of the public LB score does not means all the issue is clear. </p>\n<p>As mentioned in title, I have wrote a custom io tool to deal with dicom files, which works well on <strong>all of</strong> the train series. But I get exception in submission after about 7 minutes….Which makes me feel that there is still some issues in the testset(Maybe not, but I have checked my code many times to figure out potential bug). </p>\n<p>The logic of my is tool is as follows:</p>\n<ol>\n<li>check and remove non valid dicom without SeriesInstanceUID, InstanceNumber, ImageOrientationPatient, ImagePositionPatient. (result to 0 valid dicom before testset update, fixed after the update)</li>\n<li>remove localizer. Check ImageType and remove dicom with 'LOCALIZER' or 'PROJECTION IMAGE' in ImageType.</li>\n<li>Check whether the dicom is multiframe dicom.</li>\n<li>If not multiframe, sort the dicoms by ImagePositionPatient and gather them together.</li>\n<li>If multiframe, extract the volume and get the image orientation by using PerFrameFunctionalGroupsSequence tag.</li>\n</ol>\n<p>Considering the code worked for all the train series, obviously there is a data pattern which only occurs in the hidden testset. So here I have some questions hoping that the host may answer to help find out the potential outlier. <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> <a href=\"https://www.kaggle.com/evancalabrese\" target=\"_blank\">@evancalabrese</a> </p>\n<ol>\n<li>Is there multiframe volume in hidden testset? If yes, does multiframe dicom contains \"PerFrameFunctionalGroupsSequence\" tag? At lease all the PHILIPS multiframe dicom in train series contain the \"PerFrameFunctionalGroupsSequence\", but it is not contained in <a href=\"https://www.kaggle.com/code/ryanholbrook/rsna-aneurysm-detection-demo-submission\" target=\"_blank\">demo-submission</a>.</li>\n<li>Is there a dicom which has a broken file_meta? I saw <code>force=True</code> in demo-submission.</li>\n<li>Is there a series whose dicoms are all localizers? There are some localizer image in train series, which has different image shape with others, often duplicated.</li>\n</ol>\n<p>Personally, I suspect that the issue is on multiframe dicom, the logic of 2D dicom is pretty simple and only access to metadata like ImageOrientationPatient, ImagePositionPatient.</p>\n<p>I appreciate for the work of kaggle and hope that the hidden testset can be proved good without a try exception workaround. If neccesary, I am glad to provide my io tool privately to help figure out the problem.</p>\n<p><strong>Update</strong>: The error arises from multiframe dicom in hidden testset. After I comment out the if route for multiframe, the \"Notebook threw Exception\" disappear. Chances are that it is a metadata issue. It is too frustrating to debug by comment out and submit…. Hoping the host to clarify the question 1 above, thanks again.</p>\n<p><strong>Update2</strong>: The error comes from dicom which lacks \"PerFrameFunctionalGroupsSequence\" Tag. We cannot identify the Position of each slice without this tag and can only have a workaround with SpacingBetweenSlices(if exists). Also Orientation cannot be identified if some other tags do not exist. Considering all the train series do not have this problem, I guess that there are some series from another site which never appear in train series. But, is this expected? I think it is better not to have an unknown dicom format which never occur in train set to appear in test set, at least for a competition.</p>\n<p><strong>Update3</strong>: The error still occurs after the update. Here are the possible reasons according to my code.</p>\n<ol>\n<li>ImageOrientationPatient is missing in PerFrameFunctionalGroupsSequence</li>\n<li>PixelMeasuresSequence or PixelSpacing missing in PerFrameFunctionalGroupsSequence<br>\nI think the first one may be cirtical. My code with try exception set the default value which is the same as the value in train set</li>\n</ol>",
  "messages": [
    {
      "id": 3279319,
      "postDate": "2025-08-31T16:06:20.267Z",
      "content": "<p>I know many of the submissions on the LB have try except in their code and that may cause some potential data issue to be ignored. The fix of the public LB score does not means all the issue is clear. </p>\n<p>As mentioned in title, I have wrote a custom io tool to deal with dicom files, which works well on <strong>all of</strong> the train series. But I get exception in submission after about 7 minutes….Which makes me feel that there is still some issues in the testset(Maybe not, but I have checked my code many times to figure out potential bug). </p>\n<p>The logic of my is tool is as follows:</p>\n<ol>\n<li>check and remove non valid dicom without SeriesInstanceUID, InstanceNumber, ImageOrientationPatient, ImagePositionPatient. (result to 0 valid dicom before testset update, fixed after the update)</li>\n<li>remove localizer. Check ImageType and remove dicom with 'LOCALIZER' or 'PROJECTION IMAGE' in ImageType.</li>\n<li>Check whether the dicom is multiframe dicom.</li>\n<li>If not multiframe, sort the dicoms by ImagePositionPatient and gather them together.</li>\n<li>If multiframe, extract the volume and get the image orientation by using PerFrameFunctionalGroupsSequence tag.</li>\n</ol>\n<p>Considering the code worked for all the train series, obviously there is a data pattern which only occurs in the hidden testset. So here I have some questions hoping that the host may answer to help find out the potential outlier. <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> <a href=\"https://www.kaggle.com/evancalabrese\" target=\"_blank\">@evancalabrese</a> </p>\n<ol>\n<li>Is there multiframe volume in hidden testset? If yes, does multiframe dicom contains \"PerFrameFunctionalGroupsSequence\" tag? At lease all the PHILIPS multiframe dicom in train series contain the \"PerFrameFunctionalGroupsSequence\", but it is not contained in <a href=\"https://www.kaggle.com/code/ryanholbrook/rsna-aneurysm-detection-demo-submission\" target=\"_blank\">demo-submission</a>.</li>\n<li>Is there a dicom which has a broken file_meta? I saw <code>force=True</code> in demo-submission.</li>\n<li>Is there a series whose dicoms are all localizers? There are some localizer image in train series, which has different image shape with others, often duplicated.</li>\n</ol>\n<p>Personally, I suspect that the issue is on multiframe dicom, the logic of 2D dicom is pretty simple and only access to metadata like ImageOrientationPatient, ImagePositionPatient.</p>\n<p>I appreciate for the work of kaggle and hope that the hidden testset can be proved good without a try exception workaround. If neccesary, I am glad to provide my io tool privately to help figure out the problem.</p>\n<p><strong>Update</strong>: The error arises from multiframe dicom in hidden testset. After I comment out the if route for multiframe, the \"Notebook threw Exception\" disappear. Chances are that it is a metadata issue. It is too frustrating to debug by comment out and submit…. Hoping the host to clarify the question 1 above, thanks again.</p>\n<p><strong>Update2</strong>: The error comes from dicom which lacks \"PerFrameFunctionalGroupsSequence\" Tag. We cannot identify the Position of each slice without this tag and can only have a workaround with SpacingBetweenSlices(if exists). Also Orientation cannot be identified if some other tags do not exist. Considering all the train series do not have this problem, I guess that there are some series from another site which never appear in train series. But, is this expected? I think it is better not to have an unknown dicom format which never occur in train set to appear in test set, at least for a competition.</p>\n<p><strong>Update3</strong>: The error still occurs after the update. Here are the possible reasons according to my code.</p>\n<ol>\n<li>ImageOrientationPatient is missing in PerFrameFunctionalGroupsSequence</li>\n<li>PixelMeasuresSequence or PixelSpacing missing in PerFrameFunctionalGroupsSequence<br>\nI think the first one may be cirtical. My code with try exception set the default value which is the same as the value in train set</li>\n</ol>",
      "rawMarkdown": "I know many of the submissions on the LB have try except in their code and that may cause some potential data issue to be ignored. The fix of the public LB score does not means all the issue is clear. \n\nAs mentioned in title, I have wrote a custom io tool to deal with dicom files, which works well on **all of** the train series. But I get exception in submission after about 7 minutes....Which makes me feel that there is still some issues in the testset(Maybe not, but I have checked my code many times to figure out potential bug). \n\nThe logic of my is tool is as follows:\n1. check and remove non valid dicom without SeriesInstanceUID, InstanceNumber, ImageOrientationPatient, ImagePositionPatient. (result to 0 valid dicom before testset update, fixed after the update)\n2. remove localizer. Check ImageType and remove dicom with 'LOCALIZER' or 'PROJECTION IMAGE' in ImageType.\n3. Check whether the dicom is multiframe dicom.\n4. If not multiframe, sort the dicoms by ImagePositionPatient and gather them together.\n5. If multiframe, extract the volume and get the image orientation by using PerFrameFunctionalGroupsSequence tag.\n\nConsidering the code worked for all the train series, obviously there is a data pattern which only occurs in the hidden testset. So here I have some questions hoping that the host may answer to help find out the potential outlier. @ryanholbrook @evancalabrese \n1. Is there multiframe volume in hidden testset? If yes, does multiframe dicom contains \"PerFrameFunctionalGroupsSequence\" tag? At lease all the PHILIPS multiframe dicom in train series contain the \"PerFrameFunctionalGroupsSequence\", but it is not contained in [demo-submission](https://www.kaggle.com/code/ryanholbrook/rsna-aneurysm-detection-demo-submission).\n2. Is there a dicom which has a broken file_meta? I saw `force=True` in demo-submission.\n3. Is there a series whose dicoms are all localizers? There are some localizer image in train series, which has different image shape with others, often duplicated.\n\nPersonally, I suspect that the issue is on multiframe dicom, the logic of 2D dicom is pretty simple and only access to metadata like ImageOrientationPatient, ImagePositionPatient.\n\nI appreciate for the work of kaggle and hope that the hidden testset can be proved good without a try exception workaround. If neccesary, I am glad to provide my io tool privately to help figure out the problem.\n\n**Update**: The error arises from multiframe dicom in hidden testset. After I comment out the if route for multiframe, the \"Notebook threw Exception\" disappear. Chances are that it is a metadata issue. It is too frustrating to debug by comment out and submit.... Hoping the host to clarify the question 1 above, thanks again.\n\n**Update2**: The error comes from dicom which lacks \"PerFrameFunctionalGroupsSequence\" Tag. We cannot identify the Position of each slice without this tag and can only have a workaround with SpacingBetweenSlices(if exists). Also Orientation cannot be identified if some other tags do not exist. Considering all the train series do not have this problem, I guess that there are some series from another site which never appear in train series. But, is this expected? I think it is better not to have an unknown dicom format which never occur in train set to appear in test set, at least for a competition.\n\n**Update3**: The error still occurs after the update. Here are the possible reasons according to my code.\n1. ImageOrientationPatient is missing in PerFrameFunctionalGroupsSequence\n2. PixelMeasuresSequence or PixelSpacing missing in PerFrameFunctionalGroupsSequence\nI think the first one may be cirtical. My code with try exception set the default value which is the same as the value in train set",
      "votes": 12
    },
    {
      "id": 3280290,
      "postDate": "2025-09-02T12:36:42.827Z",
      "content": "<p>Thanks so much for your detailed analysis and updates! We will take a closer look to see if indeed there is a test-set specific DICOM header pattern as you have suggested. In the short term, hopefully you can skip this case, which should not contribute meaningfully to your score. We will get back to you once we have reviewed.</p>",
      "rawMarkdown": "Thanks so much for your detailed analysis and updates! We will take a closer look to see if indeed there is a test-set specific DICOM header pattern as you have suggested. In the short term, hopefully you can skip this case, which should not contribute meaningfully to your score. We will get back to you once we have reviewed.",
      "votes": 3,
      "replies": [
        {
          "id": 3281444,
          "postDate": "2025-09-04T10:01:26.323Z",
          "content": "<p>Thanks!</p>\n<blockquote>\n  <p>which should not contribute meaningfully to your score</p>\n</blockquote>\n<p>Do you mean that multiframe dicoms are assumed to have \"PerFrameFunctionalGroupsSequence\" Tag and the case which hit the error is an outlier? Or do you mean that there are not many multiframe dicoms in testest? </p>\n<p>My concern is that in the train set, there are around 330 multiframe dicoms, which is 9% of the all. If the distribution is the same in testset and all the multiframe dicoms lack \"PerFrameFunctionalGroupsSequence\" Tag, ignoring all the multiframe dicoms will definitely damage the score.</p>",
          "rawMarkdown": "Thanks!\n>which should not contribute meaningfully to your score\n\nDo you mean that multiframe dicoms are assumed to have \"PerFrameFunctionalGroupsSequence\" Tag and the case which hit the error is an outlier? Or do you mean that there are not many multiframe dicoms in testest? \n\nMy concern is that in the train set, there are around 330 multiframe dicoms, which is 9% of the all. If the distribution is the same in testset and all the multiframe dicoms lack \"PerFrameFunctionalGroupsSequence\" Tag, ignoring all the multiframe dicoms will definitely damage the score.",
          "votes": 3
        },
        {
          "id": 3294253,
          "postDate": "2025-09-25T17:04:03.743Z",
          "content": "<p>Hi! Is the issue in test set fixed?</p>",
          "rawMarkdown": "Hi! Is the issue in test set fixed?",
          "votes": 1,
          "isDeleted": true
        }
      ]
    },
    {
      "id": 3294616,
      "postDate": "2025-09-26T12:36:44.153Z",
      "content": "<p>Thanks for the detailed update <a href=\"https://www.kaggle.com/honglihang\" target=\"_blank\">@honglihang</a>. I am assuming you are able to process all dicoms without error now?</p>",
      "rawMarkdown": "Thanks for the detailed update @honglihang. I am assuming you are able to process all dicoms without error now?",
      "replies": [
        {
          "id": 3295055,
          "postDate": "2025-09-27T14:23:52.837Z",
          "content": "<p>Hi, to tell the truth I am not sure enough. I finally added try exception to set the default value for the missing tag. After the test set update, I have not yet test the code without try exception. I have revert the code to that version and made a submission today, so I will update whether the code passed. Please wait.</p>",
          "rawMarkdown": "Hi, to tell the truth I am not sure enough. I finally added try exception to set the default value for the missing tag. After the test set update, I have not yet test the code without try exception. I have revert the code to that version and made a submission today, so I will update whether the code passed. Please wait.",
          "votes": 2
        },
        {
          "id": 3295065,
          "postDate": "2025-09-27T15:00:32.293Z",
          "content": "<p>Hi, my submission failed after 13min with original code without try exception. Seems that still there are some information missing in dicom metadata. I have updated the discussion.<br>\n<a href=\"https://www.kaggle.com/evancalabrese\" target=\"_blank\">@evancalabrese</a> </p>",
          "rawMarkdown": "Hi, my submission failed after 13min with original code without try exception. Seems that still there are some information missing in dicom metadata. I have updated the discussion.\n@evancalabrese ",
          "votes": 2
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 3280290,
      "author_name": "Evan Calabrese",
      "author_url": "",
      "post_date": "2025-09-02T12:36:42.827000",
      "content": "<p>Thanks so much for your detailed analysis and updates! We will take a closer look to see if indeed there is a test-set specific DICOM header pattern as you have suggested. In the short term, hopefully you can skip this case, which should not contribute meaningfully to your score. We will get back to you once we have reviewed.</p>",
      "votes": 3,
      "replies": [
        {
          "id": 3281444,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2025-09-04T10:01:26.323000",
          "content": "<p>Thanks!</p>\n<blockquote>\n  <p>which should not contribute meaningfully to your score</p>\n</blockquote>\n<p>Do you mean that multiframe dicoms are assumed to have \"PerFrameFunctionalGroupsSequence\" Tag and the case which hit the error is an outlier? Or do you mean that there are not many multiframe dicoms in testest? </p>\n<p>My concern is that in the train set, there are around 330 multiframe dicoms, which is 9% of the all. If the distribution is the same in testset and all the multiframe dicoms lack \"PerFrameFunctionalGroupsSequence\" Tag, ignoring all the multiframe dicoms will definitely damage the score.</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 3294253,
          "author_name": "",
          "author_url": "",
          "post_date": "2025-09-25T17:04:03.743000",
          "content": "<p>Hi! Is the issue in test set fixed?</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 3294616,
      "author_name": "Bartley",
      "author_url": "",
      "post_date": "2025-09-26T12:36:44.153000",
      "content": "<p>Thanks for the detailed update <a href=\"https://www.kaggle.com/honglihang\" target=\"_blank\">@honglihang</a>. I am assuming you are able to process all dicoms without error now?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3295055,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2025-09-27T14:23:52.837000",
          "content": "<p>Hi, to tell the truth I am not sure enough. I finally added try exception to set the default value for the missing tag. After the test set update, I have not yet test the code without try exception. I have revert the code to that version and made a submission today, so I will update whether the code passed. Please wait.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 3295065,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2025-09-27T15:00:32.293000",
          "content": "<p>Hi, my submission failed after 13min with original code without try exception. Seems that still there are some information missing in dicom metadata. I have updated the discussion.<br>\n<a href=\"https://www.kaggle.com/evancalabrese\" target=\"_blank\">@evancalabrese</a> </p>",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3279319": "I know many of the submissions on the LB have try except in their code and that may cause some potential data issue to be ignored. The fix of the public LB score does not means all the issue is clear. \n\nAs mentioned in title, I have wrote a custom io tool to deal with dicom files, which works well on **all of** the train series. But I get exception in submission after about 7 minutes....Which makes me feel that there is still some issues in the testset(Maybe not, but I have checked my code many times to figure out potential bug). \n\nThe logic of my is tool is as follows:\n1. check and remove non valid dicom without SeriesInstanceUID, InstanceNumber, ImageOrientationPatient, ImagePositionPatient. (result to 0 valid dicom before testset update, fixed after the update)\n2. remove localizer. Check ImageType and remove dicom with 'LOCALIZER' or 'PROJECTION IMAGE' in ImageType.\n3. Check whether the dicom is multiframe dicom.\n4. If not multiframe, sort the dicoms by ImagePositionPatient and gather them together.\n5. If multiframe, extract the volume and get the image orientation by using PerFrameFunctionalGroupsSequence tag.\n\nConsidering the code worked for all the train series, obviously there is a data pattern which only occurs in the hidden testset. So here I have some questions hoping that the host may answer to help find out the potential outlier. @ryanholbrook @evancalabrese \n1. Is there multiframe volume in hidden testset? If yes, does multiframe dicom contains \"PerFrameFunctionalGroupsSequence\" tag? At lease all the PHILIPS multiframe dicom in train series contain the \"PerFrameFunctionalGroupsSequence\", but it is not contained in [demo-submission](https://www.kaggle.com/code/ryanholbrook/rsna-aneurysm-detection-demo-submission).\n2. Is there a dicom which has a broken file_meta? I saw `force=True` in demo-submission.\n3. Is there a series whose dicoms are all localizers? There are some localizer image in train series, which has different image shape with others, often duplicated.\n\nPersonally, I suspect that the issue is on multiframe dicom, the logic of 2D dicom is pretty simple and only access to metadata like ImageOrientationPatient, ImagePositionPatient.\n\nI appreciate for the work of kaggle and hope that the hidden testset can be proved good without a try exception workaround. If neccesary, I am glad to provide my io tool privately to help figure out the problem.\n\n**Update**: The error arises from multiframe dicom in hidden testset. After I comment out the if route for multiframe, the \"Notebook threw Exception\" disappear. Chances are that it is a metadata issue. It is too frustrating to debug by comment out and submit.... Hoping the host to clarify the question 1 above, thanks again.\n\n**Update2**: The error comes from dicom which lacks \"PerFrameFunctionalGroupsSequence\" Tag. We cannot identify the Position of each slice without this tag and can only have a workaround with SpacingBetweenSlices(if exists). Also Orientation cannot be identified if some other tags do not exist. Considering all the train series do not have this problem, I guess that there are some series from another site which never appear in train series. But, is this expected? I think it is better not to have an unknown dicom format which never occur in train set to appear in test set, at least for a competition.\n\n**Update3**: The error still occurs after the update. Here are the possible reasons according to my code.\n1. ImageOrientationPatient is missing in PerFrameFunctionalGroupsSequence\n2. PixelMeasuresSequence or PixelSpacing missing in PerFrameFunctionalGroupsSequence\nI think the first one may be cirtical. My code with try exception set the default value which is the same as the value in train set",
    "3280290": "Thanks so much for your detailed analysis and updates! We will take a closer look to see if indeed there is a test-set specific DICOM header pattern as you have suggested. In the short term, hopefully you can skip this case, which should not contribute meaningfully to your score. We will get back to you once we have reviewed.",
    "3294616": "Thanks for the detailed update @honglihang. I am assuming you are able to process all dicoms without error now?"
  }
}