Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DICOM: be more lenient with slice timing vector in Siemens mosaics #1499

Merged
merged 3 commits into from Nov 27, 2018

Conversation

jdtournier
Copy link
Member

There are examples now of Siemens mosaics where the number of entries in the CSA NumberOfImagesInMosaic entry reports a large size than the number of slices - leading to the whole entry being ignored - yet the last few entries are empty. This change allows for this situation, by taking as many entries as there are slices, and ignoring the last few entries.

@bjeurissen
Copy link
Member

Looks good! Thanks for fixing this! Can't approve because the mrpad test fails, but this appears unrelated to the pull request..

@thijsdhollander
Copy link
Contributor

thijsdhollander commented Nov 24, 2018

Seemed to be only one of the Travis CI jobs that failed (not sure if that's mrpad specific..?). Well, in any case, I restarted the job; let's see what happens.

@Lestropie
Copy link
Member

When the number of entries is greater than the number of slices, are the additional entries zero-filled? Is the number of excess entries somehow related to the null space in the mosaic storage? This change will accept such data, but it would also conceivably accept invalid or corrupt data if such could be generated. Depends on if you want to go to the effort of better sanity checking.

@jdtournier
Copy link
Member Author

When the number of entries is greater than the number of slices, are the additional entries zero-filled?

Not even. They're literally empty, as far as I can tell...

Is the number of excess entries somehow related to the null space in the mosaic storage?

Assuming I've understood this right, not even. In the example we have, the CSA entry reports 78 entries when there are 75 slices. The last 3 elements in the list are empty. But I'd expect the mosaic to be 9×9=81, right?

This change will accept such data, but it would also conceivably accept invalid or corrupt data if such could be generated. Depends on if you want to go to the effort of better sanity checking.

Yes, we could sanity-check this more thoroughly, but I'm not sure it's a worthwhile investment. Unfortunately we don't know what assumptions we can rely on regarding this stuff given how proprietary it is, but I also expect Siemens to eventually move away from it in favour of multi-frame (hopefully...?)

@thijsdhollander
Copy link
Contributor

Looks good! Thanks for fixing this! Can't approve because the mrpad test fails, but this appears unrelated to the pull request..

Seemed to be only one of the Travis CI jobs that failed (not sure if that's mrpad specific..?). Well, in any case, I restarted the job; let's see what happens.

I didn't look decently into the logs when I said this; something else seems to indeed be going on... but my brain doesn't seem to be awake enough to deal with it. (a convoluted way of saying "I'm confused")
For some reason some mrpad tests keep failing. It doesn't seem to be the kind of mistake we sometimes ran into in the past (related to not properly branching the test repo and such)... I'm probably overlooking some kind of trivial explanation, but after staring at it for a bit, I'm not getting enlightened. Anyone else got an explanation? The same happens for #1498 ... which is mildly annoying, as I'm trying to get it on master so some other people don't lose their sanity. 😬

There are examples now of Siemens mosaics where the number of entries in
the CSA NumberOfImagesInMosaic entry reports a large size than the
number of slices - leading to the whole entry being ignored - yet the
last few entries are empty. This change allows for this situation, by
taking as many entries as there are slices, and ignoring the last few
entries.
@jdtournier jdtournier force-pushed the dicom_fix_slice_timing_mismatch_in_mosaic branch from 931f39e to 8253ee2 Compare November 26, 2018 11:14
@jdtournier jdtournier force-pushed the dicom_fix_slice_timing_mismatch_in_mosaic branch from 8253ee2 to 17af358 Compare November 26, 2018 11:30
@jdtournier
Copy link
Member Author

OK, I cleaned this up by re-committing the relevant changes without changing the test_data commit... Requires a forced-pushed, but hopefully it'll make for a cleaner history...

@jdtournier
Copy link
Member Author

In case anyone's wondering: remaining issues relate to the new version of pylint. Fixes are in #1504. I'll wait until I get confirmation that they're OK from @Lestropie, and once merged to master, we can bring these changes into this PR (and #1498).

@Lestropie Lestropie changed the title DICOM: be more lenient with slice timing vector is Siemens mosaics DICOM: be more lenient with slice timing vector in Siemens mosaics Nov 27, 2018
Copy link
Member

@Lestropie Lestropie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be the only option that will be compatible with "valid" data; more stringent checks are not possible.

Copy link
Contributor

@thijsdhollander thijsdhollander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree.

@thijsdhollander thijsdhollander merged commit 9c3de06 into master Nov 27, 2018
@thijsdhollander thijsdhollander deleted the dicom_fix_slice_timing_mismatch_in_mosaic branch November 27, 2018 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants