Skip to content

Commit

Permalink
Merge pull request #488 from fedorov/revisit-segment-label
Browse files Browse the repository at this point in the history
ENH: use SegmentDescription to populate SegmentLabel

The new heuristic is: if SegmentLabel is not available, first try SegmentDescription before defaulting to SegmentedPropertyTypeCodeSequence>CodeMeaning
  • Loading branch information
fedorov authored Jan 12, 2024
2 parents 1922a09 + 6c718af commit d865fca
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/examples/seg-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{
"labelID": 1,
"SegmentDescription": "Liver Segmentation",
"SegmentLabel": "Liver",
"SegmentedPropertyCategoryCodeSequence": {
"CodeValue": "85756007",
"CodingSchemeDesignator": "SCT",
Expand Down
3 changes: 3 additions & 0 deletions doc/examples/seg-example_multiple_segments.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{
"labelID": 1,
"SegmentDescription": "Liver Segmentation",
"SegmentLabel": "Liver",
"SegmentedPropertyCategoryCodeSequence": {
"CodeValue": "85756007",
"CodingSchemeDesignator": "SCT",
Expand All @@ -37,6 +38,7 @@
{
"labelID": 2,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Thoracic spine",
"SegmentedPropertyTypeCodeSequence": {
"CodeMeaning": "Thoracic spine",
"CodingSchemeDesignator": "SCT",
Expand All @@ -59,6 +61,7 @@
{
"labelID": 3,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Heart",
"SegmentedPropertyCategoryCodeSequence": {
"CodeMeaning": "Anatomical Structure",
"CodingSchemeDesignator": "SCT",
Expand Down
3 changes: 3 additions & 0 deletions doc/examples/seg-example_multiple_segments_reordered.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{
"labelID": 1,
"SegmentDescription": "Liver Segmentation",
"SegmentLabel": "Liver",
"SegmentedPropertyCategoryCodeSequence": {
"CodeValue": "85756007",
"CodingSchemeDesignator": "SCT",
Expand All @@ -43,6 +44,7 @@
{
"labelID": 2,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Thoracic spine",
"SegmentedPropertyTypeCodeSequence": {
"CodeMeaning": "Thoracic spine",
"CodingSchemeDesignator": "SCT",
Expand All @@ -65,6 +67,7 @@
{
"labelID": 3,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Heart",
"SegmentedPropertyCategoryCodeSequence": {
"CodeMeaning": "Anatomical Structure",
"CodingSchemeDesignator": "SCT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{
"labelID": 1,
"SegmentDescription": "Liver Segmentation",
"SegmentLabel": "Liver",
"SegmentedPropertyCategoryCodeSequence": {
"CodeValue": "85756007",
"CodingSchemeDesignator": "SCT",
Expand All @@ -35,6 +36,7 @@
{
"labelID": 2,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Thoracic spine",
"SegmentedPropertyTypeCodeSequence": {
"CodeMeaning": "Thoracic spine",
"CodingSchemeDesignator": "SCT",
Expand All @@ -55,6 +57,7 @@
{
"labelID": 3,
"SegmentDescription": "Anatomical Structure",
"SegmentLabel": "Heart",
"SegmentedPropertyCategoryCodeSequence": {
"CodeMeaning": "Anatomical Structure",
"CodingSchemeDesignator": "SCT",
Expand Down
3 changes: 3 additions & 0 deletions libsrc/Itk2DicomConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ namespace dcmqi {
if(segmentAttributes->getSegmentLabel().length() > 0){
cout << "Populating segment label to " << segmentAttributes->getSegmentLabel() << endl;
segmentLabel = segmentAttributes->getSegmentLabel().c_str();
} else if(segmentAttributes->getSegmentDescription().length() > 0){
cout << "Populating segment label from SegmentDescription to " << segmentAttributes->getSegmentDescription() << endl;
segmentLabel = segmentAttributes->getSegmentDescription().c_str();
} else
CHECK_COND(typeCode->getCodeMeaning(segmentLabel));

Expand Down

0 comments on commit d865fca

Please sign in to comment.