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 : Friday, February 20, 2009 5:56:08 AM(UTC)

trong  
trong

Groups: Registered
Posts: 7


how to delete all images from dicom file? i need file with text objects, without images.

thanks.
 

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 : Saturday, February 21, 2009 11:52:58 PM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

You can do that by finding the element that contains the Pixel Data in the Dicom DataSet and deleting it. The details depends on the version of LEADTOOLS you are using and the LEADTOOLS programming interface (C DLL, C++ Class library, .NET, etc.).
 
#3 Posted : Monday, February 23, 2009 10:40:40 PM(UTC)

trong  
trong

Groups: Registered
Posts: 7


I use LEAD TOOLS v15 for C#
 
#4 Posted : Tuesday, February 24, 2009 3:13:19 AM(UTC)

trong  
trong

Groups: Registered
Posts: 7


I get error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
<br>
using (DicomDataSet dicomDIR = new DicomDataSet())
{
try
{
dicomDIR.Load(FullPath, DicomDataSetLoadFlags.LoadAndClose);

DicomElement pixelDataElement1 = dicomDIR.FindFirstElement(null, DicomTagType.PixelData, true);
int imgCount = dicomDIR.GetImageCount(pixelDataElement1);
dicomDIR.DeleteImage(pixelDataElement1, 0, imgCount);
pixelDataElement1 = dicomDIR.FindFirstElement(null, DicomTagType.PixelData, true);

pixelDataElement1 = dicomDIR.FindNextElement(pixelDataElement1, true);
while (pixelDataElement1 != null)
{
imgCount = dicomDIR.GetImageCount(pixelDataElement1);
dicomDIR.DeleteImage(pixelDataElement1, 0, imgCount);
pixelDataElement1 = dicomDIR.FindFirstElement(null, DicomTagType.PixelData, true);
}

dicomDIR.Save(FullPath + "_", DicomDataSetSaveFlags.None);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

 
#5 Posted : Tuesday, February 24, 2009 6:13:46 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

Use the DeleteElement Method.
 
#6 Posted : Tuesday, February 24, 2009 7:10:49 PM(UTC)

trong  
trong

Groups: Registered
Posts: 7


Can you explain how to do it?
 
#7 Posted : Wednesday, February 25, 2009 6:57:01 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

What you need to use is call the DeleteElement Method instead of dicomDIR.DeleteImage(). This way you can delete the element that contains the pixel data instead of deleting the images one after another, you can remove them at once.

You can find sample code that uses this method on this page:
http://www.leadtools.com/help/leadtools/v15/dh/di/Leadtools.Dicom~Leadtools.Dicom.DicomDataSet~Load(String,DicomDataSetLoadFlags).html
 
#8 Posted : Wednesday, February 25, 2009 8:52:11 PM(UTC)

trong  
trong

Groups: Registered
Posts: 7


thanks a lot :)
 
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.104 seconds.