My test project is attached for your reference with dicom image I am using and the lead tools dll I am referencing in my application.Įxpect your advice on the two issues mentioned above. This is often an indication that other memory is corrupt." error.Īt .!DicomDataSet()Īt (Boolean )Īt () You should get "Attempted to read or write protected memory. Click ok and click on Convert button 5-6 times (repeat the steps b and c 5-6 times).
![convert j2k convert j2k](https://pic.anxz.com/d/file/20200104/31d7c411a14e7378f0c40f80d0ab234c.png)
One dicom image is already placed in attachment at root path with name OverlayTag.dic.ī) Click the "Convert" button to convert dicom image to j2k.Ĭ) Message box will be displayed saying image converted successfully. You can reproduce second issue by following following steps with my test application attached: -Ī) Open application and select dicom image with dicom overlay. This solution is working so far but there are two problems as bellow: -Ģ) Application crashes on clicking exit button. I have modified my test application to make overlay burn on image using AddCommand before converting it to j2k.
CONVERT J2K CODE
The input bit depth is any (unpredictable) and output bit depth should be 24 as shown in my code snippet earlier. Please guide me how could I achieve this.
![convert j2k convert j2k](https://5.imimg.com/data5/EL/MI/MY-5115919/mpeg2-dcp-conversion-500x500.png)
ObjRasterCodecs.Save(objRasterImageInput, j2kFilePath, RasterImageFormat.J2k, 24) TargetFileSize = targetFileSize * 1024 //KB to Bytes CompressionControl = CodecsJpeg2000CompressionControl.TargetSize | DicomGetImageFlags.AutoApplyModalityLut ObjRasterImageInput = objLTDicomDataSet.GetImage(objLTDicomElement, 0, 0, byteOrder, ObjLTDicomElement = objLTDicomDataSet.FindFirstElement(null, DicomTag.PixelData, true) ĭicomImageInformation objDicomImageInformation = objLTDicomDataSet.GetImageInformation(objLTDicomElement, 0) ObjLTDicomDataSet.Load(dicFilePath, DicomDataSetLoadFlags.None) The solution should work for both overlay data in dicom tags and embedded in pixel data.ĭicomDataSet objLTDicomDataSet = new DicomDataSet() I want overlay data to be present on output j2k image.
When I convert dicom image with dicom overlay data to j2k, it converts fine but overlay data on output j2k is missing. My problem is with dicom images with dicom overlay data. My application converts dicom images to j2k. I am using lead tools 16.5 with C#.NET Framework 2.0.