DigitalSlideArchive / girder_volview

Other
2 stars 2 forks source link

feat(dicom): add DICOM tags to Item metadata #33

Closed PaulHax closed 2 months ago

PaulHax commented 3 months ago

Add .large_image_config.yaml example to README showing how to setup the columns for DICOM tag metadata.

image

Only load greenlisted file extension in VolView.

closes #32

manthey commented 3 months ago

I think the only issue I see is that this works for uploads but not imports. The data.process event is fired during the end of the upload process. But imports go a different route; in large_image, we bind to the model.file.save.after event.

PaulHax commented 3 months ago

But imports go a different route;

Thats a biggie. Thanks for checking, I will fix.

PaulHax commented 3 months ago

Adding handler that gets triggered on assetstore import now: events.bind("model.file.save.after", "girder_volview", handleFileSave)

manthey commented 3 months ago

This works, but I recommend excluding values that are empty strings or binary data. For instance, one of my files has (amongst other data):

    "AccessionNumber": "",
    "PatientBirthDate": "",
    "PatientID": "",
    "PatientName": "b''",
    "PatientSex": "",
    "ReferringPhysicianName": "b''",
    "StudyDate": "",
    "StudyID": "",
    "StudyTime": "",

We might also want to exclude any values that are particularly large.

PaulHax commented 3 months ago

Added skipping empty strings/bytes and limiting values in _coerceMetadata() with this:

        if tagValue == "" or tagValue == b"":
            continue
        if sys.getsizeof(tagValue) > MAX_TAG_SIZE:
            continue
manthey commented 3 months ago

This all seems to be working on my system.

PaulHax commented 2 months ago

This all seems to be working on my system.

Thank you for your help!!