{
  "id": 203353,
  "title": "Annotations",
  "url": "/competitions/ranzcr-clip-catheter-line-classification/discussion/203353",
  "author_name": "",
  "post_date": "2020-12-14T22:52:12.791553700Z",
  "votes": 9,
  "comment_count": 4,
  "views": 0,
  "content": "<p>What annotations file can contain?<br>\nI try to visualize them and the data looks like this:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F70ead894b7b01920954e825b264245ef%2FUntitled.png?generation=1607986637717706&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F6423bedd65617f3848100ad41b75b3ea%2FUntitled.png?generation=1607986663475778&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F40b77522a5118555eb8c7825ee8b0cfa%2FUntitled.png?generation=1607986743259865&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "1112806",
      "postDate": "12/14/2020 22:52:12",
      "content": "<p>What annotations file can contain?<br>\nI try to visualize them and the data looks like this:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F70ead894b7b01920954e825b264245ef%2FUntitled.png?generation=1607986637717706&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F6423bedd65617f3848100ad41b75b3ea%2FUntitled.png?generation=1607986663475778&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F40b77522a5118555eb8c7825ee8b0cfa%2FUntitled.png?generation=1607986743259865&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "What annotations file can contain?\nI try to visualize them and the data looks like this:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F70ead894b7b01920954e825b264245ef%2FUntitled.png?generation=1607986637717706&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F6423bedd65617f3848100ad41b75b3ea%2FUntitled.png?generation=1607986663475778&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F40b77522a5118555eb8c7825ee8b0cfa%2FUntitled.png?generation=1607986743259865&alt=media)",
      "votes": null
    },
    {
      "id": "1112810",
      "postDate": "12/14/2020 22:59:38",
      "content": "<p>It looks like the main crater/tube in the image</p>",
      "rawMarkdown": "It looks like the main crater/tube in the image",
      "votes": null
    },
    {
      "id": "1112819",
      "postDate": "12/14/2020 23:18:51",
      "content": "<p>A few clinical notes, as I look at the above pictures. </p>\n<p>Remember chest radiographs are displayed as if you are facing the patient. Their left is on your right. There is usually a marker \"L\" or \"R\" (left or right) to label the side.</p>\n<p>Portable - the image might say \"portable\" somewhere. \"Portable images are taken with a mobile xray unit, often with the patient lying in bed. Non-portable xrays are usually taken with the patient standing up.</p>\n<p>Other devices you might see:</p>\n<p>EKG leads - The lines with a small triangular thing on the end are external EKG leads (to monitor the heart). Very common. They are OUTSIDE the patient, and not part of this contest. But, they can get in the way of seeing what you want to.</p>\n<p>Tracheostomy tube - midline, over the neck. A breathing tube that goes into a hole in the neck, rather than though the mouth/nose. I think this contest treats them the same as ETT (Endotracheal tubes), although they are different. [EDIT]</p>\n<p>VP Shunt - I think the first image might have a VP Shunt (Ventriculoperitoneal). It is from top to bottom, slightly to the right of midline. Goes from the brain to the abdomen to drain excess fluid in the brain ventricles.</p>\n<p>Chest Port - The third set of images shows a right-sided line that I think is a chest port. A small vessel is implanted under the skin and connected to a catheter. Could be mistaken for a CVC (Central Venous Catheter).</p>\n<p>-Rich</p>",
      "rawMarkdown": "A few clinical notes, as I look at the above pictures. \n\nRemember chest radiographs are displayed as if you are facing the patient. Their left is on your right. There is usually a marker \"L\" or \"R\" (left or right) to label the side.\n\nPortable - the image might say \"portable\" somewhere. \"Portable images are taken with a mobile xray unit, often with the patient lying in bed. Non-portable xrays are usually taken with the patient standing up.\n\nOther devices you might see:\n\nEKG leads - The lines with a small triangular thing on the end are external EKG leads (to monitor the heart). Very common. They are OUTSIDE the patient, and not part of this contest. But, they can get in the way of seeing what you want to.\n\nTracheostomy tube - midline, over the neck. A breathing tube that goes into a hole in the neck, rather than though the mouth/nose. I think this contest treats them the same as ETT (Endotracheal tubes), although they are different. [EDIT]\n\nVP Shunt - I think the first image might have a VP Shunt (Ventriculoperitoneal). It is from top to bottom, slightly to the right of midline. Goes from the brain to the abdomen to drain excess fluid in the brain ventricles.\n\nChest Port - The third set of images shows a right-sided line that I think is a chest port. A small vessel is implanted under the skin and connected to a catheter. Could be mistaken for a CVC (Central Venous Catheter).\n\n-Rich",
      "votes": null
    },
    {
      "id": "1117620",
      "postDate": "12/18/2020 09:08:50",
      "content": "<p>it looks like this.<br>\nan image can have multiple tubes. <br>\nthat is what one image can be labeled simultaneously as normal and abnormal.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffe4afa838504cbc563016eb712c35bb7%2F1.2.826.0.1.3680043.8.498.10107305395949944133738035888912687021.png?generation=1608282522521076&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "it looks like this.\nan image can have multiple tubes. \nthat is what one image can be labeled simultaneously as normal and abnormal.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffe4afa838504cbc563016eb712c35bb7%2F1.2.826.0.1.3680043.8.498.10107305395949944133738035888912687021.png?generation=1608282522521076&alt=media)",
      "votes": null
    },
    {
      "id": "1117642",
      "postDate": "12/18/2020 09:36:43",
      "content": "<p>They are points located on the tubes. I think it is better to visualize all annotations in a single image together. It gives better understanding. This is the reason why some of the samples can have multiple positive labels.</p>\n<p><img src=\"https://i.ibb.co/x8FnnM3/annot2.png\" alt=\"img\"></p>\n<p>This is code if you want to use.</p>\n<pre><code>def visualize_annotations(filename):\n    image = cv2.imread(f'../input/ranzcr-clip-catheter-line-classification/train/{filename}')\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    study_instance_uid = filename.split('.jpg')[0]\n    if study_instance_uid in df_train_annotations['StudyInstanceUID'].values:\n        labels = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['label'].values.tolist()\n        lines = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['data'].apply(lambda x: eval(x)).values.tolist()\n        print(f'Sample {study_instance_uid}\\n{\"-\" * (7 + len(study_instance_uid))}\\n')\n        fig = plt.figure(figsize=(image.shape[0] // 150, image.shape[1] // 150))\n        ax = plt.imshow(image)\n        for line, label in zip(lines, labels):\n            print(f'{label}\\n{\"-\" * len(label)}\\n{line}\\n')            \n            xs = []\n            ys = []\n            for point in line:\n                xs.append(point[0])\n                ys.append(point[-1])\n            plt.scatter(xs, ys, s=40, label=label)\n        plt.tick_params(axis='x', labelsize=15)\n        plt.tick_params(axis='y', labelsize=15)\n        plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0, prop={'size': 20})\n        plt.title(f'{study_instance_uid} Annotations', size=20, pad=20)\n        plt.show()\n    else:\n        return None\n</code></pre>",
      "rawMarkdown": "They are points located on the tubes. I think it is better to visualize all annotations in a single image together. It gives better understanding. This is the reason why some of the samples can have multiple positive labels.\n\n![img](https://i.ibb.co/x8FnnM3/annot2.png)\n\nThis is code if you want to use.\n\n```\ndef visualize_annotations(filename):\n    image = cv2.imread(f'../input/ranzcr-clip-catheter-line-classification/train/{filename}')\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    study_instance_uid = filename.split('.jpg')[0]\n    if study_instance_uid in df_train_annotations['StudyInstanceUID'].values:\n        labels = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['label'].values.tolist()\n        lines = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['data'].apply(lambda x: eval(x)).values.tolist()\n        print(f'Sample {study_instance_uid}\\n{\"-\" * (7 + len(study_instance_uid))}\\n')\n        fig = plt.figure(figsize=(image.shape[0] // 150, image.shape[1] // 150))\n        ax = plt.imshow(image)\n        for line, label in zip(lines, labels):\n            print(f'{label}\\n{\"-\" * len(label)}\\n{line}\\n')            \n            xs = []\n            ys = []\n            for point in line:\n                xs.append(point[0])\n                ys.append(point[-1])\n            plt.scatter(xs, ys, s=40, label=label)\n        plt.tick_params(axis='x', labelsize=15)\n        plt.tick_params(axis='y', labelsize=15)\n        plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0, prop={'size': 20})\n        plt.title(f'{study_instance_uid} Annotations', size=20, pad=20)\n        plt.show()\n    else:\n        return None\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1112810,
      "author_name": "ihelon",
      "author_url": "",
      "post_date": "12/14/2020 22:59:38",
      "content": "<p>It looks like the main crater/tube in the image</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1112819,
      "author_name": "richardepstein",
      "author_url": "",
      "post_date": "12/14/2020 23:18:51",
      "content": "<p>A few clinical notes, as I look at the above pictures. </p>\n<p>Remember chest radiographs are displayed as if you are facing the patient. Their left is on your right. There is usually a marker \"L\" or \"R\" (left or right) to label the side.</p>\n<p>Portable - the image might say \"portable\" somewhere. \"Portable images are taken with a mobile xray unit, often with the patient lying in bed. Non-portable xrays are usually taken with the patient standing up.</p>\n<p>Other devices you might see:</p>\n<p>EKG leads - The lines with a small triangular thing on the end are external EKG leads (to monitor the heart). Very common. They are OUTSIDE the patient, and not part of this contest. But, they can get in the way of seeing what you want to.</p>\n<p>Tracheostomy tube - midline, over the neck. A breathing tube that goes into a hole in the neck, rather than though the mouth/nose. I think this contest treats them the same as ETT (Endotracheal tubes), although they are different. [EDIT]</p>\n<p>VP Shunt - I think the first image might have a VP Shunt (Ventriculoperitoneal). It is from top to bottom, slightly to the right of midline. Goes from the brain to the abdomen to drain excess fluid in the brain ventricles.</p>\n<p>Chest Port - The third set of images shows a right-sided line that I think is a chest port. A small vessel is implanted under the skin and connected to a catheter. Could be mistaken for a CVC (Central Venous Catheter).</p>\n<p>-Rich</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1117620,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "12/18/2020 09:08:50",
      "content": "<p>it looks like this.<br>\nan image can have multiple tubes. <br>\nthat is what one image can be labeled simultaneously as normal and abnormal.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffe4afa838504cbc563016eb712c35bb7%2F1.2.826.0.1.3680043.8.498.10107305395949944133738035888912687021.png?generation=1608282522521076&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1117642,
      "author_name": "gunesevitan",
      "author_url": "",
      "post_date": "12/18/2020 09:36:43",
      "content": "<p>They are points located on the tubes. I think it is better to visualize all annotations in a single image together. It gives better understanding. This is the reason why some of the samples can have multiple positive labels.</p>\n<p><img src=\"https://i.ibb.co/x8FnnM3/annot2.png\" alt=\"img\"></p>\n<p>This is code if you want to use.</p>\n<pre><code>def visualize_annotations(filename):\n    image = cv2.imread(f'../input/ranzcr-clip-catheter-line-classification/train/{filename}')\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    study_instance_uid = filename.split('.jpg')[0]\n    if study_instance_uid in df_train_annotations['StudyInstanceUID'].values:\n        labels = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['label'].values.tolist()\n        lines = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['data'].apply(lambda x: eval(x)).values.tolist()\n        print(f'Sample {study_instance_uid}\\n{\"-\" * (7 + len(study_instance_uid))}\\n')\n        fig = plt.figure(figsize=(image.shape[0] // 150, image.shape[1] // 150))\n        ax = plt.imshow(image)\n        for line, label in zip(lines, labels):\n            print(f'{label}\\n{\"-\" * len(label)}\\n{line}\\n')            \n            xs = []\n            ys = []\n            for point in line:\n                xs.append(point[0])\n                ys.append(point[-1])\n            plt.scatter(xs, ys, s=40, label=label)\n        plt.tick_params(axis='x', labelsize=15)\n        plt.tick_params(axis='y', labelsize=15)\n        plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0, prop={'size': 20})\n        plt.title(f'{study_instance_uid} Annotations', size=20, pad=20)\n        plt.show()\n    else:\n        return None\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1112806": "What annotations file can contain?\nI try to visualize them and the data looks like this:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F70ead894b7b01920954e825b264245ef%2FUntitled.png?generation=1607986637717706&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F6423bedd65617f3848100ad41b75b3ea%2FUntitled.png?generation=1607986663475778&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1313949%2F40b77522a5118555eb8c7825ee8b0cfa%2FUntitled.png?generation=1607986743259865&alt=media)",
    "1112810": "It looks like the main crater/tube in the image",
    "1112819": "A few clinical notes, as I look at the above pictures. \n\nRemember chest radiographs are displayed as if you are facing the patient. Their left is on your right. There is usually a marker \"L\" or \"R\" (left or right) to label the side.\n\nPortable - the image might say \"portable\" somewhere. \"Portable images are taken with a mobile xray unit, often with the patient lying in bed. Non-portable xrays are usually taken with the patient standing up.\n\nOther devices you might see:\n\nEKG leads - The lines with a small triangular thing on the end are external EKG leads (to monitor the heart). Very common. They are OUTSIDE the patient, and not part of this contest. But, they can get in the way of seeing what you want to.\n\nTracheostomy tube - midline, over the neck. A breathing tube that goes into a hole in the neck, rather than though the mouth/nose. I think this contest treats them the same as ETT (Endotracheal tubes), although they are different. [EDIT]\n\nVP Shunt - I think the first image might have a VP Shunt (Ventriculoperitoneal). It is from top to bottom, slightly to the right of midline. Goes from the brain to the abdomen to drain excess fluid in the brain ventricles.\n\nChest Port - The third set of images shows a right-sided line that I think is a chest port. A small vessel is implanted under the skin and connected to a catheter. Could be mistaken for a CVC (Central Venous Catheter).\n\n-Rich",
    "1117620": "it looks like this.\nan image can have multiple tubes. \nthat is what one image can be labeled simultaneously as normal and abnormal.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F113660%2Ffe4afa838504cbc563016eb712c35bb7%2F1.2.826.0.1.3680043.8.498.10107305395949944133738035888912687021.png?generation=1608282522521076&alt=media)",
    "1117642": "They are points located on the tubes. I think it is better to visualize all annotations in a single image together. It gives better understanding. This is the reason why some of the samples can have multiple positive labels.\n\n![img](https://i.ibb.co/x8FnnM3/annot2.png)\n\nThis is code if you want to use.\n\n```\ndef visualize_annotations(filename):\n    image = cv2.imread(f'../input/ranzcr-clip-catheter-line-classification/train/{filename}')\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    study_instance_uid = filename.split('.jpg')[0]\n    if study_instance_uid in df_train_annotations['StudyInstanceUID'].values:\n        labels = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['label'].values.tolist()\n        lines = df_train_annotations.loc[df_train_annotations['StudyInstanceUID'] == study_instance_uid]['data'].apply(lambda x: eval(x)).values.tolist()\n        print(f'Sample {study_instance_uid}\\n{\"-\" * (7 + len(study_instance_uid))}\\n')\n        fig = plt.figure(figsize=(image.shape[0] // 150, image.shape[1] // 150))\n        ax = plt.imshow(image)\n        for line, label in zip(lines, labels):\n            print(f'{label}\\n{\"-\" * len(label)}\\n{line}\\n')            \n            xs = []\n            ys = []\n            for point in line:\n                xs.append(point[0])\n                ys.append(point[-1])\n            plt.scatter(xs, ys, s=40, label=label)\n        plt.tick_params(axis='x', labelsize=15)\n        plt.tick_params(axis='y', labelsize=15)\n        plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0, prop={'size': 20})\n        plt.title(f'{study_instance_uid} Annotations', size=20, pad=20)\n        plt.show()\n    else:\n        return None\n```"
  },
  "source": "meta"
}