MHubAI / mhubio

Stores the MHub engine.
2 stars 3 forks source link

Fix mapping to SCT code for liver tumor #1

Closed fedorov closed 1 year ago

fedorov commented 1 year ago

As I understand it, this file https://github.com/MHubAI/mhubio/blob/main/mhubio/utils/ymldicomseg/data/segmentations.csv is responsible for mapping "shortcut" references to the codes that are then used to inialize dcmqi JSON configuration.

Mapping of the tumor is quite different from mapping anatomic structures, since it has to be done using two components. The "kind of thing" segmented is encoded in SegmentedCategory/Type, and the "location of the thing" is encoded in AnatomicRegionSequence, like in the below:

        "AnatomicRegionSequence": {
          "CodeValue": "10200004",
          "CodingSchemeDesignator": "SCT",
          "CodeMeaning": "Liver"
        },
        "SegmentedPropertyCategoryCodeSequence": {
          "CodeValue": "49755003",
          "CodingSchemeDesignator": "SCT",
          "CodeMeaning": "Morphologically Altered Structure"
        },
        "SegmentedPropertyTypeCodeSequence": {
          "CodeValue": "108369006",
          "CodingSchemeDesignator": "SCT",
          "CodeMeaning": "Neoplasm"
        }

From what I see, this does not seem to fit the constraints of the aforementioned file, but we need to fix it. The current code used to encode liver tumor does not follow the (understandably, difficult to parse) conventions of the standard, and in fact code 86049000 currently used in https://github.com/MHubAI/mhubio/blob/main/mhubio/utils/ymldicomseg/data/segmentations.csv#L106 does not appear to be a valid SCT code.

LennyN95 commented 1 year ago

Resolved in commit 66cf008d.

The old ymldicomseg utility has been replaced with the new segdb library, adding support for embedded structures using the + notation.