Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IExtraMetadataWriter.setExtraMetadata(...) to accept an Object #4243

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

melissalinkert
Copy link
Member

If an ITagProvider is passed to this method when called on DicomWriter, the ITagProvider is directly added to the tag provider list. If a String is passed instead, then it is assumed to be a path to a file that can be parsed by DicomJSONProvider (as before).

Drafting for consideration in 8.0.0. @ebremer, is this sufficient to cover what you had in mind for #4169? If not, concrete suggestions and/or a more complete description of the use case that needs to be considered would be very helpful.

Any writers that implement IExtraMetadataWriter in the future then have flexibility in what they accept in setExtraMetadata(...). I don't know if this ends up being too flexible though.

I did test briefly with this and still got the expected output file contents:

$ cat hierarchy-test.json 
{
   "BodyPartExamined": {
     "Value": "BRAIN",
     "VR": "CS",
     "Tag": "(0018,0015)"
   },
   "SpecimenLabelInImage": {
      "Value": "NO",
      "VR": "CS",
      "Tag": "(0048,0010)",
      "ReplacementStrategy": "IGNORE"
   },
   "ContributingEquipmentSequence": {
     "VR": "SQ",
     "Tag": "(0018,a001)",
     "Sequence": {
       "Manufacturer": {
         "Value": "PixelMed",
         "VR": "LO",
         "Tag": "(0008,0070)"
       },
       "ContributionDateTime": {
         "Value": "20210710234601.105+0000",
         "VR": "DT",
         "Tag": "(0018,a002)"
       }
     }
   },
   "OpticalPathSequence": {
    "VR": "SQ",
    "Tag": "(0048,0105)",
    "Sequence": {
      "IlluminationTypeCodeSequence": {
        "VR": "SQ",
        "Tag": "(0022,0016)",
        "Sequence": {
          "CodeValue": {
            "VR": "SH",
            "Tag": "(0008,0100)",
            "Value": "111743"
          },
          "CodingSchemeDesignator": {
            "VR": "SH",
            "Tag": "(0008,0102)",
            "Value": "DCM"
          },
          "CodeMeaning": {
            "VR": "LO",
            "Tag": "(0008,0104)",
            "Value": "Epifluorescence illumination"
          }
        }
      },
      "IlluminationWaveLength": {
        "VR": "FL",
        "Tag": "(0022,0055)",
        "Value": "488.0"
      },
      "OpticalPathIdentifier": {
        "VR": "SH",
        "Tag": "(0048,0106)",
        "Value": "1"
      },
      "OpticalPathDescription": {
        "VR": "ST",
        "Tag": "(0048,0107)",
        "Value": "replacement channel"
      }
    },
    "ResolutionStrategy": "REPLACE"
   }
}
$ bfconvert -no-upgrade test.fake wednesday-test.dcm -extra-metadata hierarchy-test.json

If an ITagProvider is passed to this method when called on DicomWriter,
the ITagProvider is directly added to the tag provider list.
If a String is passed instead, then it is assumed to be a path to
a file that can be parsed by DicomJSONProvider (as before).

See ome#4169.
@melissalinkert melissalinkert modified the milestones: 8.0.0, 9.0.0 Sep 25, 2024
@ebremer
Copy link

ebremer commented Sep 30, 2024

It looks good @melissalinkert ! It will allow me to create my own ITagProvider(s). Specifically, one that takes an Apache Jena Model as a constructor parameter. :-)

@melissalinkert melissalinkert marked this pull request as ready for review September 30, 2024 20:26
@melissalinkert melissalinkert modified the milestones: 9.0.0, 8.0.0 Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants