imi-bigpicture / wsidicomizer

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

ICC Profile in DICOM conversion #95

Closed FabianHoerst closed 6 months ago

FabianHoerst commented 7 months ago

Hello,

if I use your CLI for converting files into DICOM, the ICC profile is not transferred resulting in the Tags (0028, 2000) not present in the converted DICOM files, even though there is a profile defined in the origin files. Is there a specific flag?

Best, Fabian

erikogabrielsson commented 7 months ago

Hi @FabianHoerst

Injecting icc profile directly from the source file is unfortunately not yet implemented. It can however be done manually Further reading the icc profile from the source file is not supported for all formats (currently only svs).

What format are you trying to convert from? Is it possible to share an example file?

erikogabrielsson commented 7 months ago

In my answer I assumed that you have a file incorporating an icc profile. If that is not the case you can supply a icc_profile by using the --metadata or --default-metadata flags. You would then specify a path to a json containing metadata, for example:

{
    "optical_paths": [
        {
            "icc_profile": "path_to_icc_profile"
        }
    ]
}
erikogabrielsson commented 7 months ago

This branch adds support for taking the icc profile from compatible files. This is currently limited to files read with OpenTile and OpenSlide and primarily for Aperio svs and Ventana.

FabianHoerst commented 7 months ago

Thanks, I will check your branch. Maybe also tiffinfo could be helpful to get the icc-profile?

erikogabrielsson commented 6 months ago

Release 0.13.0 includes the icc-profile from supported source file.