Page MenuHomePhabricator

Add possibility to define DICOM-tags that shall be stored in the properties of the mitk::Image
Closed, ResolvedPublic

Description

The 'new' DICOM-Reader currently stores the content of a set of DICOM-tags in the mitk::Image using the mitk properties.
In the current implementation, this set is hard-coded and cannot be altered or extended.

A feature-request has come up, that there should be a possibility to specify which DICOM-tags shall be stored in the mitk::Image.

Event Timeline

User engelm has pushed new remote branch:

bug-19452-specify-DICOM-tags-in-image

I have developed and pushed an initial version of the changes.

It is now possible to set a list of DICOM-tags of interest on the DICOMFileReader. The content of these tags will then be read from the files and stored on the resulting MITK-Image using the properties.

Right now, the tags are stored for each DICOM-file where the different values are stored in a StringLookupTableProperty.

Further improvements could be to check if all files have identical values and only store one in the properties. Another possibility would be to explicitly define if the tags of intereset shall be stored per-file or the range (for fist and last slice) or one value for the whole image.

Have you had any time to take a look at the code?

Hi Markus,

please excuse the delay. Yes I had a look. Think it is fine and does the trick for us.

I think the mentioned improvments are also a good idea and would be usefull.

I would propose the following design: In addition to SetAdditionalTagsOfInterest, you may define a conversion strategy (default can be the current StringLookUpPropertyApproach. as a global strategy or for specific tags?). It is basically a functor that you can define and which takes the value list and returns the property that should stored. This could be used in the DICOMImageBlockDescriptor instat of the hard coded

const_cast<DICOMImageBlockDescriptor*>( this )->SetProperty( key, StringLookupTableProperty::New( value ) );

For the beginning I think conversion to complete list (current strategy) and "condense to on StringProperty of everything is the same" would be enough.

What do you think?

Hi Ralf,

I have extended the necessary classes with methods to specify a functor that is given an mitk::StringLookupTable (basically std::map<int, std::string>) that maps the value (string) to a slice (int) for a specific DICOM-tag.

The functor can store this information in any mitk Property and return a mitk::BaseProperty::Pointer.

This functor will be used to create a property for each DICOM tag that has added as tag-of-interest.

The default implementation is to store the values in a StringLookupTableProperty unless all values are identical.
In this case, the unique value will be stored in a single StringLookupTable.

I have extended the unittest to check the behaviour. So, the test also contains example-code on how to specify the functor (can be a lambda expression or a function-pointer to a static member-function).

Sweet. I have looked into the code. The implementation is where close to what I have thought of. Only better, because I hadn't spent time on it :). Thank you very much.

From my point of view with this bug solution, every thing is there to now finisch the dicom infrastructure rework and deprecate the old DICOMSeriesReader for good.

[bbbc10]: Merge branch 'bug-19452-specify-DICOM-tags-in-image'

Merged commits:

2015-12-10 14:22:35 Markus Engel [6b8bf0]
updated documentation and removed unnecessary method


2015-12-10 14:21:04 Markus Engel [87417d]
extended unittest


2015-12-10 14:12:43 Markus Engel [0635e2]
added setter and getter for TagLookupTableToPropertyFunctor in reader-classes


2015-12-10 14:11:23 Markus Engel [f6635e]
added possibility to set functor that creates a Property from the StringLookupTable


2015-11-30 15:27:40 Markus Engel [b3642b]
extended mitkDICOMITKSeriesGDCMReaderBasicsTest to check for additional DICOM tags


2015-11-30 15:27:16 Markus Engel [173eac]
extended DICOMReader to consider list of additional DICOM-Tags of interest


2015-11-30 15:26:45 Markus Engel [e2b6b3]
extended DICOMImageBlockDescriptor to cosider list of additional DICOM tags of interest


2015-11-30 15:25:15 Markus Engel [93da07]
improved const-correctness in DICOMReader-Modul

[9d855c]: COMP: Merge branch 'bug-19452-specify-DICOM-tags-in-image'

Merged commits:

2015-12-14 08:26:39 Markus Engel [937017]
using std::make_pair instead of initializer-list to be compatible to vs2012