This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, February 20, 2009 5:56:08 AM(UTC)
Groups: Registered
Posts: 7
how to delete all images from dicom file? i need file with text objects, without images.
thanks.
#2
Posted
:
Saturday, February 21, 2009 11:52:58 PM(UTC)
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)
Groups: Registered
Posts: 7
I use LEAD TOOLS v15 for C#
#4
Posted
:
Tuesday, February 24, 2009 3:13:19 AM(UTC)
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)
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)
Groups: Registered
Posts: 7
Can you explain how to do it?
#7
Posted
:
Wednesday, February 25, 2009 6:57:01 AM(UTC)
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)
Groups: Registered
Posts: 7
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.