Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?
Started by bcoleman at 06-26-2008 14:59. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  06-26-2008, 14:59
bcoleman is not online. Last active: 6/5/2008 6:58:02 PM bcoleman

Not Ranked
Joined on 02-14-2008
Posts 5
UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?
Reply Quote
I'm still working on this program to change a DICOM file to a compressed version.  It's fairly simple:

if (DicomDS.LoadDS(args[0], 0) == 0) {
    if (DicomDS.ChangeTransferSyntax(UID_JPEG2000, QFactor, 0) == 0) {
        if (DicomDS.SaveDS(args[1], 0) == 0) {
            return 0;
        } else {
             return 2;
        }
    } else {
        return 3;
    }
} else {
    return 4;
}

This works, but the resulting DICOM file does't seem to load into standard DICOM viewers like MEDISP.  Figuring that it's possible that MEDISP won't handle JPEG2000, I changed the UID to UID_JPEG_BASELINE_1.  This resulted in a run-time error:

C:\ADProj\Merlin\newapps\DicomCompress\bin\Release>DicomCompress.exe AAE017.UZ0
AAE017.UZ0.new 10
Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A4E29): L
EAD Error: Invalid parmameter passed.
   at LTDICLib.ILEADDicomDS.ChangeTransferSyntax(String bstrUID, Int16 nQFactor,
 Int16 nFlags)
   at DicomCompress.Program.Main(String[] args)

I get the same thing with UID_JPEG_EXTENDED_2_4.  Both of these are documented as being valid for ChangeTransferSyntax.  I pulled the constant values from the UID.cs file in the examples, and visually checked them against the documentation, so I don't think the problem is having the constant wrong.


I'm also wondering what could be causing the problem where the output file won't load into MEDISP.  I also tried creating the output with UID_RLE_LOSSLESS, and the resulting file won't load into MEDISP.  It's not like I'm fiddling with elements in the above code., so I'm puzzled why I should have this kind of problems with the output.

   Report 
  06-26-2008, 15:35
jigar is not online. Last active: 7/24/2008 12:12:53 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 356
Re: UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?
Reply Quote
I have a few questions to understand what is going on.

1. What is the value of UID_JPEG_BASELINE_1 and UID_JPEG_EXTENDED_2_4?
2. What is the value of QFactor?
3. What version of the toolkit do you have?

Try passing ChangeTransferSyntaxFlag.None for the last parameter.

LEADTOOLS Technical Support
   Report 
  06-26-2008, 17:23
bcoleman is not online. Last active: 6/5/2008 6:58:02 PM bcoleman

Not Ranked
Joined on 02-14-2008
Posts 5
Re: UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?
Reply Quote
 jigar wrote:
I have a few questions to understand what is going on.

1. What is the value of UID_JPEG_BASELINE_1 and UID_JPEG_EXTENDED_2_4?


UID_JPEG_BASELINE_1 is "1.2.840.10008.1.2.4.50"
UID_JPEG_EXTENDED_2_4 is "1.2.840.10008.1.2.4.51"

Both of these are from the documentation and from the UID.cs file in the examples


2. What is the value of QFactor?

QFactor is anywhere from 2 to 255.  I've been testing using 10.


3. What version of the toolkit do you have?

Version 14.5

Try passing ChangeTransferSyntaxFlag.None for the last parameter.


What library is that in?
   Report 
  06-27-2008, 16:03
jigar is not online. Last active: 7/24/2008 12:12:53 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 356
Re: UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?
Reply Quote
Ok, this is what I found out.  UID_JPEG_BASELINE_1 is for 8bit grayscale and 24bit color images only.  UID_JPEG_EXTENDED_2_4 is for 12bit grayscale only.  If you have anything else, such as a 16bit image, the function will return invalid parameter.  According to the 2008 DICOM standard you can use some other compression from the table below.  You will probably want to contact your other software manufacturer on why it won't read JPEG2000 compressed DICOMs.  JPEG2000 has been a standard for quite a while.

 Transfer syntax

Value




Supported bit depth and color formats

UID_IMPLICIT_VR_LITTLE_ENDIAN

1.2.840.10008.1.2




All including palette color

UID_EXPLICIT_VR_LITTLE_ENDIAN

1.2.840.10008.1.2.1




All including palette color

UID_EXPLICIT_VR_BIG_ENDIAN

1.2.840.10008.1.2.2




All including palette color

UID_JPEG_BASELINE_1

1.2.840.10008.1.2.4.50




8-bit grayscale and 24-bit color (lossy compression)

UID_JPEG_EXTENDED_2_4

1.2.840.10008.1.2.4.51




12 bit grayscale only (lossy compression)

UID_JPEG_LOSSLESS_NONHIER_14

1.2.840.10008.1.2.4.57




All (lossless compression) but not palette color

UID_JPEG_LOSSLESS_NONHIER_14B

1.2.840.10008.1.2.4.70




All (lossless compression) but not palette color

UID_JPEG2000_LOSSLESS_ONLY

1.2.840.10008.1.2.4.90




All (lossless compression) but not palette color

UID_JPEG2000

1.2.840.10008.1.2.4.91




All (lossy compression) but not palette color

UID_RLE_LOSSLESS

1.2.840.10008.1.2.5




All including palette color

Deflated Explicit VR Little Endian

1.2.840.10008.1.2.1.99




Not supported by LEADTOOLS

JPEG-LS Lossless Image Compression

1.2.840.10008.1.2.4.80




Not supported by LEADTOOLS

JPEG-LS Lossy (Near-Lossless)Image Compression

1.2.840.10008.1.2.4.81




Not supported by LEADTOOLS

JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)

1.2.840.10008.1.2.4.92




Not supported by LEADTOOLS

JPEG 2000 Part 2 Multi-component Image Compression

1.2.840.10008.1.2.4.93




Not supported by LEADTOOLS

JPIP Referenced

1.2.840.10008.1.2.4.94




Implementation Specific and supported using web service (i.e. WADO implementation)

JPIP Referenced Deflate

1.2.840.10008.1.2.4.95




Not supported by LEADTOOLS

MPEG2 Main Profile @ Main Level

1.2.840.10008.1.2.4.100




Supported for 24 bit color (not supported by change transfer syntax)



LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » DICOM/Medical I... » Re: UID_JPEG_BASELINE_1 not a valid parameter for ChangeTransferSyntax?

Powered by Community Server, by Telligent Systems