DICOM monochrome2 display with bits stored less than allocated bits

I want to display a DICOM file with a photometric interpretation of MONOCHROME2.

some characteristics of the image -

Rows: 1024 Columns: 1024 No of Frames: 622 Bits Allocated: 16 Bits Stored: 10 High Bit: 9 Pixel Representation: 0 Sample per pixel: 1 

I am using gdcmRegionReader to retrieve a byte array of single frames as follows.

  gdcm.ImageRegionReader _regionReader = new gdcm.ImageRegionReader(); _regionReader.SetRegion(_boxRegion); // _boxRegion is some region _regionReader.ReadIntoBuffer(Result, (uint)Result.Length); Marshal.Copy(Result.ToArray(), 0, _imageData.GetScalarPointer(), Result.ToArray().Length); _viewer.SetInput(_imageData); // _viewer = vtkImageViewer 

But when I show this file, it looks like this: MONOCHROME2 dicom when displayed using gdcmRegionReader

but the original image looks like this: Source image

So can someone help me on how to download and display DOMOM MONOCHROME2 images.

+5
source share
2 answers

Disclaimer: I have never used this toolkit. I am trying to answer based on my understanding of DICOM. In my experience with DICOM, syntax has rarely been a problem. The real problem was the concept and terms.

I see two output problems.

One of them concerns part of the image. Please note that integer data is not displayed in your view. Check out the toolkit document to find out how to set dimensions / borders when rendering an image.

Another issue is related to output quality. Initially, I suspected that the transfer syntax might be a problem. I donโ€™t think itโ€™s easy, just make sure that you are uncompromising in your image before rendering. I'm not sure how your toolkit handles compression during rendering.

There is another way to display pixel data in a toolbox.

 _ImageViewer.SetRenderWindow(renderWindow); _ImageViewer.GetRenderer().AddActor2D(sliceStatusActor); _ImageViewer.GetRenderer().AddActor2D(usageTextActor); _ImageViewer.SetSlice(_MinSlice); _ImageViewer.Render(); 

The above code is copied from http://www.vtk.org/Wiki/VTK/Examples/CSharp/IO/ReadDICOMSeries ". Detailed code is available there.

The following links may also be helpful:
http://vtk.1045678.n5.nabble.com/How-to-map-negative-grayscale-to-color-td5737080.html

https://www.codeproject.com/Articles/31581/Displaying-bit-Images-Using-C

+1
source

You really should use vtkGDCMImageReader2 instead in your code. vtkGDCMImageReader2 exactly encapsulate gdcm::RegionReader to associate with VTK.

If for some reason you cannot directly use this class, just copy / paste the C ++ code from the main function into your C # code.

Cm:

+1
source

Source: https://habr.com/ru/post/1268457/


All Articles