imi-bigpicture / wsidicomizer

Python library for converting WSI files to DICOM
Apache License 2.0
54 stars 7 forks source link

JSON-Documentation request #100

Closed FabianHoerst closed 3 months ago

FabianHoerst commented 5 months ago

Hello,

I have a request regarding the documentation of additional metadata that can be added via a json file. Would it be possible to create a json file with all fields and the documentation of them? This would be really beneficial in finding the information at one place? I have problems in adding some of the metadata, e.g, for selecting objective-> objective_power

Thanks in advance and thanks for this great repo! I appreciate your work in this area!

erikogabrielsson commented 5 months ago

Hi @FabianHoerst,

Yes, the json-metadata format is unfortunately not yet documented. Until it is, the easiest way to get a find how to encode certain metadata might be to create it in python and then dump it to json?

from wsidicomizer.metadata import WsiDicomizerMetadata
from wsidicom.metadata import OpticalPath, Objectives
from wsidicom.metadata.schema.json import WsiMetadataJsonSchema
metadata = WsiDicomizerMetadata(
    optical_paths=[
        OpticalPath(objective=Objectives(objective_power=20))
    ]
)
schema = WsiMetadataJsonSchema()
schema.dump(metadata)
FabianHoerst commented 3 months ago

Sorry for the delay, thanks for providing this!