Friday, February 10, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: Chivan
New Today New Today: 3
New Yesterday New Yesterday: 27
User Count Overall: 20593

People Online People Online:
Visitors Visitors: 12
Members Members: 4
Total Total: 16

Online Now Online Now:
01: ctoremis
02: richteh
03: 孙磊
04: vposhataev

ClearCanvas Community Forums

How to create a dcm file with compressed pixel data?
Last Post 2010-07-12 11:28 AM by stewart. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
freeann
New Member
New Member
Posts:4

--
2010-06-23 08:22 PM  

Thanks at first.

I want to create a dcm file with compressed pixel data. That is ,when i have native original pixel data,how to compress them into compressed ones and add them into a dcm file?

 

 

 

freeann
New Member
New Member
Posts:4

--
2010-06-24 01:24 AM  
I tried to use the following code :
byte[] pixelArray = new byte[length];

for (uint i = 0; i < length; i += 2)
pixelArray = (byte)(i % 255);

pixels.Values = pixelArray;

theSet[DicomTags.PixelData] = pixels;

DicomUncompressedPixelData pd = new DicomUncompressedPixelData(theSet);
MessageBox.Show(pd.UncompressedFrameSize.ToString()); //131072

DicomCompressedPixelData cpd = new DicomCompressedPixelData(pd);

DicomJpegParameters parms = new DicomJpegParameters();
parms.Quality = 70;
parms.ConvertColorspaceToRGB = true;

IDicomCodec codec = DicomCodecRegistry.GetCodec(TransferSyntax.JpegBaselineProcess1);
codec.Encode(pd, cpd, parms);

but the program threw an error like this: The type initializer for 'ClearCanvas.Dicom.Codec.DicomCodecRegistry' threw an exception.

What's wrong?

Any help would be appreciated.
stewart
Senior Member
Senior Member
Posts:2033

--
2010-07-12 11:28 AM  
Is there any more exception detail in the logs?
Real-time support available to Clinical Edition and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.