{
  "id": 520909,
  "title": "T1 and T2, do we need to perform registration?",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/520909",
  "author_name": "",
  "post_date": "2024-07-17T22:06:24.651037900Z",
  "votes": 11,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I have a question. we are given both T1 and T2 Sagittal MRI mages.</p>\n<p>some of them have different image size. what is the reason?<br>\nThey seem to be spatially aligned. So I can just resize them to a common size for multi-channel input?</p>\n<p>They have the same number of instances.<br>\nAre they taken at the exact same time?<br>\nIf not, won't some tissue, fluid, e.g move?<br>\nif so do we need to register them (find motion vector)?</p>",
  "messages": [
    {
      "id": "2926670",
      "postDate": "07/17/2024 22:06:24",
      "content": "<p>I have a question. we are given both T1 and T2 Sagittal MRI mages.</p>\n<p>some of them have different image size. what is the reason?<br>\nThey seem to be spatially aligned. So I can just resize them to a common size for multi-channel input?</p>\n<p>They have the same number of instances.<br>\nAre they taken at the exact same time?<br>\nIf not, won't some tissue, fluid, e.g move?<br>\nif so do we need to register them (find motion vector)?</p>",
      "rawMarkdown": "I have a question. we are given both T1 and T2 Sagittal MRI mages.\n\nsome of them have different image size. what is the reason?\nThey seem to be spatially aligned. So I can just resize them to a common size for multi-channel input?\n\nThey have the same number of instances.\nAre they taken at the exact same time?\nIf not, won't some tissue, fluid, e.g move?\nif so do we need to register them (find motion vector)?",
      "votes": null
    },
    {
      "id": "2926864",
      "postDate": "07/18/2024 04:52:06",
      "content": "<p>I know from <a href=\"https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/514891\" target=\"_blank\">this discussion</a> that not all of the studies have spatially aligned series based on their instance numbers.</p>\n<p>For example, there is the comparison of series 3892989905 and 3951475160 from study 3637444890:</p>\n<pre><code> pathlib  Path\n\n numpy  np\n torchio  tio\n medio  read_img\n\n\ntrain_images_path = Path()\n\n ():\n    scan, meta = read_img(dcm_path, backend=)\n    meta.convert()\n     tio.ScalarImage(tensor=scan[], affine=np.asarray(meta.affine))\n\nstudy_id, series_id = ,  \nfig, axes = plt.subplots(, , figsize=(, ))\nread_to_tio(train_images_path / (study_id) / (series_id)).plot(axes=axes[], show=)\nseries_id =  \nread_to_tio(train_images_path / (study_id) / (series_id)).plot(axes=axes[], show=)\nplt.show()\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2F51ea74f3c96180afd556f2537c3c3770%2Fcomparison.png?generation=1721278178661096&amp;alt=media\"></p>",
      "rawMarkdown": "I know from [this discussion](https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/514891) that not all of the studies have spatially aligned series based on their instance numbers.\n\nFor example, there is the comparison of series 3892989905 and 3951475160 from study 3637444890:\n```python\nfrom pathlib import Path\n\nimport numpy as np\nimport torchio as tio\nfrom medio import read_img\n\n\ntrain_images_path = Path(\"../input/rsna-2024-lumbar-spine-degenerative-classification/train_images\")\n\ndef read_to_tio(dcm_path):\n    scan, meta = read_img(dcm_path, backend=\"pydicom\")\n    meta.convert(\"nib\")\n    return tio.ScalarImage(tensor=scan[None], affine=np.asarray(meta.affine))\n\nstudy_id, series_id = 3637444890, 3892989905 # Sagittal T2/STIR\nfig, axes = plt.subplots(2, 3, figsize=(10, 10))\nread_to_tio(train_images_path / str(study_id) / str(series_id)).plot(axes=axes[0], show=False)\nseries_id = 3951475160 # Sagittal T1\nread_to_tio(train_images_path / str(study_id) / str(series_id)).plot(axes=axes[1], show=False)\nplt.show()\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2F51ea74f3c96180afd556f2537c3c3770%2Fcomparison.png?generation=1721278178661096&alt=media)",
      "votes": null
    },
    {
      "id": "2930032",
      "postDate": "07/20/2024 15:35:09",
      "content": "<p>Even more, the first one is not the neck?</p>\n<p>EDIT: That was just the discusssion.</p>",
      "rawMarkdown": "Even more, the first one is not the neck?\n\nEDIT: That was just the discusssion.",
      "votes": null
    },
    {
      "id": "2931860",
      "postDate": "07/22/2024 12:00:54",
      "content": "<p>The sequences are not taken at the same time. Although, in most cases they will be taken with the same field of view, matrix size, slice spacing, pixel spacing, etc. so theoretically many of them would not require registration to be overlapped. However, if the patient moves or any of those parameters I listed are for some reason changed between sequences, then the sequences may not be aligned. </p>\n<p>I think you can use the <code>ImagePositionPatient</code> attribute in the DICOM header to see if the positions are the same for both sequences. The other parameters that would affect this can also be found in the DICOM header.</p>",
      "rawMarkdown": "The sequences are not taken at the same time. Although, in most cases they will be taken with the same field of view, matrix size, slice spacing, pixel spacing, etc. so theoretically many of them would not require registration to be overlapped. However, if the patient moves or any of those parameters I listed are for some reason changed between sequences, then the sequences may not be aligned. \n\nI think you can use the `ImagePositionPatient` attribute in the DICOM header to see if the positions are the same for both sequences. The other parameters that would affect this can also be found in the DICOM header.",
      "votes": null
    },
    {
      "id": "2931958",
      "postDate": "07/22/2024 13:29:11",
      "content": "<p>thanks for the answer.</p>\n<p>i will try convolution with multichannels T1 and T2.<br>\nif that doesn't work, we still have transformer for fusing the different information.</p>",
      "rawMarkdown": "thanks for the answer.\n\ni will try convolution with multichannels T1 and T2.\nif that doesn't work, we still have transformer for fusing the different information.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2926864,
      "author_name": "coderrkj",
      "author_url": "",
      "post_date": "07/18/2024 04:52:06",
      "content": "<p>I know from <a href=\"https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/514891\" target=\"_blank\">this discussion</a> that not all of the studies have spatially aligned series based on their instance numbers.</p>\n<p>For example, there is the comparison of series 3892989905 and 3951475160 from study 3637444890:</p>\n<pre><code> pathlib  Path\n\n numpy  np\n torchio  tio\n medio  read_img\n\n\ntrain_images_path = Path()\n\n ():\n    scan, meta = read_img(dcm_path, backend=)\n    meta.convert()\n     tio.ScalarImage(tensor=scan[], affine=np.asarray(meta.affine))\n\nstudy_id, series_id = ,  \nfig, axes = plt.subplots(, , figsize=(, ))\nread_to_tio(train_images_path / (study_id) / (series_id)).plot(axes=axes[], show=)\nseries_id =  \nread_to_tio(train_images_path / (study_id) / (series_id)).plot(axes=axes[], show=)\nplt.show()\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2F51ea74f3c96180afd556f2537c3c3770%2Fcomparison.png?generation=1721278178661096&amp;alt=media\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 2930032,
          "author_name": "sacuscreed",
          "author_url": "",
          "post_date": "07/20/2024 15:35:09",
          "content": "<p>Even more, the first one is not the neck?</p>\n<p>EDIT: That was just the discusssion.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2931860,
      "author_name": "vaillant",
      "author_url": "",
      "post_date": "07/22/2024 12:00:54",
      "content": "<p>The sequences are not taken at the same time. Although, in most cases they will be taken with the same field of view, matrix size, slice spacing, pixel spacing, etc. so theoretically many of them would not require registration to be overlapped. However, if the patient moves or any of those parameters I listed are for some reason changed between sequences, then the sequences may not be aligned. </p>\n<p>I think you can use the <code>ImagePositionPatient</code> attribute in the DICOM header to see if the positions are the same for both sequences. The other parameters that would affect this can also be found in the DICOM header.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2931958,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "07/22/2024 13:29:11",
          "content": "<p>thanks for the answer.</p>\n<p>i will try convolution with multichannels T1 and T2.<br>\nif that doesn't work, we still have transformer for fusing the different information.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2926670": "I have a question. we are given both T1 and T2 Sagittal MRI mages.\n\nsome of them have different image size. what is the reason?\nThey seem to be spatially aligned. So I can just resize them to a common size for multi-channel input?\n\nThey have the same number of instances.\nAre they taken at the exact same time?\nIf not, won't some tissue, fluid, e.g move?\nif so do we need to register them (find motion vector)?",
    "2926864": "I know from [this discussion](https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/514891) that not all of the studies have spatially aligned series based on their instance numbers.\n\nFor example, there is the comparison of series 3892989905 and 3951475160 from study 3637444890:\n```python\nfrom pathlib import Path\n\nimport numpy as np\nimport torchio as tio\nfrom medio import read_img\n\n\ntrain_images_path = Path(\"../input/rsna-2024-lumbar-spine-degenerative-classification/train_images\")\n\ndef read_to_tio(dcm_path):\n    scan, meta = read_img(dcm_path, backend=\"pydicom\")\n    meta.convert(\"nib\")\n    return tio.ScalarImage(tensor=scan[None], affine=np.asarray(meta.affine))\n\nstudy_id, series_id = 3637444890, 3892989905 # Sagittal T2/STIR\nfig, axes = plt.subplots(2, 3, figsize=(10, 10))\nread_to_tio(train_images_path / str(study_id) / str(series_id)).plot(axes=axes[0], show=False)\nseries_id = 3951475160 # Sagittal T1\nread_to_tio(train_images_path / str(study_id) / str(series_id)).plot(axes=axes[1], show=False)\nplt.show()\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2F51ea74f3c96180afd556f2537c3c3770%2Fcomparison.png?generation=1721278178661096&alt=media)",
    "2930032": "Even more, the first one is not the neck?\n\nEDIT: That was just the discusssion.",
    "2931860": "The sequences are not taken at the same time. Although, in most cases they will be taken with the same field of view, matrix size, slice spacing, pixel spacing, etc. so theoretically many of them would not require registration to be overlapped. However, if the patient moves or any of those parameters I listed are for some reason changed between sequences, then the sequences may not be aligned. \n\nI think you can use the `ImagePositionPatient` attribute in the DICOM header to see if the positions are the same for both sequences. The other parameters that would affect this can also be found in the DICOM header.",
    "2931958": "thanks for the answer.\n\ni will try convolution with multichannels T1 and T2.\nif that doesn't work, we still have transformer for fusing the different information."
  },
  "source": "meta"
}