Page MenuHomePhabricator

Provide DICOM tags as MITK properties of mitk::Image
Closed, ResolvedPublic

Description

When loading an mitk::Image from DICOM, it could be very useful to have DICOM tags available as mitk::Properties.

The most sensible place to initiate this copy is in DicomSeriesReader (implementation could require a separate class, only called from the reader).

Two hints for implementation:

ITK's GDCMImageIO::InternalReadImageInformation() is the place where ImageIO puts DICOM tags into MetaDataDictionary.

Attached patch modifies DicomSeriesReader to just copy all MetaDataDictionary entries into StringProperties.

  • The patch needs cleaning
  • The list of copied dict entries, too
  • Name and value type of tags should be considered
  • (e.g. for developers it would be nice to see the tag name instead of element and group)
  • Whether these are properties of the image or the node is unclear
  • ...?

Event Timeline

The list of pre-sorted file names for ITK ImageSeriesReader should be analyzed. All DICOM tags (at least Image Number and Slice Location should be extracted from each file.

The tag information about each slice should be made available in the PropertyList object of mitk::Image (NOT DataNode)

  • The slice specific tags should be stored in properties "dicom.image.gggg.eeee" (g=group, e=element)
    • the value of each of these tags should be of type mitk::StringLookupTableProperty
      • the lookup maps z slice indices (type unsigned int) to the tag value (string representation)
      • we should limit the list of tags to a selected sub-set of all image specific tags (at least, we should NOT make available series, study, patient information)
  • patient, study, series level can be stored as "dicom.patient.gggg.eeee" etc.

Provided at least the basic interface (with T7285) and add the file names of individual slices as a property

The tag information about each slice should be made available in the
PropertyList object of mitk::Image (NOT DataNode)

Done. Property keys look like "dicom.image.gggg.eeee" (g=group, e=element)
For 4D images the time step will be appended to the key (except for time step 0), e.g. for time step 1: "dicom.image.gggg.eeee.t1"

Implemented method ScanForSliceInformation which uses the gdcm scanner to read tag informations from DICOM files. Currently following tag informations are read form the files: "image position", "slice location", "(image) instance number" and "SOP instance number".

  • patient, study, series level can be stored as "dicom.patient.gggg.eeee" etc.

not yet stored as property

in branch bug-7339-provide-dicom-tags-as-image-property with commit 698ff28801ea28c3aa1ccfdb49cd088ecf378799

(In reply to comment #4)

  • patient, study, series level can be stored as "dicom.patient.gggg.eeee" etc.

not yet stored as property

To finish this ticket, I suggest to not implement this yet, but to open a separate bug, which we can work on when needed.

[0ab668]: Merge branch 'bug-7339-provide-dicom-tags-as-image-property'

Merged commits:

2011-06-29 15:34:36 Danial Bin Mohamed Saruji [5f348e]
Merge branch 'bug-7528-test-dicom-tags-loading-image-properties' into bug-7339-provide-dicom-tags-as-image-property


2011-06-22 15:46:04 Danial Bin Mohamed Saruji [430d70]
enhanced unittest mitkdicomseriesreadertest to test dicom tags
loading from image properties


2011-06-22 15:17:36 Danial Bin Mohamed Saruji [698ff2]
add method to read dicom tags and set as mitk image property

[04d383]: Merge branch 'bug-7339-provide-dicom-tags-as-image-property' (COMP)

Merged commits:

2011-07-04 16:37:23 Danial Bin Mohamed Saruji [58365b]
bugfix: check if dicomtags are available

fehlende Überprüfung ob DICOM tags vorhanden sind hinzugefügt

changes commited and merged in master: removed comments and used variable instead of strings

[94b2d0]: Merge branch 'bug-7339-provide-dicom-tags-as-image-property'

Merged commits:

2011-07-06 15:49:16 Danial Bin Mohamed Saruji [4a92a8]
code cleanup: removed comments and used variable instead of strings

[d40332]: Merge branch 'bug-7339-fix-wrong-dicom-property-retrieve'

Merged commits:

2011-07-13 16:20:41 Johannes Kast [f224d3]
the map of scanner is no longer destroyed

  • removed const_cast

Bitte um Review der Änderungen.

(In reply to comment #15)

Bitte um Review der Änderungen.

Bitte um englische Kommentare :)

Bei der Übergabe der map aus dem "scanner" objekt (->GetMappings()) wurde die Map zwar kopiert aber die Inhalte der Map Schlüssel (char Pointer) wurden gelöscht. In einer Debug Umgebung unter Windows (Inhalte hinter Pointern werden bei Aufruf des destruktors überschrieben) kommt es dann zum Crash beim Zugriff.

Desweitern wurde der const_cast überflüssig gemacht indem auf die map nur lesend zugegriffen wird (kein [] mehr).

Sorry, too late for the last comment...