Skip to content

Refactor itkimage2dcmSegmentation and itkimage2paramap to support "in memory" DCM sources. #390

Open
@rfloca

Description

@rfloca

Status:
Currently the interfaces of Itkimage2dcmSegmentation and itkimage2paramap build up a dependency to DcmDataset as you pass a vector of DcmDataset* representing the dicom source images.

Proposal:
As far as I can see in the implementation of dcmqi only parts of the class interface is used that is directly inherited from DcmItem.
If this is correct and I am not mistaken this would mean that you could easily switch to the following signatures:

   static DcmDataset* itkimage2dcmSegmentation(vector<DcmItem*> dcmSourceItems,
                                               vector<ShortImageType::Pointer> segmentations,
                                               const string &metaData,
                                               bool skipEmptySlices=true);

   static DcmDataset* itkimage2paramap(const FloatImageType::Pointer &parametricMapImage, vector<DcmItem*> dcmSourceItems,
                                       const string &metaData);

It would not break existing code, but ensures the possibility to use the methods, when you have no dcm files but all informations you need. As it is e.g. in some of our use cases, where we have the values of the dcm tags at hand but not the original files. The change in the function signature would gurantee that one can directly populate DcmItems in memory and pass them instead of trying to get the files or "simulate" them by hacking temporary files with the needed information; because nothing DcmDataset-specific is used.

Have I missed something? What do you think.

If the change proposal is supported and there is reasoning against it, we could also provide a patch sooner then later, because it would ensure that we do not implement against implementation details that might change.

Looking forward to read your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions