ReferencedFileID
Moderator: Moderator Team
ReferencedFileID
I don't find the function ( in DCMTK ) that insert in file dicomdir the tag ReferencedFileID ( path to file dicom.dcm)
who can help me?
who can help me?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
The value of this tag is specified as a parameter of the DcmDirectoryRecord constructor.
Btw, why don't you use the wrapper class DicomDirInterface (see FAQ #30).
Btw, why don't you use the wrapper class DicomDirInterface (see FAQ #30).
Hi all, I know this is an old post but it closely related to my problem.
I'm using class DicomDirInterface just as described in FAQ #30 and I'm having problem with the ReferencedFileID in the DICOMDIR file.
My problem is due to the fact that the DICOMDIR file is in a directory (let's say C:\temp\) other than where the dicom images are (let's say C:\temp\patient\).
The DICOMDIR creation is sucessfull with a code very similar to the one in the FAQ, but then if I try to load the DICOMDIR file I get that the ReferencedFileID of the dicom files doesn't include the "patient\" needed to locate the images. i.e., it doesn't include the full path of the dicom file. The ReferencedFileID is always the name of the file (such as "IMG_0001"). According to the standard I should be able to specify the full path of the file ... isn't it ?.
The code is more or less the following (in kind of a pseudo-code):
pDicomdir->createNewDicomDir(AP_GeneralPurpose,"C:\\temp\\DICOMDIR");
m_pDicomdir->enableMapFilenamesMode();
for (all files in"C:\\temp\\patient\\")
{
pDicomdir->addDicomFile(FilePath, "C:\\temp\\patient\\");
}
m_pDicomdir->writeDicomDir();
How can I solve this problem ?
Thanks in advance,
ecoto
I'm using class DicomDirInterface just as described in FAQ #30 and I'm having problem with the ReferencedFileID in the DICOMDIR file.
My problem is due to the fact that the DICOMDIR file is in a directory (let's say C:\temp\) other than where the dicom images are (let's say C:\temp\patient\).
The DICOMDIR creation is sucessfull with a code very similar to the one in the FAQ, but then if I try to load the DICOMDIR file I get that the ReferencedFileID of the dicom files doesn't include the "patient\" needed to locate the images. i.e., it doesn't include the full path of the dicom file. The ReferencedFileID is always the name of the file (such as "IMG_0001"). According to the standard I should be able to specify the full path of the file ... isn't it ?.
The code is more or less the following (in kind of a pseudo-code):
pDicomdir->createNewDicomDir(AP_GeneralPurpose,"C:\\temp\\DICOMDIR");
m_pDicomdir->enableMapFilenamesMode();
for (all files in"C:\\temp\\patient\\")
{
pDicomdir->addDicomFile(FilePath, "C:\\temp\\patient\\");
}
m_pDicomdir->writeDicomDir();
How can I solve this problem ?
Thanks in advance,
ecoto
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
According to the DICOM standard you cannot store the full (= absolute) path in the DICOMDIR, but only the relative path. Just specify the the relative path (incl. the filename) as the first parameter ("filename") of DicomDirInterface::addDicomFile(). The optional second parameter ("directory") can be used when the DICOM file is not (yet) stored in the final directory. See documentation for details.
Hi Jörg,
I'm aware of the fact that you can only store the relative path of the file. Nevertheless, as you can see in my previous post, if the DICOMDIR file is stored in "C:\temp\" and the files in "C:\temp\patient\", then the file name would be, e.g., "patient\IMG_0001" (or ".\patient\IMG_0001"). When I use such a file name in the addDicomFile() method, then I get an "Illegal parameter" error, since the filename has more than 8 characters as well as it contains invalid characters.
Now, I already fixed it, by re-opening the DICOMDIR using a DcmDicomDir object and going through the file changing the ReferencedFileID of the appropiate records.
Is there any other way to fix it without re-opening the file ?
Regards,
ecoto
I'm aware of the fact that you can only store the relative path of the file. Nevertheless, as you can see in my previous post, if the DICOMDIR file is stored in "C:\temp\" and the files in "C:\temp\patient\", then the file name would be, e.g., "patient\IMG_0001" (or ".\patient\IMG_0001"). When I use such a file name in the addDicomFile() method, then I get an "Illegal parameter" error, since the filename has more than 8 characters as well as it contains invalid characters.
Now, I already fixed it, by re-opening the DICOMDIR using a DcmDicomDir object and going through the file changing the ReferencedFileID of the appropiate records.
Is there any other way to fix it without re-opening the file ?
Regards,
ecoto
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Are you sure that the problem is not caused by the fact that the subdirectory "patient" uses lower case characters (which is not allowed according to the DICOM standard)?
Btw, I just tried the following with dcmgpdir (which also uses the DicomDirInterface) and it worked as expected:
Btw, I just tried the following with dcmgpdir (which also uses the DicomDirInterface) and it worked as expected:
Code: Select all
dcmgpdir --verbose --input-directory c:\temp\ --recurse
Who is online
Users browsing this forum: No registered users and 1 guest