Squishy refromats on other DICOM viewers

66 views
Skip to first unread message

Logi Vidarsson

unread,
Mar 26, 2019, 10:03:38 AM3/26/19
to dcm4che
Good Morning all

Thanks for a great DICOM viewer.

Ive noticed that if you export reformats to DICOM file, and then load these reformats into a different viewer (say MicroDicom), they often appear somewhat squishy.

It turns out that Weasis uses asymmetric pixel spacing for he reformat, something that no doubt saves on math, but sadly not many DICOM viewers support asymmetric pixel spacing's properly and hence render the Weasis generated reformat using the incorrect smaller pixel spacing dimension.

As luck will have it the ImageProcessor class has a wonderful scale function that can actually provide the needed scaling to generate reformats that have square pixel spacings.

By adding a short scaling spiel just above line 353 in weasis-dicom-viewer2d/src/main/java/org/weasis/dicom/viewer2d/mpr/SeriesBuilder.java

newSeries[i].write(ImageProcessor.scale(newSeries[i].read(), new Dimension(dim.height,dim.width), Imgproc.INTER_LINEAR)); // provide interpolation such that pixel dimension can be square
newSeries[i].write(ImageProcessor.getRotatedImage(newSeries[i].read(), Core.ROTATE_90_CLOCKWISE));

You need to tweak a few other things in the SeriesBuilder.java file, (see attached SeriesBuilder.java file from Weasis 3.0.2;) to get this working. But Ive been able to successfully export reformats and use them in other DICOM software with this change.

Hope it proves useful to you all.

Logi


SeriesBuilder.java

Nicolas Roduit

unread,
Apr 8, 2019, 5:50:33 AM4/8/19
to dcm4che
I understand the intention and its practical side but unfortunately Weasis cannot create new pixel values without having the raw acquisition data.

I cannot incorporate this change for several reasons:
  • the interpolation of the zoom will create new pixel values. How to ensure the consistency of these new values with modality/VOI/PR LUTs? Currently, LUTs are applied before zooming, doing the opposite could lead to artifacts.
  • Weasis is a viewer, not an image editor.
  • the reconstructed images are primarily used by the MPR. The export keeps only the original pixels while applying a pixel ratio (displaying non-square pixels is part of the DICOM standard)
Reply all
Reply to author
Forward
0 new messages