LEADTOOLS Support
Medical
Medical SDK Questions
please help my error in "create DicomDir files from Dicom files"
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, September 10, 2009 10:49:19 PM(UTC)
Groups: Registered
Posts: 8
hi ..
please help me ..
im using leadtools 16.5
and vb.net 2008
i want to make a dicom dir
this is my code :
Dim dicomDir As DicomDir = New DicomDir(Nothing, Nothing)
Dim autoSearch As Boolean = False
dicomDir.Reset("C:\Documents and Settings\adhieto\My Documents\data TA PACS\dir")
dicomDir.SetFileSetId("12345")
Dim options As DicomDirOptions = dicomDir.Options
dicomDir.ResetOptions()
options.IncludeSubfolders = True
options.InsertIconImageSequence = False
options.RejectInvalidFileId = False
dicomDir.Options = options
dicomDir.SetDescriptorFile("C:\Documents and Settings\adhieto\My Documents\data TA PACS\dir\readme.txt", Nothing)
dicomDir.InsertFile(Nothing)
If autoSearch Then
dicomDir.InsertFile(Nothing)
Else
Dim ds As DicomDataSet = New DicomDataSet()
ds.Load("C:\Documents and Settings\adhieto\My Documents\data TA PACS\IMAGES\CR-1_2_840_113564_3_1_2_192_168_0_23_20080922152656967560-1_2_840_113564_10_1_3397779031915417408133231941556217719210-1_2_840_113564_10_1_952203871478919990143131203149391388437.dcm", DicomDataSetLoadFlags.None)
dicomDir.InsertDataSet(ds, "C:\Documents and Settings\adhieto\My Documents\data TA PACS\IMAGES\CR-1_2_840_113564_3_1_2_192_168_0_23_20080922152656967560-1_2_840_113564_10_1_3397779031915417408133231941556217719210-1_2_840_113564_10_1_952203871478919990143131203149391388437.dcm")
dicomDir.InsertFile("C:\Documents and Settings\adhieto\My Documents\data TA PACS\IMAGES\CR-1_2_840_113564_3_1_2_192_168_0_23_20090412141944717270-1_2_840_113564_10_1_24921693313121185021681612155635252237-1_2_840_113564_10_1_19289127292710920243184841685720247228254.dcm.dcm")
dicomDir.InsertFile("C:\Documents and Settings\adhieto\My Documents\data TA PACS\IMAGES\CR-1_2_840_113564_3_1_2_192_168_0_23_20080922152656967560-1_2_840_113564_10_1_2966777473169071800517921925455122240123-1_2_840_113564_10_1_7711929920428170791381381122311616316732.dcm.dcm")
End If
dicomDir.Save()
and the message error .. :
The file doesn’t reside in the destination folder of the DICOMDIR File or in a subfolder of it, or the file doesn’t exist.
what wrong guys ??
thnkz before
#2
Posted
:
Friday, September 11, 2009 6:39:51 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
What is the file version of Leadtools.dll that you are using?
Which function is throwing the error?
Does the same problem occur with our DicomDirectory demo that ships with the SDK (Examples\DotNet\VB\DicomDirectoryDemo)?
The file names are very large (254 characters). Perhaps you are hitting some kind of filename limit. What happens if you rename the files? Technically we'll allow you to use invalid file IDs like this (RejectInvalidFileId = false), but to correctly adhere to the Dicom specifications, you have to follow strict rules for the file ids of the Dicom directory. For more details, please read the Dicom specifications part 3, Annex F (specifically the Referenced File ID tag). For conformance, I would strongly suggest that you follow those rules when creating a DICOMDIR.
#3
Posted
:
Sunday, September 13, 2009 10:37:05 PM(UTC)
Groups: Registered
Posts: 8
i am use leadtools 16.5 eval Mr..
I put the reset code
this is my new code :
Sub makeDicomDir()
Dim dicomDir As DicomDir = New DicomDir(Nothing, Nothing)
Dim autoSearch As Boolean = False
dicomDir.Reset("d:\images")
dicomDir.SetFileSetId("12345")
Dim options As DicomDirOptions = dicomDir.Options
dicomDir.ResetOptions()
options.IncludeSubfolders = True
options.InsertIconImageSequence = False
options.RejectInvalidFileId = False
dicomDir.Options = options
dicomDir.InsertFile(Nothing)
If autoSearch Then
dicomDir.InsertFile(Nothing)
Else
Dim ds As DicomDataSet = New DicomDataSet()
ds.Load("d:\images\GM\image1.dcm", DicomDataSetLoadFlags.None)
dicomDir.InsertDataSet(ds, "d:\images\image1.dcm")
dicomDir.InsertFile("d:\Images\image2.dcm")
dicomDir.InsertFile("d:\Images\image3.dcm")
End If
dicomDir.Save()
End Sub
i have some error in function "dicomDir.InsertDataSet(ds, "d:\Images\image1.dcm") "
this is my message error : "SopInstanceUidAlreadyExists"
I have attached the error .. please see that :)
this pic for my error mr ..
![](http://img149.imageshack.us/img149/3626/myerror.th.png)
what can i do Mr ??
i need helpp
#4
Posted
:
Monday, September 14, 2009 6:40:42 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
That is the correct behavior. A Dicom Directory cannot have two dicom files with the same SOP Instance UID because the SOP Instance UID should be unique for each file. If you have two different files that have the same SOP Intstance UID then one of them needs to have that value changed.
If the file was modified and you wanted to re-insert it into the DicomDir, you need to first remove all of the necessary keys for the file with that SOP Instance UID before adding it back.
LEADTOOLS Support
Medical
Medical SDK Questions
please help my error in "create DicomDir files from Dicom files"
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.