Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 11, 2009 2:13:55 AM(UTC)
Marnix van Kempen

Groups: Registered
Posts: 17


If I use the following code to read the pixel data from the dataset and save the binary data to file, this fails. The element that is returned by the dataSet.FindFirstElement(null, DicomTagType.PixelData, false) call has length Length 4294967295 long
(which is not initialized!). I attached the corresponding dcm file as well.


using (DicomDataSet dataSet = new DicomDataSet())
{
dataSet.Load("C:\\temp\\testdata\\VL\\ETIAM_VLVideoEndoscopic_001.dcm", DicomDataSetLoadFlags.None);

DicomElement element = dataSet.FindFirstElement(null, DicomTagType.SOPInstanceUID, false);
if (element != null && dataSet.GetElementValueCount(element) > 0)
{
string sopInstanceUID = dataSet.GetStringValue(element, 0);
}

element = dataSet.FindFirstElement(null, DicomTagType.PixelData, false);
if (element != null)
{
byte[] pixelData = dataSet.GetBinaryValue(element, (int)element.Length);

FileStream fs = new FileStream("C:\\temp\\testdata\\VL\\test.pix", FileMode.Create, FileAccess.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(pixelData);
bw.Close();
}
}
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, November 11, 2009 5:09:30 AM(UTC)
Marnix van Kempen

Groups: Registered
Posts: 17


more specifically, since I'm dealing with video SOP classes, I'm interested in retrieving the MPEG2 bit stream from the pixeldata. What is the best approach to do this: should I use GetBinaryValue or perhaps something else like dataSet.GetImage?
 
#3 Posted : Wednesday, November 11, 2009 5:51:51 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You are already discussing the same issue in this forum post:
http://support.leadtools.com/SupportPortal/CS/forums/31549/ShowPost.aspx

Please continue in one thread only.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#4 Posted : Wednesday, November 11, 2009 5:55:44 AM(UTC)
Marnix van Kempen

Groups: Registered
Posts: 17


this is definitely a different issue than the one described in:
http://support.leadtools.com/SupportPortal/CS/forums/31549/ShowPost.aspx

please reply
 
#5 Posted : Wednesday, November 11, 2009 6:06:38 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You can't use dataSet.GetImage to retrieve the MPEG video stream. Our Medical toolkit can only open this kind of data set if you use our Multimedia toolkit to parse the MPEG data.

You can find more details about this in the following forum post:
http://support.leadtools.com/SupportPortal/CS/forums/31549/ShowPost.aspx

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.057 seconds.