{
  "id": 348422,
  "title": "3D data augmentations library",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/348422",
  "author_name": "",
  "post_date": "2022-08-28T10:51:23.724801300Z",
  "votes": 4,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Is anyone aware of a library that performs data augmentations on 3d volumes, compatible with PyTorch and ideally works on GPU? </p>\n<p>During training, I'm loading (B,C,D,H,W)=(batch_size,1,224,224,224) tensors and I'd like to apply rotations/flips in the x-y plane that are constant throughout the z dimension. </p>\n<p>I guess one way is to apply the same 2d transformation to every slice but would this be slow? Another approach could be to use <a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rotate.html\" target=\"_blank\">scipy.ndimage.rotate</a> but I'm worried about memory/speed since I think this requires numpy arrays as input. </p>",
  "messages": [
    {
      "id": "1917012",
      "postDate": "08/28/2022 10:51:23",
      "content": "<p>Is anyone aware of a library that performs data augmentations on 3d volumes, compatible with PyTorch and ideally works on GPU? </p>\n<p>During training, I'm loading (B,C,D,H,W)=(batch_size,1,224,224,224) tensors and I'd like to apply rotations/flips in the x-y plane that are constant throughout the z dimension. </p>\n<p>I guess one way is to apply the same 2d transformation to every slice but would this be slow? Another approach could be to use <a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rotate.html\" target=\"_blank\">scipy.ndimage.rotate</a> but I'm worried about memory/speed since I think this requires numpy arrays as input. </p>",
      "rawMarkdown": "Is anyone aware of a library that performs data augmentations on 3d volumes, compatible with PyTorch and ideally works on GPU? \n\nDuring training, I'm loading (B,C,D,H,W)=(batch_size,1,224,224,224) tensors and I'd like to apply rotations/flips in the x-y plane that are constant throughout the z dimension. \n\nI guess one way is to apply the same 2d transformation to every slice but would this be slow? Another approach could be to use [scipy.ndimage.rotate](https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rotate.html) but I'm worried about memory/speed since I think this requires numpy arrays as input.",
      "votes": null
    },
    {
      "id": "1917077",
      "postDate": "08/28/2022 12:06:22",
      "content": "<p>You could check out Kornia: <a href=\"https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d\" target=\"_blank\">https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d</a></p>",
      "rawMarkdown": "You could check out Kornia: https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d",
      "votes": null
    },
    {
      "id": "1917107",
      "postDate": "08/28/2022 12:36:04",
      "content": "<p>Just what I was looking for, thank you! </p>",
      "rawMarkdown": "Just what I was looking for, thank you!",
      "votes": null
    },
    {
      "id": "1917176",
      "postDate": "08/28/2022 13:37:36",
      "content": "<p>Here is my recommendation: <a href=\"https://github.com/ZFTurbo/volumentations\" target=\"_blank\">https://github.com/ZFTurbo/volumentations</a></p>",
      "rawMarkdown": "Here is my recommendation: https://github.com/ZFTurbo/volumentations",
      "votes": null
    },
    {
      "id": "1918506",
      "postDate": "08/29/2022 16:12:15",
      "content": "<p>I would suggest MONAI (<a href=\"https://monai.io\" target=\"_blank\">https://monai.io</a>) which is developed from medical DL projects, it has plenty of augmentation strategies, not limited to flip/rotate. </p>",
      "rawMarkdown": "I would suggest MONAI (https://monai.io) which is developed from medical DL projects, it has plenty of augmentation strategies, not limited to flip/rotate.",
      "votes": null
    },
    {
      "id": "1922184",
      "postDate": "09/01/2022 10:22:23",
      "content": "<p>(B,C,D,H,W)=(batch_size,1,224,224,224)<br>\nWhat's your train batch size? And What's your GPU type and how many GPUs you have?</p>",
      "rawMarkdown": "(B,C,D,H,W)=(batch_size,1,224,224,224)\nWhat's your train batch size? And What's your GPU type and how many GPUs you have?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1917077,
      "author_name": "surajghuwalewala",
      "author_url": "",
      "post_date": "08/28/2022 12:06:22",
      "content": "<p>You could check out Kornia: <a href=\"https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d\" target=\"_blank\">https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1917107,
          "author_name": "samuelcortinhas",
          "author_url": "",
          "post_date": "08/28/2022 12:36:04",
          "content": "<p>Just what I was looking for, thank you! </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1917176,
      "author_name": "analokamus",
      "author_url": "",
      "post_date": "08/28/2022 13:37:36",
      "content": "<p>Here is my recommendation: <a href=\"https://github.com/ZFTurbo/volumentations\" target=\"_blank\">https://github.com/ZFTurbo/volumentations</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1918506,
      "author_name": "bardiakh",
      "author_url": "",
      "post_date": "08/29/2022 16:12:15",
      "content": "<p>I would suggest MONAI (<a href=\"https://monai.io\" target=\"_blank\">https://monai.io</a>) which is developed from medical DL projects, it has plenty of augmentation strategies, not limited to flip/rotate. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1922184,
      "author_name": "h030162",
      "author_url": "",
      "post_date": "09/01/2022 10:22:23",
      "content": "<p>(B,C,D,H,W)=(batch_size,1,224,224,224)<br>\nWhat's your train batch size? And What's your GPU type and how many GPUs you have?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1917012": "Is anyone aware of a library that performs data augmentations on 3d volumes, compatible with PyTorch and ideally works on GPU? \n\nDuring training, I'm loading (B,C,D,H,W)=(batch_size,1,224,224,224) tensors and I'd like to apply rotations/flips in the x-y plane that are constant throughout the z dimension. \n\nI guess one way is to apply the same 2d transformation to every slice but would this be slow? Another approach could be to use [scipy.ndimage.rotate](https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.rotate.html) but I'm worried about memory/speed since I think this requires numpy arrays as input.",
    "1917077": "You could check out Kornia: https://kornia.readthedocs.io/en/latest/augmentation.module.html#transforms3d",
    "1917107": "Just what I was looking for, thank you!",
    "1917176": "Here is my recommendation: https://github.com/ZFTurbo/volumentations",
    "1918506": "I would suggest MONAI (https://monai.io) which is developed from medical DL projects, it has plenty of augmentation strategies, not limited to flip/rotate.",
    "1922184": "(B,C,D,H,W)=(batch_size,1,224,224,224)\nWhat's your train batch size? And What's your GPU type and how many GPUs you have?"
  },
  "source": "meta"
}