Page MenuHomePhabricator

mitkDicomSeriesReader improve sorting on tag[0020,0037] (Image Orientation) and tag[0020, 0032] (Image Position)
Closed, ResolvedPublic

Description

We have images where, for some unknown reason (at least, unknown to me), the image orientation tag [0020, 0037] can vary thoughout the volume, possibly due to rounding error.

This causes issues in CreateMoreUniqueSeriesIdentifier, as filenames will be split into multiple groups. These groups are then sorted independently of each other.

Furthermore, in AnalyzeFileForITKImageSeriesReaderSpacingAssumption, the code assumes that images are processed in order. The function calculates the distance between one slice and the next, and compares it with the distance between the first two slices seen. So, if the first two slices are 0 and 1, and the inter-slice distance is about 1.5mm say, but the next slice seen is actually a slice from the other end of the volume, the slice will be rejected, and put in another group.

Event Timeline

I created this branch:

https://github.com/MattClarkson/MITK/commit/1b01013ab8f0a104a060e4eaa4d5048be42e9253

and built the MITK latest, which does split DICOM files into multiple volumes, and then this branch, which (in my mind) correctly assembles the slices.

Please can someone take a look.
It's quite a significant change, so will require some testing.

Matt

Ok, I now looked into your changes and found that you basically cut of some small decimal places when handling image orientation. I think this is perfectly fine and should not cause us problems.

I could not take your changes from
https://github.com/MattClarkson/MITK/commit/1b01013ab8f0a104a060e4eaa4d5048be42e9253, because some of the code already changed, so I put your ideas into a new branch bug-12263-tolerate-minor-orientation-differences

All tests still pass with this change, plus the dataset you provided could be loaded into a single block.

A testcase should be added before closing this ticket.

Test case is now integrated with tests DICOM_Load_diff_orientation and DICOM_Load_diff_orientation_gaps, I modified the ImageOrientation tags in images 110 and 111 of test dataste "TinyCTAbdomen" in MITK-Data repository. All tests still pass when applying the changes of this bugfix here.

[af48b2]: Merge branch 'bug-12263-tolerate-minor-orientation-differences'

Merged commits:

2012-06-21 17:50:00 Daniel Maleike [39cd20]
Tolerate minor differences in image orientation (based changeset by Matt Clarkson)

When comparing image orientations, do not consider the tiniest details
but only the first 5 digits behind the decimal point

[02f9b3]: Merge branch 'bug-12263-tolerate-minor-orientation-differences'

Merged commits:

2012-06-22 16:04:31 Daniel Maleike [49d20b]
COMP: Fix semantic error -- stupid typo